I was inspired by the topic Trend detection codes
I would like to gather snippets for exit-codes. So far i got theese:
//EXIT ZOMBIE TRADE
EZT = 1
if EZT then
IF (longonmarket and barindex - tradeindex (1 )>= b1 and positionperf > 0 ) or (longonmarket and barindex - tradeindex (1 )>= b2 and positionperf < 0 ) then
sell at market
endif
IF (shortonmarket and barindex - tradeindex (1 )>= b3 and positionperf > 0 ) or (shortonmarket and barindex - tradeindex (1 )>= b4 and positionperf < 0 ) then
exitshort at market
endif
endif
RSIexit = 1
if RSIexit then
myrsi= rsi [ r] (close )
if myrsi< rl and barindex - tradeindex > 1 and longonmarket and close > positionprice then
sell at market
endif
if myrsi> r11 and barindex - tradeindex > 1 and shortonmarket and close < positionprice then
exitshort at market
endif
endif