OPEN-SOURCE SCRIPT
Step-Based Trailing Stop-Loss Indicator

This indicator is built for momentum traders who want to maximize winning trades and minimize losses through a smart, step-based trailing stop-loss system. Instead of using a fixed Take Profit, this tool dynamically protects profits once the trade reaches a favorable RR (Risk-to-Reward) level.
How It Works:
Manual Entry Input
You enter your Entry Price and select Buy/Sell in the settings.
This flexibility allows backtesting or live trade tracking.
Initial Setup
Default SL: 50 ticks(Tested on us30,but works on any pair you just need to adjust SL)
TP for reference: 4R — can be used for benchmarking, but we don't limit profits with a hard TP.
Trailing Logic
Once price reaches 3R in profit:
The SL begins trailing.
It starts at 2R, keeping a 1R cushion behind the max profit.
For every 0.5R gain, SL also moves up by 0.5R:
Example: At 3.5R → SL is at 2.5R
At 5.0R → SL is at 4.0R
This trailing continues until the SL is hit or the trend exhausts.
Chart Features
🟧 Entry Line
🔴 Initial SL
🟢 Reference TP (4R, optional)
🟣 Dynamic Trailing SL
🏷️ Labels for Entry & SL levels
How It Works:
Manual Entry Input
You enter your Entry Price and select Buy/Sell in the settings.
This flexibility allows backtesting or live trade tracking.
Initial Setup
Default SL: 50 ticks(Tested on us30,but works on any pair you just need to adjust SL)
TP for reference: 4R — can be used for benchmarking, but we don't limit profits with a hard TP.
Trailing Logic
Once price reaches 3R in profit:
The SL begins trailing.
It starts at 2R, keeping a 1R cushion behind the max profit.
For every 0.5R gain, SL also moves up by 0.5R:
Example: At 3.5R → SL is at 2.5R
At 5.0R → SL is at 4.0R
This trailing continues until the SL is hit or the trend exhausts.
Chart Features
🟧 Entry Line
🔴 Initial SL
🟢 Reference TP (4R, optional)
🟣 Dynamic Trailing SL
🏷️ Labels for Entry & SL levels
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.