Bonjour tout le monde,
Je cherche à mettre en place un systeme de break out avec une seule prise de position par jour a l”achat ou/et a la vente .
La prise de position est faite sur la cassure du haut et sur la barre meme de la cassure (achat).
Malheureseusement même avec un compteur celui-ci me prends quand même des positions apres un trade gagnant ou perdant et ne respecte pas le nombre de 1 trade achat-1 trade vente.
quelqu’un pourrait t il me debugger la situation ?
merci
DEFPARAM CUMULATEORDERS = FALSE
DEFPARAM FLATBEFORE = 080000
DEFPARAM FLATAFTER = 171500
ONCE NbBarLimit = 111
plushaut = HIGHEST[2](high)
plusbas = LOWEST[2](low)
IF TIME = 081000 THEN
MyCanal = (plushaut-plusbas)<(25*pipsize)
MylimitBuy = plushaut+1*pipsize
Mylimitsell = plusbas-1*pipsize
countbuy = 0
countsell = 0
lastindex = 0
MyIndex = barindex
ENDIF
IF Barindex >= Myindex + NbBarLimit THEN
MyLimitbuy = 0
MyLimitsell = 0
ENDIF
// Conditions pour ouvrir une position acheteuse
IF MylimitBuy AND Mycanal> 0 AND countbuy<1 THEN
BUY 1 contract AT MylimitBuy STOP
ENDIF
IF LOngonmarket and tradeindex<>lastindex then
countbuy = countbuy + 1
lastindex = tradeindex
endif
// Conditions pour ouvrir une position vendeuse
IF MylimitSell AND Mycanal > 0 THEN
SELLSHORT 1 contract AT Mylimitsell STOP
ENDIF
IF SHORTONMARKET AND TRADEINDEX<> lastindex then
countsell = countsell + 1
lastindex= barindex
endif
//STOP AND PROFIT
SET STOP LOSS SL
SET target PROFIT TP
Salut Nicolas;
pourrais tu enlever ce topic tu m”avais déja répondu
merci