Trailing Stop Loss from High

Forums ProRealTime English forum ProOrder support Trailing Stop Loss from High

Viewing 4 posts - 1 through 4 (of 4 total)
  • #102783

    Hi All,

    Apologies if this has been asked before but I have searched the forums and couldn’t find how to do this. I am still a beginner at this but really enjoying it.

    I am trying to code a trailing stop loss which is a multiple of ATR from the last high since being in the market (i.e. Tradeprice). Once the close goes through this level then sell at next open.

    I thought using the Barindex-tradeindex like in code below was correct but sometimes it just sells the next day from purchase even if the move was in a profitable position.

    CURRENT CODE:

    The SL is= ATR*3

    Really scratching my head at this so any help would be greatly appreciated.

    Thanks a million.

     

     

    #102785

    WhiteWolf – Welcome to the forums.

    The ‘General Trading Discussions’ forum is for….. well general trading discussions. Your question is automatic trading strategy coding related and so should be in the ProOrder forum. I have moved it – please try to post in the most relevant forum with future posts.

    #102786

    Try changing HIGH to HIGH[1] because close will more than likely always be less than the current high unless it is equal to it!

    1 user thanked author for this post.
    #103430

    Apologies and thanks for your help.

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

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