Prevent SL and TP on the entrance candle

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #97191 quote
    Be-n
    Participant
    Average

    I come back an old topic about SET STOP LOSS and I am asking help from my English friends 😉

    My question is simple (like my english). Is it possible to use SET STOP LOSS only from the following candle (the candle that follows my position) and make this condition strict ? And forbid to close out on the candle entrance with … SET STOP LOSS. If yes, how ? I hope to be clear.

    Thanks in advance and sorry for my approximate english.

    PS : This is the post originally published in French (ici)

    #97193 quote
    robertogozzi
    Moderator
    Master

    You have to place SET STOP LOSS 0 to remove any stop loss and place it again when you need it.

    Be warned that your broker might rise your margin requirements if not SL is placed when a trade is entered.

    #97196 quote
    GraHal
    Participant
    Master

    Is it possible to use SET STOP LOSS only from the following candle (the candle that follows my position)

    If you place the code below as the final / bottom line of your strategy then this will achieve what you need?

    I stand to be corrected by the coding Wizards?? 🙂

    Set Stop pLoss x
    #97198 quote
    robertogozzi
    Moderator
    Master

    No GraHal, ProOrder will read the whole code before the next candle opens, so, no matter where you place it, it’ll be set. The only workaround is to put it in a IF…ENDIF block so that it is executed after the next candle closes.

    This has a main drawback, because when a trade is entered ProOrder will use whatever SL had been set by the prior trade that was entered (and exited), so setting it to ZERO on the first candle is the only way not to have it at all.

    #97204 quote
    Vonasi
    Moderator
    Master

    Does setting it to zero actually work because it didn’t used to? I seem to recall that we concluded that it was better just to set the stop loss to 100% rather than use zero.

    #97213 quote
    robertogozzi
    Moderator
    Master

    They behave the same, I tried this code on DAX, 1h TF:

    FastMA = average[5]
    SlowMA = average[20]
    MyAvg  = average[200]
    IF (FastMA CROSSES OVER SlowMA) AND (close > MyAvg) AND not OnMarket THEN
       BUY AT MARKET
       SET TARGET pPROFIT 100
       SET STOP   pLOSS   0    //or 10000 or entirely commented out is the same
    ENDIF
    #97229 quote
    Vonasi
    Moderator
    Master

    They behave the same

    Maybe you could try setting a stop loss and then setting it to zero one bar later as I seem to recall that this was what would not work for me before. Sorry my platform is closed at the moment and my girlfriend has decided we are having a PRT free evening otherwise I would test it myself!

    #98334 quote
    Be-n
    Participant
    Average

    Thank you for this solution Robertogozzi ! It corresponds to my expectations ! I’m going to shout it in French ! ^^

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

Prevent SL and TP on the entrance candle


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Be-n @be-n Participant
Summary

This topic contains 7 replies,
has 4 voices, and was last updated by Be-n
6 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 04/26/2019
Status: Active
Attachments: No files
Logo Logo
Loading...