Close to Supertrend
Nov 30, 2021

The Close to Supertrend indicator identifies potential reversal opportunities by highlighting instances where price action approaches the Supertrend line within a user-defined margin. This tool aims to help traders spot entry points near support or resistance levels established by the trend-following Supertrend calculation.
Usage
The Close to Supertrend indicator can be used to identify pullbacks within an established trend. When the price gets close to the active Supertrend line, the indicator plots signals to suggest a possible bounce or reversal:
- Long/Buy Signals: These appear when the trend is bullish (price is above the Supertrend line) and the candle's low comes within the specified percentage tolerance of the line.
- Short/Sell Signals: These appear when the trend is bearish (price is below the Supertrend line) and the candle's high comes within the specified percentage tolerance of the line.
Traders often use these signals to enter positions in the direction of the prevailing trend at more favorable prices. Stop losses are typically placed on the opposite side of the Supertrend line, as a close beyond this line indicates a trend reversal.
Details
This script is built upon the standard Supertrend calculation, which uses Average True Range (ATR) to determine volatility-based support and resistance levels. The "Close to" logic is an added layer that calculates a "Buy Range" and "Sell Range" based on a percentage tolerance. By monitoring if a candle's high or low penetrates this range without crossing the actual Supertrend line, the script flags potential "near-miss" scenarios that often precede a continuation of the trend.
Settings
Supertrend Settings
- ATR Period: Sets the lookback period for the ATR calculation used to determine volatility.
- Source: Defines the price data used for the calculation (default is HL2).
- ATR Multiplier: Controls the distance of the Supertrend line from the price; a higher multiplier results in a less sensitive trend line.
- Change ATR Calculation Method?: Allows the user to toggle between using a Simple Moving Average (SMA) of the True Range or the standard TradingView
ta.atrfunction.
Signal Settings
- Price Diff to Wait (in %): Determines the sensitivity of the "Close to" signals. A higher percentage will trigger signals even when the price is further from the Supertrend line, while a lower percentage requires the price to be very close.
FAQ
How do I access Close to Supertrend?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
What is the difference between "Cover" and "Buy" signals?
"Cover" or "Sell" signals indicate a change in the primary trend direction (the Supertrend flip), whereas "Buy" or "Short" signals indicate that the price has approached the existing trend line closely enough to trigger a potential entry alert.
Can I change how sensitive the alerts are?
Yes, by adjusting the "Price Diff to Wait (in %)" setting, you can control how close the price must get to the Supertrend line before a signal is generated.
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.