Trailing stop fails to move

Forums ProRealTime English forum ProOrder support Trailing stop fails to move

Viewing 15 posts - 1 through 15 (of 30 total)
  • #148516

    In the attached image a short position has opened at 27971.8

    The TS should move to ~ break even after a close below .24%, or 27904.6

    At 13:45 the candle closes at 27898.6 but the stop doesn’t move. I’ve never had this problem before using this TS code.

    #148518

    The code is missing.

    The above lines are just the settings and calculations, not the instructions that use them.

     

    #148524

    this is the full TS code. do you need to see the whole algo?

     

    #148531

    It works fine for me, I think it can be due to your setting:

    which sets HIGH for short trades and LOW for long trades to compute profits, which is rather uncommon , 1 is the settings that perfectly repliucates manual trading, many times 0 is also used.

    Another issue could be if you accumulate orders, then lines 10-14 would change everytime a new positio is added because TRADEPRICE(1) refers to the last entry price.

     

    #148538

    Thanks Roberto, it doesn’t accumulate orders so that’s not an issue.

    But are you saying that with ts2sensitivity  = 2 you would not expect the stop to move after a close below .24% ? and if not, at what point would it initiate? (I closed the position manually so I don’t know how it would have developed)

    What exactly is the effect of these lines? How does it change when the trailingstart begins?

    If ts2sensitivityshort=high what does this pertain to? the high of what?

    #148540

    That sensitivity had issues with the breakevenstop, “once” had to be removed and I made it different. Can you test this plz. Updated also the others. Or just remove it and use the close.

    The result is the same for positionprice & tradeprice(1) (old one)

    Using high/low low/high or close just made a small difference when the trailingstop activates.

     

    1 user thanked author for this post.
    #148545

    Paul solved the issue in case of accumulation of positions.

    As to sensitivity try using 0 with the old code and 1 with the updated one.

    If you are Long CLOSE-TRADEPRICE (or better POSITIONPRICE) could trigger a trailing stop, while LOW-TRADEPRICE could not, especially when a long body shows.

     

    2 users thanked author for this post.
    #148550

    That sensitivity had issues with the breakevenstop

    Thanks Paul, I think I had misunderstood how the sensitivity worked. The new code you posted above gives exactly the same backtest results as what I had so I’ll just have to watch how it behaves in live trading.👍

    I didn’t use  *sl though, just the values that I had been using. Do you set your TS as a % of the stoploss?

    #148552

    Also, can this be used both with or without cumulative orders ?

    #148559

    robertogozzi that could mean that variation (ts=3) cannot be used reliable? but explains that gains are sometimes higher in a backtest. I will have a closer look.

    nonetheless I ‘ve tested it with the old code tradeprice(1) and modifications for positionprice and the results are identical so it seems that this version is allround, for normale use & with cumulative orders.

    About your other question about % for the SL, yes in another strategy. I will post it. Hope you find it interesting and have some new ideas!

    1 user thanked author for this post.
    #148560

    Yes, with Paul‘s update it works in both cases.

     

    1 user thanked author for this post.
    #148562

    Well Paul, it can be used but it seems contrary to the principles of a trailing stop which is locking in some profits. If you are Long, computing the difference between CLOSE (or even HIGH) and POSITIONSIZE grants the highest profit is taken into consideration, while using LOW will compute the lowest profit reached (in some cases it may not be enough to trigger the start of the trailing).

    Option 3 may actually yield better gains, but this can be accomplished using CLOSE (or HIGH) with a higher TrailingStart, which makes more sense in my opinion, rather than setting a lower trailing start but using LOW to compute a smaller gain.

     

    1 user thanked author for this post.
    #148574

    I agree with all said. It’s an another parameter and not necessarily a very useful one, but the close can always be used. Thanks for the input!

     

    #148775

    @Paul, what do you think of this as a typicalprice sensitivity option? I only tried it on one algo and after re-optimizing was able to get a slightly better result. Seems logical as that is the calculation I mostly use for MAs, so it should best represent the point where price has crossed a certain level.

    Could be a useful compromise in some cases … or maybe its just too many options for the sake of a few €  ???

    I didn’t try (low+high+close+open)/4

    #148789

    It started with sometimes there was a long spike which closed much lower (long position) and the trailingstop wasn’t triggered and the market reversed. That’s why I added the option high for long/low for short instead of close, later I thought it couldn’t  hurt to add the opposite. In your case I should test it, and maybe you can test also long (high+high+close/3) but I think it’s a bit too much. If you plot the the trailingstop, you want to see quickly if it’s triggered or not and using such combinations it makes it a bit harder.

Viewing 15 posts - 1 through 15 (of 30 total)

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