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
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.
Bonjour Nicolas,
merci pour votre reponse 🙂