SuperTrend Strategy with Trend-Based Exits🟩 SuperTrend Strategy with Trend-Based Exits
This is a fully automated trend-following strategy based on the popular SuperTrend indicator, enhanced with a position sizing algorithm tied to stop-loss distance and dynamic entry/exit rules. The strategy is designed for futures trading with an emphasis on sustainable risk, realistic backtesting, and transparent logic.
🧠 Concept and Methodology
The strategy uses the SuperTrend indicator, which is derived from ATR (Average True Range) and is widely used to capture medium- to long-term market trends.
Key features:
✅ Entries are triggered only when the SuperTrend direction changes (trend reversal).
✅ Exits are performed using a dynamic stop-loss placed at the SuperTrend line.
✅ Position size is automatically calculated based on the trader’s fixed dollar risk per trade and the current distance to the stop-loss.
✅ Rounding logic is included to ensure quantity is valid for the exchange’s lot size.
This strategy does not use any take-profit or classic trailing stop — the position is only closed when the trend reverses or the stop is hit by touching the SuperTrend line.
⚙️ Default Parameters
ATR Length: 92
Factor: 4.6
Risk per trade: $200 (2% of the default $10,000 capital)
Lot step: 0.01
Commission: 0.05%
Slippage: 5 ticks
These default parameters are not universal. They were optimized specifically for ETHUSDT at 15M timeframe and may not produce viable results on other pairs and timeframes.
Users are encouraged to customize the settings according to specific asset’s volatility, timeframe and other characteristics.
❗ These default settings yield meaningful backtesting results on ETHUSDT with a reasonable number of trades (180+) over 6-month period. If applied to other assets, results may vary significantly.
📈 Position Sizing Logic
The strategy uses a dynamic position sizing formula:
position_size = floor((risk_per_trade / stop_loss_distance) / lot_step) * lot_step
This ensures the trader always risks a fixed dollar amount per trade and never exceeds a sustainable equity exposure (recommended 2% or less).
✅ Realism in Backtesting
To ensure realistic and non-misleading backtest results, this strategy includes:
— Slippage and commission settings matching average exchange conditions (commission = 0.05%, slippage 5 ticks).
— Position sizing based on stop-loss distance (not fixed contract quantity).
— A fixed risk-per-trade model that adheres to responsible capital management principles.
— This is in compliance with TradingView's Script publishing rules and House Rules.
📌 How to Use
Apply the strategy to a clean chart (preferably 15M for ETHUSDT by default).
If using another asset, adjust:
- ATR Length
- Factor
- Risk per trade
- Qty step (lot precision for the symbol)
Avoid using with other indicators unless you understand their purpose.
Use the Strategy Tester to evaluate performance and optimize parameters.
⚠️ Disclaimer
This is not financial advice. Always perform forward testing and assess risk before deploying any strategy on live capital. The strategy is designed for educational and experimental use.
Supetrend
SuperTrend Multi Time Frame Long and Short Trading Strategy
Hello All
This is non-repainting Supertrend Multi Time Frame script, I got so many request on Supertrend with Multi Time Frame. This is for all of them ..I am making it open for all so you can change its coding according to your need.
How the Basic Indicator works
SuperTrend is one of the most common ATR based trailing stop indicators.
In this version you can change the ATR calculation method from the settings. Default method is RMA.
The indicator is easy to use and gives an accurate reading about an ongoing trend. It is constructed with two parameters, namely period and multiplier. The default values used while constructing a Supertrend indicator are 10 for average true range or trading period and three for its multiplier.
The average true range (ATR) plays an important role in 'Supertrend' as the indicator uses ATR to calculate its value. The ATR indicator signals the degree of price volatility .
The buy and sell signals are generated when the indicator starts plotting either on top of the closing price or below the closing price. A buy signal is generated when the ‘Supertrend’ closes above the price and a sell signal is generated when it closes below the closing price.
It also suggests that the trend is shifting from descending mode to ascending mode. Contrary to this, when a ‘Supertrend’ closes above the price, it generates a sell signal as the colour of the indicator changes into red.
A ‘Supertrend’ indicator can be used on spot, futures, options or forex, or even crypto markets and also on daily, weekly and hourly charts as well, but generally, it fails in a sideways-moving market.
How the Strategy works
This is developed based on SuperTrend.
Use two time frame for confirm all entry signals.
Two time frame SuperTrend works as Trailing stop for both long and short positions.
More securely execute orders, because it is wait until confine two time frames(example : daily and 30min)
Each time frame developed as customisable for user to any timeframe.
User can choose trading position side from Long, Short, and Both.
Custom Stop Loss level, user can enter Stop Loss percentage based on timeframe using.
Multiple Take Profit levels with customisable TP price percentage and position size.
Back-testing with custom time frame.
This strategy is develop for specially for automation purpose.
The strategy includes:
Entry for Long and Short.
Take Profit.
Stop Loss.
Trailing Stop Loss.
Position Size.
Exit Signal.
Risk Management Feature.
Backtesting.
Trading Alerts.
Use the strategy with alerts
This strategy is alert-ready. All you have to do is:
Go on a pair you would like to trade
Create an alert
Select the strategy as a Trigger
Wait for new orders to be sent to you
This is develop for specially for automating trading on any exchange, if you need to get that automating service for this strategy or any Tradingview strategy or indicator please contact me I am have 8 year experience on that field.
I hope you enjoy it!
Thanks,
Ranga