Trend Range Detector (Zeiierman)█ Overview
Trend Range Detector (Zeiierman) is a market structure tool that identifies and tracks periods of price compression by forming adaptive range boxes based on volatility and price movement. When prices remain stable within a defined band, the script dynamically draws a range box; when prices break out of that structure, the box highlights the breakout in real-time.
By combining a volatility-based envelope with a custom weighted centerline, this tool filters out noise and isolates truly stable zones — providing a clean framework for traders who focus on accumulation, distribution, breakout anticipation, and reversion opportunities.
Whether you're range trading, spotting trend consolidations, or looking for volatility contractions before major moves, the Trend Range Detector gives you a mathematically adaptive, visually intuitive structure that maps the heartbeat of the market.
█ How It Works
⚪ Range Formation Engine
The core of this indicator revolves around two conditions:
Distance Filter: The maximum distance between all recent closes and a dynamic centerline must remain within a volatility envelope.
Volatility Envelope: Based on an ATR(2000) multiplied by a user-defined factor to account for broader market volatility trends.
If both conditions are satisfied over the most recent length bars, a range box is drawn to visually anchor the zone.
⚪ Dynamic Breakout Coloring
When price breaks out of the top or bottom of the active range box, the box color shifts in real-time:
Blue Boxes represent areas where price has remained within a defined volatility envelope over a sustained number of bars. These zones reflect stable, low-volatility periods, often associated with consolidation, equilibrium, or market indecision.
Green Boxes for bullish breakouts.
Red Boxes for bearish breakdowns.
This allows traders to visually spot transitions from consolidation to expansion phases without relying on lagging signals.
█ Why Use a Weighted Close Instead of SMA?
A standard Simple Moving Average (SMA) treats all past closes equally, which works well in theory, but not in dynamic, fast-shifting markets. In this script, we replace the traditional SMA with a speed-weighted average that reflects how aggressively the market has moved bar-to-bar.
⚪ Here's why it matters:
Bars with higher momentum (larger price differences between closes) are given more weight.
Slow, sideways candles (typical in noise or low volume) contribute less to the calculated centerline.
This method creates a more accurate snapshot of market behavior, especially during volatile phases. As a result, the indicator adapts to market conditions more effectively, helping traders identify real consolidation zones, not just average lines distorted by flat bars or noise.
█ How to Use
⚪ Range Detection
Boxes form only when price remains consistently close to the speed-weighted mean.
Helps identify sideways zones, consolidations, and low-volatility structures where price is “charging up.”
⚪ Breakout Confirmation
Once price exits the top or bottom boundary, the box immediately highlights the direction of the break.
Use this signal in conjunction with your own momentum, volume, or trend filters for higher-confidence trades.
█ Settings
Minimum Range Length: Number of candles required for a valid range to form.
Range Width Multiplier: Adjusts the envelope around the weighted average using ATR(2000).
Highlight Box Breaks: Enables real-time coloring of breakouts and breakdowns for immediate visual feedback.
-----------------
Disclaimer
The content provided in my scripts, indicators, ideas, algorithms, and systems is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
Rangedetector
Predictive Ranges [LuxAlgo]The Predictive Ranges indicator aims to efficiently predict future trading ranges in real-time, providing multiple effective support & resistance levels as well as indications of the current trend direction.
Predictive Ranges was a premium feature originally released by LuxAlgo in 2020.
The feature was discontinued & made legacy, however, due to its popularity and reproduction attempts, we deemed it necessary to release it open source to the community.
🔶 USAGE
The primary purpose of this indicator is to provide potential support & resistance levels on the chart by estimating future trading ranges.
When the price reaches one of the upper/lower levels of the Predictive Ranges we can expect the price to reverse.
If the price exits the predicted range, new levels are given in real-time & they do not repaint. Higher "Factor" values allow returning longer term and wider ranges less susceptible to be exited.
🔹 Estimating Trend Directions
Users are able to easily estimate trend directions by looking at the central levels of the predictive ranges, which represent an estimate of the price central tendency.
If this central level increases it means the price is up-trending, if it is decreasing price is down-trending.
🔶 SETTINGS
Length: ATR Length used for the indicator calculation. Higher values will tend to return ranges of equal width.
Factor: Control the ranges width. Higher values will return less frequent ranges, each having a higher width.
Timeframe: Indicator timeframe output.
Source: Input source of the indicator. It is recommended to use input sources on the same scale as the price.