PROTECTED SOURCE SCRIPT
Updated

Market Structure High/Low [MaB]

75
๐Ÿ“Š Market Structure High/Low [MaB]

A precision indicator for identifying and tracking market structure through validated swing highs and lows.

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

๐ŸŽฏ KEY FEATURES

โ€ข Automatic Swing Detection
Identifies structural High/Low points using a dual-confirmation system (minimum candles + pullback percentage)

โ€ข Smart Trend Tracking
Automatically switches between Uptrend (Higher Highs & Higher Lows) and Downtrend (Lower Highs & Lower Lows)

โ€ข Breakout Alerts
Visual markers for confirmed breakouts (Brโ†‘ / Brโ†“) with configurable threshold

โ€ข Sequential Labeling
Clear numbered labels (L1, H2, L3, H4...) showing the exact market structure progression

โ€ข Color-Coded Structure Lines
- Green: Uptrend continuation legs
- Red: Downtrend continuation legs
- Gray: Trend inversion points

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

โš™๏ธ CONFIGURABLE PARAMETERS

โ€ข Analysis Start Date: Define when to begin structure analysis
โ€ข Min Confirmation Candles: Required candles for validation (default: 3)
โ€ข Pullback Percentage: Minimum retracement for confirmation (default: 10%)
โ€ข Breakout Threshold: Percentage beyond structure for breakout (default: 1%)
โ€ข Table Display: Toggle Market Structure

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

๐Ÿ’ก HOW IT WORKS

1. Finds initial swing low using lookback period
2. Tracks price movement for potential High candidates
3. Validates candidates with dual criteria (candles + pullback)
4. Monitors for breakout above High (continuation) or below Low (inversion)
5. Repeats the cycle, building complete market structure

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

๐Ÿ”ง BEST USED FOR

โ€ข Identifying key support/resistance levels
โ€ข Trend direction confirmation
โ€ข Breakout trading setups
โ€ข Multi-timeframe structure analysis
โ€ข Understanding market rhythm and flow

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

โš ๏ธ NOTES

- Works best on higher timeframes (1H+) for cleaner structure
- Statistics become more reliable with larger sample sizes
- Extension ratios use ฯƒ-filtered averages to exclude outliers
- Pullback filter automatically bypasses during extended impulsive moves




โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
Release Notes
๐Ÿ“Š Market Structure High/Low [MaB]

A precision indicator for identifying and tracking market structure through validated swing highs and lows.

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

๐ŸŽฏ KEY FEATURES

โ€ข Automatic Swing Detection
Identifies structural High/Low points using a dual-confirmation system (minimum candles + pullback percentage)

โ€ข Smart Trend Tracking
Automatically switches between Uptrend (Higher Highs & Higher Lows) and Downtrend (Lower Highs & Lower Lows)

โ€ข Breakout Alerts
Visual markers for confirmed breakouts (Brโ†‘ / Brโ†“) with configurable threshold

โ€ข Sequential Labeling
Clear numbered labels (L1, H2, L3, H4...) showing the exact market structure progression

โ€ข Color-Coded Structure Lines
- Green: Uptrend continuation legs
- Red: Downtrend continuation legs
- Gray: Trend inversion points

โ€ข Replay Mode Compatible
Full support for TradingView's Replay feature - analyze historical price action step by step

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

โš™๏ธ CONFIGURABLE PARAMETERS

โ€ข Analysis Start Date: Define when to begin structure analysis
โ€ข Min Confirmation Candles: Required candles for validation (default: 3)
โ€ข Pullback Percentage: Minimum retracement for confirmation (default: 10%)
โ€ข Breakout Threshold: Percentage beyond structure for breakout (default: 1%)
โ€ข Table Display: Toggle Market Structure
โ€ข Replay Mode: Enable when using TradingView Replay to prevent buffer errors

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

๐Ÿ’ก HOW IT WORKS

1. Finds initial swing low using lookback period
2. Tracks price movement for potential High candidates
3. Validates candidates with dual criteria (candles + pullback)
4. Monitors for breakout above High (continuation) or below Low (inversion)
5. Repeats the cycle, building complete market structure

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

๐Ÿ”ง BEST USED FOR

โ€ข Identifying key support/resistance levels
โ€ข Trend direction confirmation
โ€ข Breakout trading setups
โ€ข Multi-timeframe structure analysis
โ€ข Understanding market rhythm and flow
โ€ข Backtesting with Replay mode

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

โš ๏ธ NOTES

- Works best on higher timeframes (1H+) for cleaner structure
- Extension ratios use ฯƒ-filtered averages to exclude outliers
- Pullback filter automatically bypasses during extended impulsive moves
- Enable "Replay Mode" when using TradingView Replay feature; disable it for full historical view

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.