Hi all,
is there a way to close losing trades after x amount of bars whereas the trade would remain open when in profit?
I know how to theoretically close all trades after x amount of bars, but am struggling to find a way to include running P/L into the condition.
Thanks!
IF longonmarket and barindex-tradeindex(1)>= b1 and positionperf<0 then
sell at market
endif
IF shortonmarket and barindex-tradeindex(1)>= b2 and positionperf<0 then
exitshort at market
endif