Trailing Stop Loss with Profit Taking

Forums ProRealTime English forum ProBuilder support Trailing Stop Loss with Profit Taking

  • This topic has 3 replies, 2 voices, and was last updated 7 months ago by avatarJS.
Viewing 4 posts - 1 through 4 (of 4 total)
  • #231127

    Hi everyone,

    I recently came across a very interesting indicator that combines a trailing stop loss with a built-in profit target. While the pine script for this indicator seems well-written, it’s quite complex.

    I was wondering if there’s a similar indicator already available in PRT’s library? I’m familiar with the existing trailing stop indicators based on ATR in PRT library, but I’m looking for something that also incorporates a profit target functionality similar to one below.

    Does anyone here have experience with creating or using such an indicator on PRT? Any suggestions would be greatly appreciated!

    https://www.tradingview.com/script/gUXnDioT-Interactive-ATR-Stop-Loss-TANHEF/

     

     

     

     

    #231163
    JS

    Hi,

    The indicator below is the “ATR Trailing Stop” from the library (https://www.prorealcode.com/prorealtime-indicators/another-atr-trailing-stop/ ) with a small extension to show a “Take Profit”…

    You can set the TPL (TakeProfitLong) and TPS (TakeProfitShort) in points in the “Settings window”…

    The “p” is the period of the ATR

    De “mult” is de multiplier van de ATR

    1 user thanked author for this post.
    #231168

    Thank you.

    It works and I made small change to the code by Changing TPL & TPS to decimal which means TPL & TPS will be used as % of profit instead of open + value.

    So new code has two changes as below:

    TPLong=Open+(Open*TPL)

    TPShort=Open-(Open*TPS)

     

    do you know what is the “MODE” in setting? couldn’t work out what it does and why is it there?

    #231169
    JS

    From the original “leaflet”…

    The ATR trailing stop has 2 modes: (“mode” setting)

    • mode=0 ; the trend line will keep the same level each time a cross over occur
    • mode>0 ; the trend line will take the highest or lowest Close level each time a cross over occur
    1 user thanked author for this post.
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