probleme avec ce code: suggestion fin du code?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #210405 quote
    FXtonio
    Participant
    New

    Bonjour à tous,

    je viens de trouver cette stratégie mais je n’arrive pas à corriger la ligne 30 du code  :

    “” 30 pips in gain to activate the breakeven function””

    ça me met “suggestion fin du code”

    Pouvez-vous m’aider ?

    Merci d’avance pour vos réponse

    ci joint le code:

    DEFPARAM CumulateOrders = False
    timeEnterBefore = time >= 083000
    timeEnterAfter = time <= 213000
    
    UNO = (open[2] - close) > 10*pipsize
    
    IF timeEnterAfter AND timeEnterBefore AND (open[2]>close[1]) AND (close[1]>close) AND UNO THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    DUE = (close - open[2]) > 25*pipsize
    
    IF timeEnterAfter AND timeEnterBefore AND (open[2]<close[1]) AND (close[1]<close) AND DUE THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    
    SET TARGET pPROFIT 75
    SET STOP pLOSS 70
    
    startBreakeven = 5
    30 pips in gain to activate the breakeven function
    PointsToKeep = 10
    5 pips to keep in profit above/below entry price when the breakeven is activated
    
    test if the price have moved favourably of "startBreakeven" points already
    
    // --- LONG side
    
    SCA = 30
    
    IF LONGONMARKET AND (close - tradeprice(1)) >= (SCA* pipsize) THEN
    breakevenLevel = tradeprice(1) + (SCA* pipsize) calculate the breakevenLevel
    place the new stop orders on market at breakevenLevel
    IF breakevenLevel > 0 THEN
    SELL AT breakevenLevel STOP
    ENDIF
    ENDIF
    --- SHORT side
    IF SHORTONMARKET AND (tradeprice(1) - close) >= (SCA* pipsize) THEN
    breakevenLevel = tradeprice(1) + (SCA* pipsize) calculate the breakevenLevel
    place the new stop orders on market at breakevenLevel
    IF breakevenLevel > 0 THEN
    EXITSHORT AT breakevenLevel STOP
    ENDIF
    ENDIF
    #210407 quote
    Nicolas
    Keymaster
    Master

    Les lignes 20 à 25 ne sont pas du code, mais du texte, qu’il faut commenter (mettre un // devant), sinon on ne peut pas l’interpréter, d’où l’erreur.

    #210599 quote
    FXtonio
    Participant
    New

    Bonjour Nicolas,

    merci pour votre reponse 🙂

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

probleme avec ce code: suggestion fin du code?


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
FXtonio @fxtonio Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by FXtonio
3 years ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 02/24/2023
Status: Active
Attachments: No files
Logo Logo
Loading...