Supertrend Strategy
Oct 25, 2024

The Supertrend Strategy indicator is a trend-following tool designed to capture market momentum by combining volatility-based Supertrend signals with RSI-based momentum filters for optimized entry and exit points.
Usage
The strategy identifies market trends and executes trades based on the interaction between price and the Supertrend line. It can be used to automate trade entries while managing exits through both profit targets and overbought/oversold conditions.
- Long Entry: Occurs when the price closes above the Supertrend line on the specified timeframe.
- Short Entry: Occurs when the price closes below the Supertrend line on the specified timeframe.
- Position Reversal: If a signal in the opposite direction is detected while a position is open, the current trade is closed and a new trade is opened in the new direction.
- Exits: The strategy exits positions using three criteria: a fixed percentage take profit, a Supertrend trend reversal, or an RSI extremity (overbought for longs, oversold for shorts).
Details
This script utilizes the Average True Range (ATR) to calculate the Supertrend, which serves as a dynamic trailing stop-loss and trend confirmation tool. By incorporating the Relative Strength Index (RSI) on a separate (often lower) timeframe, the strategy aims to capture gains during peak momentum before potential mean reversion occurs. This dual-layer approach helps in locking in profits even if the primary trend remains intact but the price has reached an exhaustive state.
Settings
Supertrend Settings
- Supertrend Factor: The multiplier applied to the ATR to determine the distance of the Supertrend line from the price.
- ATR Period: The lookback period used to calculate the Average True Range for volatility measurement.
- Supertrend Timeframe: The specific timeframe from which the Supertrend calculation is derived.
RSI Settings
- RSI Timeframe: The timeframe used to calculate RSI values for exit signals.
- RSI Length: The number of bars used in the RSI calculation.
- RSI Upper Limit: The threshold above which a long position will be closed (Overbought).
- RSI Lower Limit: The threshold below which a short position will be closed (Oversold).
Strategy Settings
- Take Profit: The fixed percentage profit target calculated from the average position price.
FAQ
How do I use this indicator on my charts? You can apply the script to any asset. Ensure your chart timeframe matches the Supertrend Timeframe setting for the most accurate signal representation and to avoid discrepancies.
Where can I find more tools like this? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Does this strategy repaint? This strategy does not repaint provided the timeframe on your chart matches the timeframe configured in the Supertrend settings.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.