What is the calculation to move a stop with the SuperTrend line?

Forums ProRealTime English forum ProOrder support What is the calculation to move a stop with the SuperTrend line?

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

    Can anyone please help me with the code/formula to trail my stop into profit along with the SuperTrend line.

    I was hoping that ProRealtime would allow me to specify a level for my stop, (i.e. set stop loss 17000), but it looks like that isn’t possible.

    Regards

    Steve

    #5111

    Of course it is already possible to set a trailing stop on an indicator line, just like the SuperTrend. You have to define the distance between the Close and the indicator to reflect the new stop at each bar, like a dynamic stoploss.

    Example :

     

    As you can see on the picture attached, the stoploss of the buy order is moving correctly with the supertrend line. Hope it helps.

    #5200

    Thanks Nicolas, I’ve tried that, I get an error from the system that the trading system has to be stopped because it tried to put the stop at a negative level (but or sell both give the same error) Any ideas?

    If I make an indicator to show the position of the stop loss it will show the correct position, but if I try to use set stop trailing SuperTrend[3,10] then it sets the stop 7200 pips away, so it seems like the system is using some other value for SuperTrend?

    Regards

     

    Steve

    #5202

    If Close is above the supertrend and you are in buying conditions, this code should do the trick. But if you are using the same one for short orders, you’ll have negative values indeed! Because SuperTrend is above the price when you sell the instrument. You should use these lines instead in your code :

     

     

    #39744
    Seb

    Unfortunately this method of trailing stop is not effective when I try it:

     

    #39754

    You can give a try to this method also: https://www.prorealcode.com/blog/learning/moving-stoploss-dynamic-informations-proorder/

    1 user thanked author for this post.
    avatar Seb
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