OPEN-SOURCE SCRIPT
Twin Range Filter – Buy/Sell Signals

The Twin Range Filter is a trend-following indicator that combines two adaptive volatility filters to identify potential market reversals and trend continuations. It uses two configurable smoothing periods (fast and slow) to calculate a dynamic range around price, filtering out market noise and highlighting meaningful shifts in direction.
This indicator plots BUY and SELL signals based on price action in relation to the range filter, as well as internal trend conditions.
✅ How It Works:
Long Signal (BUY) is triggered when:
Price is above the filtered range (showing strength), and
Short-term upward momentum is confirmed.
Short Signal (SELL) is triggered when:
Price is below the filtered range (showing weakness), and
Short-term downward momentum is confirmed.
The signals are highlighted using green "Long" and red "Short" labels on the chart.
Background colors reinforce the current directional bias.
🔔 Alerts:
Long Signal – A new BUY condition has been detected.
Short Signal – A new SELL condition has been detected.
📌 Use Cases:
Entry timing for swing or intraday trades
Trend confirmation filter
Signal generator in automated strategies (when paired with a strategy script)
This indicator plots BUY and SELL signals based on price action in relation to the range filter, as well as internal trend conditions.
✅ How It Works:
Long Signal (BUY) is triggered when:
Price is above the filtered range (showing strength), and
Short-term upward momentum is confirmed.
Short Signal (SELL) is triggered when:
Price is below the filtered range (showing weakness), and
Short-term downward momentum is confirmed.
The signals are highlighted using green "Long" and red "Short" labels on the chart.
Background colors reinforce the current directional bias.
🔔 Alerts:
Long Signal – A new BUY condition has been detected.
Short Signal – A new SELL condition has been detected.
📌 Use Cases:
Entry timing for swing or intraday trades
Trend confirmation filter
Signal generator in automated strategies (when paired with a strategy script)
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.