acheter avec montant initial plus gain ou pertes

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #179504 quote
    arrot
    Participant
    Junior

    bonsoir,

    Au départ j’achète avec la totalité du versement initial. je vends la position avec gain ou pertes. j’obtiens un montant dans mon compte que je veux mobiliser entièrement pour l’achat suivant

    merci de votre aide pour adapter ma programmation.

    // Définition des paramètres du code
    DEFPARAM CumulateOrders = False // Cumul des positions désactivé
    
    // Conditions pour ouvrir une position acheteuse
    c1 = (close >= close)
    indicator1 = ExponentialAverage[5](close)
    indicator2 = ExponentialAverage[150](close)
    c2 = (indicator1 > indicator2)
    
    IF c1 AND c2 THEN
    BUY 10000 CASH AT MARKET
    ENDIF
    
    // Conditions pour fermer une position acheteuse
    indicator3 = ExponentialAverage[5](close)
    indicator4 = ExponentialAverage[150](close)
    c3 = (indicator3 < indicator4)
    
    IF c3 THEN
    SELL AT MARKET
    ENDIF
    
    #179533 quote
    Nicolas
    Keymaster
    Master

    Si j’ai bien compris 10000 est la totalité du compte. Pour récupérer l’info des pertes et profits de la stratégie courante on utilise STRATEGYPROFIT, donc tu dois modifier la ligne 11 avec :

    BUY 10000+STRATEGYPROFIT CASH AT MARKET
    #179684 quote
    arrot
    Participant
    Junior

    merci beaucoup Nicolas…

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

acheter avec montant initial plus gain ou pertes


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
arrot @arrot Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by arrot
4 years, 4 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 10/12/2021
Status: Active
Attachments: No files
Logo Logo
Loading...