Market Structure- ZigZag, Break of Structure & Order Blocks

This script is an all-in-one market structure tool designed for traders who follow price action, Smart Money Concepts (SMC), or institutional order flow. It combines Order Block detection, Break of Structure (BOS), Internal Structure Shifts (CHoCH), and a ZigZag swing framework to provide a clear and actionable view of market behavior.
Key Features:
Order Blocks (OB):
-Detects Bullish (Green) and Bearish (Red) order blocks upon valid market structure shifts.
-Optional deletion of mitigated (touched) blocks to keep charts clean.
-Customizable block duration, fill color, and border color.
Break of Structure (BOS):
-Marks BOS with horizontal dotted lines when price breaks previous swing highs/lows.
-Confirms new trends and structural shifts.
Internal Structure Shifts (CHoCH-like):
-Detects early internal changes in direction before BOS.
-User-selectable logic: based on candle Open or High/Low.
-Plotted as small black triangle markers.
ZigZag Swings:
-Connects confirmed internal shifts with black zigzag lines.
-Visually simplifies trend structure and major swing points.
-Tracks last swing highs/lows for BOS validation.
Alerts:
-Bullish/Bearish Engulfments (OB signals)
-Internal Structure Shifts
-Bullish/Bearish Break of Structure
-OB Mitigation Events
Inputs & Settings:
-Show/Hide Bullish or Bearish Order Blocks
-Calculate internal shifts by: Open or High/Low
-Set order block fill and border colors
-Enable or disable automatic deletion of mitigated blocks
-Set duration for order block display
This tool is designed to support price action trading by visually mapping key structural changes and zones of interest directly on your chart. It is not intended to function as a standalone trading strategy, but rather as a supplementary tool to inform your own analysis and discretion.
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.