OPEN-SOURCE SCRIPT
Updated Essa - Market Structure Crystal Ball

Essa – Market Structure Crystal Ball
Overview
The Market Structure Crystal Ball is a next-generation market structure tool designed to predict the most probable next swing (HH, HL, LH, LL) using enriched data from historical patterns.
It goes beyond simple pivots, combining pattern recognition, velocity analysis, retracement behaviour, and structure breaks to forecast the next move with probabilities and confidence levels.
✨ Features
Automatic swing detection → Higher High (HH), Higher Low (HL), Lower High (LH), Lower Low (LL).
Rich structure metrics → Price change, velocity, bars elapsed, momentum, retracement %, structure break detection.
Pattern recognition engine → Analyses up to 500 past sequences to find similar market conditions.
Dynamic probability model → Calculates probabilities for the next structure type (HL, HH, LL, LH).
Market phase detection → Labels phases such as 🚀 Strong Uptrend, 💀 Strong Downtrend, ↔️ Consolidation, etc.
Prediction table → Displays probabilities, last structure trail, trend phase, confidence level, and velocity context.
Dynamic prediction zones → Projects likely price zones for the next HL/HH/LL/LH target with probability labels.
Instrument aware → Auto-adjusts for Forex (pips), Indices (points), Crypto, Metals, and more.
Diagnostic tools → Optional debug labels showing swing stats, retracements, and structural integrity checks.
📊 How To Use
Add the indicator to your chart.
Watch the table (top-right) for probabilities, confidence, and current phase.
Monitor the labels (HH/HL/LL/LH) for confirmed market structure.
Look for prediction zones when probabilities are high (>45%) for trade planning.
Use confidence + phase context to filter trades (e.g. strong uptrend with HH probability >60%).
⚠️ Notes
This is a probability-driven tool, not a guaranteed signal generator.
Works best on higher timeframes where structure is cleaner.
For best results, combine with your own strategy, risk management, and confirmation tools.
Overview
The Market Structure Crystal Ball is a next-generation market structure tool designed to predict the most probable next swing (HH, HL, LH, LL) using enriched data from historical patterns.
It goes beyond simple pivots, combining pattern recognition, velocity analysis, retracement behaviour, and structure breaks to forecast the next move with probabilities and confidence levels.
✨ Features
Automatic swing detection → Higher High (HH), Higher Low (HL), Lower High (LH), Lower Low (LL).
Rich structure metrics → Price change, velocity, bars elapsed, momentum, retracement %, structure break detection.
Pattern recognition engine → Analyses up to 500 past sequences to find similar market conditions.
Dynamic probability model → Calculates probabilities for the next structure type (HL, HH, LL, LH).
Market phase detection → Labels phases such as 🚀 Strong Uptrend, 💀 Strong Downtrend, ↔️ Consolidation, etc.
Prediction table → Displays probabilities, last structure trail, trend phase, confidence level, and velocity context.
Dynamic prediction zones → Projects likely price zones for the next HL/HH/LL/LH target with probability labels.
Instrument aware → Auto-adjusts for Forex (pips), Indices (points), Crypto, Metals, and more.
Diagnostic tools → Optional debug labels showing swing stats, retracements, and structural integrity checks.
📊 How To Use
Add the indicator to your chart.
Watch the table (top-right) for probabilities, confidence, and current phase.
Monitor the labels (HH/HL/LL/LH) for confirmed market structure.
Look for prediction zones when probabilities are high (>45%) for trade planning.
Use confidence + phase context to filter trades (e.g. strong uptrend with HH probability >60%).
⚠️ Notes
This is a probability-driven tool, not a guaranteed signal generator.
Works best on higher timeframes where structure is cleaner.
For best results, combine with your own strategy, risk management, and confirmation tools.
Release Notes
Bug FixesRelease Notes
LIve Bias UpdateOpen-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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.