Market Structure

Key Features:
- Non-repainting market structure detection using swing highs/lows
- Clear identification of internal and general market structure levels
- Breakout threshold system for structure adjustments
- Integrated multi-timeframe compatibility
- Rich selection of 30+ moving average types, from basic to advanced adaptive variants
What Makes It Different:
Unlike most market structure indicators that repaint or modify past signals, this implementation uses a fixed-length lookback period to identify genuine swing points.
This means once a structure level or pivot is identified, it stays permanent - providing reliable signals for analysis and trading decisions.
The indicator combines two layers of market structure:
1. Internal Structure (lighter lines) - More sensitive to local price action
2. General Structure (darker lines) - Shows broader market context
Technical Details:
- Uses advanced pivot detection algorithm with customizable swing size
- Implements consecutive break counting for structure adjustments
- Supports both close and high/low price levels for breakout detection
- Includes offset option for better visual alignment
- Each structure break is validated against multiple conditions to prevent false signals
Offset on:
Offset off:
Moving Averages Library:
Includes comprehensive selection of moving averages, from traditional to advanced adaptive types:
- Basic: SMA, EMA, WMA, VWMA
- Advanced: KAMA, ALMA, VIDYA, FRAMA
- Specialized: Hull MA, Ehlers Filter Series
- Adaptive: JMA, RPMA, and many more
Perfect for:
- Price action analysis
- Trend direction confirmation
- Support/resistance identification
- Market structure trading strategies
- Multiple timeframe analysis
This open-source tool is designed to help traders better understand market dynamics and make more informed trading decisions. Feel free to use, modify, and enhance it for your trading needs.
New Feature:
Added alerts for confirmed pivot highs and lows
Important Clarification about Non-Repainting:
The indicator's market structure detection is NOT repainting. Here's why:
The market structure lines (both internal and general) are permanent once drawn and never change their past positions. These lines are the core feature of the indicator.
What people might be confusing as "repainting" is the pivot confirmation arrows, which appear after swingSize bars. This is not a bug - it's by design and necessary for accuracy.
Here's why:
To confirm a true pivot high/low, we need to look both backwards AND forwards by swingSize bars
Example: With swingSize = 20, we need 20 bars after a potential pivot to confirm it was truly the highest/lowest point in that 41-bar range (20 bars before + pivot + 20 bars after)
This delayed confirmation is essential for accuracy - without it, we'd get many false pivots that would need to be erased (which would be actual repainting)
The arrows simply mark where these confirmed pivots occurred - they're just visual aids, not trading signals. The trading signals come from the structure lines and their interactions with price.
Think of it like this: You can't know you've reached the top of a mountain until you've walked down the other side a bit. That's not repainting - that's confirmation.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Per un accesso rapido a un grafico, aggiungi questo script ai tuoi preferiti: per saperne di più clicca qui.
Declinazione di responsabilità
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Per un accesso rapido a un grafico, aggiungi questo script ai tuoi preferiti: per saperne di più clicca qui.