Exit codes snippets

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #190343 quote
    SnorreDK
    Participant
    Junior

    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
    #190346 quote
    GraHal
    Participant
    Master

    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.)

    #192899 quote
    SnorreDK
    Participant
    Junior

    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?

    #192900 quote
    GraHal
    Participant
    Master
    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)?

    #192906 quote
    fifi743
    Participant
    Master

    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

    #192907 quote
    SnorreDK
    Participant
    Junior

    Thanks Fifi for the explenation!
    whats the code for exit on shortmarket?

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Exit codes snippets


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
SnorreDK @snorredk Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by SnorreDK
3 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/23/2022
Status: Active
Attachments: No files
Logo Logo
Loading...