Adaptive Supertrend w/ Floating Levels
Jun 23, 2022

The Adaptive Supertrend w/ Floating Levels indicator provides a more reactive trend-following mechanism by adjusting its calculation period based on the market's coefficient of determination. This tool aims to enhance the standard Supertrend's performance by making it more responsive to minor fluctuations while maintaining its core objective of trend tracking.
Usage
The indicator can be used to identify trend direction and potential reversal points. Users can monitor the central Supertrend line, which changes color based on the current market bias (green for bullish, red for bearish).
The floating levels (Upper, Middle, and Lower) act as dynamic filters. These levels are calculated based on the highest and lowest values of the Supertrend over a specific lookback period. Traders can use these levels to:
- Filter out false trend reversals when the price remains within the floating range.
- Identify overextended market conditions when price crosses above the top floating level or below the bottom level.
- Confirm entries when the Supertrend direction aligns with price action relative to the floating levels.
Details
The adaptivity is achieved by calculating the r-squared (coefficient of determination) of the price source. This statistical measure evaluates the correlation of the price with a linear regression line. When the "Make it adaptive?" setting is enabled, the script modifies the ATR period dynamically. This allows the indicator to "tighten" its reaction time during high-correlation moves and broaden it during choppy or sideways periods.
The floating levels provide a secondary layer of analysis, creating a dynamic channel around the Supertrend line. These are derived from a percentage-based calculation of the recent Supertrend range, offering a contextual view of where current prices sit relative to recent trend history.
Settings
Basic Settings
- Source: Determines the price data used for the indicator calculations (default is HL2).
- Period: The base lookback period for the ATR calculation.
- Multiplier: The factor by which the ATR is multiplied to set the distance of the Supertrend bands.
- Make it adaptive?: Toggles the r-squared-based period adjustment on or off.
Advanced Settings
- Floating Level Lookback Period: Sets the number of bars used to determine the highest and lowest Supertrend values for level calculation.
- Floating Levels Up Level %: Adjusts the position of the upper floating level within the calculated range.
- Floating Levels Down Level %: Adjusts the position of the lower floating level within the calculated range.
UI Options
- Color bars?: When enabled, colors the price bars based on the current trend direction.
- Show Floating Levels?: Toggles the visibility of the dynamic upper, middle, and lower channel lines.
- Fill Floating Levels?: Toggles the background shading between the floating levels for better visual clarity.
FAQ
How do I access the Adaptive Supertrend w/ Floating Levels?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
How does the adaptive feature benefit my trading?
By using a dynamic period based on statistical correlation, the indicator reduces lag during strong trends and reduces noise during consolidation, potentially leading to earlier entries and fewer whipsaws compared to a static Supertrend.
What do the floating levels represent?
They represent a dynamic boundary based on the recent range of the Supertrend itself. They help identify whether a move is significant relative to recent volatility or if it is just "noise" within a established trend.
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.