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
Great idea, let’s all contribute!!
Link to above / this Topic added as Log 315 here …
Snippet Link Library
(Btw everyone … the link in the form above is available in cell H1 on the above Sheet if you want to copy & save for easy retrieval.)
Exit by Fifi
if longOnMarket and close>positionPrice and RSI[14](close)>X1 and close-open>X2 then //added by Fifi
sell at market
ENDIF
How wold this be coded för exitshort at market?
if ShortonMarket and close<positionPrice and RSI[14](close)<X1 and open-close>X2 then //added by Fifi
ExitShort at market
ENDIF
Maybe above?
Looks like it’s an exit when oversold (above) and overbought (the code you posted)?
For this code
if longOnMarket and close>positionPrice and RSI[14](close)>X1 and close-open>X2 then //added by Fifi
sell at market
ENDIF
the rsi is in over-purchase and that it is a big candle
Thanks Fifi for the explenation!
whats the code for exit on shortmarket?