changing trailing stop distance within code

Forums ProRealTime English forum ProOrder support changing trailing stop distance within code

Viewing 6 posts - 1 through 6 (of 6 total)
  • #143874

    Hi all,

    Can any one help me with below?

    The problem I have is that according to my set of rules which is coded for PRT I have an Stop Loss of 15 points and a Trailing Stop Loss of 23 points , but ( and this happened both yesterday and today) the trade was correctly entered but with a 23 point stop loss which did then trail as it was supposed to.

    How can I code for Initial Stop Loss of 15 points with a Trailing Stop Loss of 23 points ?

    I would like an initial fixed stop of 15 points that trails by 23 points eg after the trade is 8 points in profit then the stop would start to move.  So 15 point stop, market moves in my favor by 8 points, stop then trails.

    Thanks

     

    #143892

    You should set 8 as the starting point, not 23.

    The trailing stop always starts reading prices from TRADEPRICE (entry price) and counts pips from then. When the number of pips you set is reached it starts trailing.

    If you use one of the code snippets (Nicolas’ is likely to be the most used) it first sets your stop at break even, then increases your locked profits as price moves STEPSIZE pips in your favour.

     

    #143943

    thanks

    I think the issue with stepsize is that the stop will only move when when the previous candle ends.

    Where as the IG trailing stop works intracandle and moves every pip.  so you capture the move within the time frame.

    so perhaps looking from something like this

     

    Enter trade if x parameters are met.

    add STOP 15 points. STEPSIZE 8

    Should market move 8 point and stop is moved (steps).  Delete stop and enter IG trailing stop (which has step of 1)

    #143956

    Do not use the built-in SET STOP [p]TRAILING, since it has fixed STEPSIZE.

    Most of users use Nicolas’code (lines 17-56) at https://www.prorealcode.com/blog/trading/complete-trailing-stop-code-function/.

    Strategies are always executed at closing time (you can use MTF support as a workaround, as many do; just search the word MTF or MULTI TIME FRAME), so the trigger can be a bit late.

    The exit is at the very new SL calculated, instead, because a pending order is placed to set it.

     

     

     

     

    1 user thanked author for this post.
    #152216

    IG are launching version 11 shortly.

    Does version 11 have any additional functionality when it comes to coding and specifically trailing stops?

    Is there a link or page on here that shows improvements or USPs for new version?

     

    #152229

    No, it’s the same as before as TRAILING STOP is concerned. I believe this feature has more to do with IG rather than PRT, like partial closure of positions. We truly hope IG make life easier for us.

    Currently you can  use code snippets to mimick built-in trailing stop.

    New features can be found here https://www.prorealtime.com/en/new-features-ProRealTime-v11-1.

    New instructions and keywords at https://www.prorealcode.com/topic/list-of-new-instructions-indicators-available-in-prt-version-11/.

     

     

Viewing 6 posts - 1 through 6 (of 6 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login