Supertrend Filter
Dec 4, 2018

The Supertrend Filter indicator is a recursive derivation of the classic Supertrend that functions as a trend-following filter rather than a standard trailing stop. By integrating past outputs back into the calculation, it provides a smoothed perspective on market direction that behaves more like a dynamic moving average at higher period settings.
Usage
The Supertrend Filter can be used to identify the prevailing market trend and filter out noise during sideways price action. Unlike the standard Supertrend, which acts as a hard stop-loss level, this version uses recursive logic to produce a more fluid line.
When price is above the filter and the line turns green, the market is considered to be in a bullish regime. Conversely, when price is below the filter and the line turns red, the market is in a bearish regime. Traders can use these color changes as signals for potential trend reversals or as a directional bias for other entry techniques.
Details
The script modifies the standard Supertrend logic by swapping internal conditions and reusing the output in its own calculation. It utilizes a smoothing factor based on a squared period to calculate a mean deviation, which is then used to determine the upper and lower bands. Because of this recursive nature, the indicator becomes less linear and more responsive to long-term trends as the Period input increases.
Settings
- Period: Determines the lookback period for the filter calculation. Higher values result in a smoother, more average-like line.
- Factor: A decimal value (typically between 0 and 1) that controls the sensitivity of the filter. It is recommended to increase this value as the Period increases to maintain optimal tracking. Recommended pairings include:
- Period 1-50: Factor 0.5
- Period 50-100: Factor 0.6
- Period 100-150: Factor 0.7
- Period 150-200: Factor 0.8
- Period 200-300: Factor 0.9
FAQ
How do I interpret the color changes? Green indicates an uptrending market where the filter is moving higher, while red indicates a downtrending market where the filter is moving lower.
Is this intended to be used as a stop loss? While it is derived from a trailing stop indicator, the Supertrend Filter is specifically designed to act as a directional filter. Its recursive nature makes it better suited for bias identification than for placing hard stops.
How can I access the Supertrend Filter? 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.