AIR Supertrend (Average Interpercentile Range)
Jun 9, 2023

The AIR Supertrend (Average Interpercentile Range) indicator is a versatile trend-following tool that enhances the classic Supertrend formula by introducing statistical dispersion through the Average Interpercentile Range (AIR). This provides traders with a more robust method for identifying trend reversals and setting dynamic stop-loss levels compared to traditional ATR-based methods.
Usage
The Usage section describes how the script can be used to identify market trends and potential exit points.
- Trend Identification: When the price is above the indicator line, the trend is considered bullish (green). When the price is below the line, the trend is considered bearish (red).
- Dynamic Stop Loss: The indicator line acts as a trailing stop. Traders can adjust the percentile range to fine-tune how closely the stop follows price action.
- Volatility Filtering: By mixing ATR and AIR, users can balance the sensitivity of the indicator. Lowering the percentile range (e.g., to the 16th percentile) allows for more breathing room in volatile markets, while raising it creates a tighter "trailing" effect.
- Moving Average Confluence: The script includes optional global Moving Average labels (MA1-MA4) that can be displayed across different timeframes to confirm the primary trend direction.
Details
This script evolves the standard Supertrend by replacing or augmenting the Average True Range (ATR) with the Average Interpercentile Range (AIR). While the classic Supertrend relies on RMA-smoothed ATR, this version allows users to choose from 11 different smoothing algorithms, including Jurik, Tillson T3, and Ehlers Hann Window.
The AIR calculation measures statistical dispersion by calculating the difference between two percentiles of the high/low/close price array over a specified length. This approach can be more resilient to outliers than a simple range-based calculation.
Settings
Main Parameters
- Source: The price source used for the Supertrend calculation (default is HL2).
- Length: The lookback period for the range and smoothing calculations.
- Multiplier: The factor applied to the calculated range to determine the distance of the stop-loss line.
Range Mix
- ATR Active/Mult/MA: Toggles the ATR component, sets its individual weight, and selects the smoothing moving average type.
- AIR Active/Mult/MA: Toggles the AIR component, sets its individual weight, and selects the smoothing moving average type.
- % (Spacer): Sets the percentile offset for the AIR calculation (e.g., 16 uses the 16th and 84th percentiles).
Global MA Settings
- Smoothing Inputs: Specific parameters for advanced MAs, such as ALMA Offset/Sigma, Jurik Phase/Power, and Tillson T3 Volume Factor.
UI & Labels
- Fill/Fade: Toggles the background color fill between the price and the indicator line.
- Color Candles: Toggles bar coloring based on the current trend.
- MA Labels: Settings to display up to 4 different Moving Averages with customizable timeframes and types (SMA/EMA).
FAQ
- How do I interpret the AIR vs ATR setting? ATR measures the average range between highs and lows, while AIR measures the spread between specific percentiles. Using AIR often results in a smoother line that is less reactive to single-bar spikes.
- What are the best smoothing options for low-lag results? For reduced lag, consider using the Jurik Moving Average or the Tillson T3 options within the Range Mix settings.
- How can I access this indicator? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
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.