INVITE-ONLY SCRIPT

Auto Range Detector

54
Auto Range Detector

Overview

The Auto Range Detector is a Pine Script v6 indicator for TradingView, designed to identify price consolidation ranges and detect breakouts and fakeouts. It overlays dynamic and verified range boxes, highlighting zones based on inside candles, and includes real-time fakeout markers and hypothetical range marks. Custom fakeout verification reduces false signals by validating reentries in real-time. With customizable settings, this indicator is commonly used for studying range-based breakouts and reversals in any market.

How It Works

The indicator detects consolidation ranges by counting candles (default: minimum 3) within a user-defined lookback period (default: 20 bars) using TradingView’s ta.highest and ta.lowest functions—focusing on inside bars to capture true consolidation without noise. Dynamic boxes update in real-time to reflect the range’s high and low, colored based on the price’s position relative to the midline (bullish, bearish, or neutral). Verified ranges are locked in as boxes (up to 5 displayed), with colors illustrating breakout direction. Fakeouts are identified when price breaks out but reenters the range within a specified window (default: 3 bars), with arrow marks plotted when price verifies the fakeout direction. Hypothetical boxes illustrate ranges over a user-defined period (default: 10 bars) using real-time high/low updates.

Key Features
Range Detection: Identifies consolidation zones based on a minimum number of inside candles.
Fakeout Detection: Spots and verifies false breakouts within a user-defined window.
Hypothetical Range Boxes: Illustrates hypothetical high/low ranges with dynamic updates.
Color-Coded Visualization: Displays initial, bullish, bearish, and box markers with customizable colors.
Breakout/Fakeout Markers: Marks hypothetical breakouts and verified fakeouts with labeled arrows.
Customizable Settings: Adjust range length, minimum touches, fakeout window, and hypothetical period.

What It Displays

This indicator combines consolidation detection with real-time fakeout markers and hypothetical ranges, offering a unique approach to range trading. Its ability to identify and validate breakouts and reversals makes it a versatile tool for day trading, scalping, or swing trading in stocks, forex, futures, or crypto, enhancing trade precision.

Originality

This indicator is an original Pine v6 implementation using TradingView’s built-in ta.highest, ta.lowest, math.max, and math.min functions.

Common Ways People Use It

• Day traders reviewing range breakouts and fakeout reversals.
• Scalpers studying short-term consolidation zones.
• Technical analysts illustrating price ranges and market direction.

Configuration Notes

Configure the range detection length (default: 20 bars), minimum inside candles (default: 3), fakeout window (default: 3 bars), and hypothetical window (default: 10 bars). Customize box and arrow colors to suit your chart. Use verified boxes and breakout/fakeout arrows to identify commonly monitored trade setups.

Legal Disclaimer

These indicators are for informational and educational purposes only—not investment, financial, or trading advice. Past performance is not indicative of future results; trading involves high risk of loss. Provided "as is" with no warranties. Consult a qualified professional before decisions. By using, you assume all risk and agree to this disclaimer.

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.