Hello guys, here’s a function that closes the positions after x bars:
IF OnMarket AND (BarIndex - TradeIndex) >=x THEN
SELL AT MARKET
EXITSHORT AT MARKET
ENDIF
But what if i would like to implement a function that does not close the position for at least x bars? Then just after that x bars let the system works normally with sl/tp/ts etc…?
Probably it’s more simple then i think, but i ask you for security.
Update: i managed to do that 🙂
IF OnMarket AND (BarIndex - TradeIndex)<=x THEN
set stop %loss 0
ENDIF
Yes, that was simple as i thought
You will have to add an ELSE condition to set the SL after those X bars.