Trailing Stop Formula

Forums ProRealTime English forum ProBuilder support Trailing Stop Formula

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

    I’m trying to write a trailing stop formula. I have managed to make it plot on the chart but I have a few questions.

    1. In PRT if I want to edit custom parameters like for instance the date or the ATR multiplier am I able to display that in the Price Settings screen alongside the width and style or do I have to got to Price Settings-Indicator -Modify Indicator to do that?
    2. How can I edit the formula so that if price closes below the trailing stop then the trailing stop will just stay at that current level and will not rise even if price keeps rising. (Its stops trailing and just goes horizontal at its current level)
    3. Is there a way to alter the date format so that it is DDMMYYYY

    Thanks

     

    #38316
    1. You’ll always need to go into the indicator settings in order to change any parameter of a custom indicator
    2. Not sure to understand but you could “flag” a variable if the price crosses under the TrailingStop level and test if this flag is not true in your conditional statement to move your TS (lines 15 to 22)
    3. Not possible, the default date format is YYYYMMDD
    1 user thanked author for this post.
    #38319

    I’ve tried a few things but I’m not great at loops

    That probably doesn’t work because it would only work until price closed back above the trailing stop.

    I’m trying to make the stop stay horizontal like the green line that I have drawn on this chart.

     

     

    #38325

    Not tested, but this code should work as intended:

     

    1 user thanked author for this post.
    #38337

    Thanks for that. I would never have got that !!

    I’ve added a default “entryprice” so that if entryprice is left as zero then it will use the current bars close.

    I’ve noticed that PRT doesn’t show the correct closing date for each weekly bar. The last 3 dates displayed are 5 June, 29 May and 22 May. If I set the trail startdate to those dates it wont plot. Why are the dates wrong? I have to go to a calendar to get the correct date for last Friday.

     

     

    #38340

    You can use OpenDate too.

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