Twin Range Filter
Apr 19, 2020

The Twin Range Filter indicator combines two distinct range filters to generate smoothed trend-following signals designed to reduce market noise and identify price reversals.
Usage
The Twin Range Filter is primarily used to identify trend direction and potential entry points based on price action relative to a calculated range. By averaging a "fast" and a "slow" range filter, the script provides a more balanced trend line that reacts to volatility while maintaining smoothness.
- Trend Identification: When the price is above the filter line and the filter is ascending, the trend is considered bullish. Conversely, when the price is below the filter line and the filter is descending, the trend is considered bearish.
- Signal Generation: The indicator plots "Long" and "Short" labels on the chart. A Long signal occurs when the trend shifts from bearish to bullish, and a Short signal occurs when the trend shifts from bullish to bearish.
- Filtering Noise: Users can adjust the sensitivity of the fast and slow components to suit different timeframes. While more responsive than a standard ATR-based setup, it is often used in conjunction with other technical analysis tools to confirm signals and filter out false breakouts in sideways markets.
Details
The script is based on the concept of a Range Filter, which calculates a price range based on the average change in price over a specific period. The Twin Range Filter specifically utilizes two separate calculations:
- Smooth Range Calculation: For both the fast and slow periods, the script calculates a smoothed average range using an Exponential Moving Average (EMA) of the absolute price change. This result is then smoothed again using a second EMA with a longer window (2n-1) and multiplied by a range multiplier.
- Dual Filter Averaging: The final range used for the filter is the arithmetic mean of the fast and slow smoothed ranges.
- Filter Logic: The filter line adjusts toward the price only when the price moves beyond the current range boundary. This creates a "staircase" effect that remains horizontal during periods of low volatility and moves aggressively during trend expansions.
The indicator logic was originally developed by colinmck and has been refactored for optimized performance and alert functionality.
Settings
- Source: Determines the price data used for all calculations (default is Close).
- Fast Period: The lookback period for the first, more responsive range filter.
- Fast Range: The multiplier applied to the first range filter to adjust its sensitivity.
- Slow Period: The lookback period for the second, less responsive range filter.
- Slow Range: The multiplier applied to the second range filter to adjust its sensitivity.
FAQ
How do I interpret the Long and Short labels? Long labels appear when the price crosses and stays above the averaged filter line while the filter begins to trend upward. Short labels appear when the price crosses below the filter line and the line begins to trend downward.
What is the advantage of using two filters instead of one? Using two filters allows the script to capture both short-term momentum and long-term trend structure simultaneously. This averaging process reduces the frequency of "whipsaw" signals that often occur with a single, highly sensitive range filter.
How can I access the Twin Range Filter? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Unlock Unlimited Access to the LuxAlgo Library
Upgrade your plan to get all indicators, strategies, charts, and full access to Quant, our AI agent.
Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.
Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2026 LuxAlgo Global, LLC.

