OPEN-SOURCE SCRIPT

Esco Theory v4

1 397
Esco Theory maps the hidden geometry of price action. It identifies swing structure, plots geometric rails between pivots, detects supply and demand zones, fair value gaps, liquidity pools, compression patterns, and confluence clusters.

All signals are synthesized into a real-time dashboard so traders can read market structure and volatility conditions at a glance.

Built for traders who study displacement, structure shifts, and the expansion–compression cycles that drive price.

Features
Market Structure (BOS / MSS)

Automatically detects Break of Structure (BOS) and Market Structure Shifts (MSS) using configurable swing lookback. Bullish and bearish shifts are labeled directly on the chart with color-coded markers.

Displacement candles (body greater than 1.5× ATR) are highlighted to confirm impulsive moves.

Geometric Rails

Trendlines (“rails”) are drawn between consecutive swing highs and swing lows and extended forward.

Two tiers are available:

Minor Rails
Short-term pivots for intraday and swing geometry.

Major Cycle Rails
Higher-timeframe pivots that reveal broader structural channels.

Cross-rails connect swing highs to swing lows using dotted diagonals, revealing convergence and divergence patterns.

Cycle Fan

A fan of rays projects from the deepest major swing low through each major swing high (and vice versa), mapping the angular geometry of the current market cycle.

These angles often highlight reaction zones where time and price intersect.

Supply & Demand Zones

Zones are created at pivot candles confirmed by displacement on the following bar.

Each zone tracks retests and gradually fades in transparency as it is touched.
Mitigated zones are automatically removed to keep charts clean.

Fair Value Gaps (FVG) & Inverted FVGs

Three-candle imbalance gaps are detected and drawn as shaded boxes.

When a gap fills to its midpoint it converts into an inverted FVG, which can act as a continuation or re-entry zone.

Both gap types have independent color settings and optional auto-expiration.

Premium / Discount Zones

Using the most recent major swing high and low, price is divided into:

Premium (upper 25%)
Discount (lower 25%)
Equilibrium (midpoint)

A dotted equilibrium line marks fair value and helps filter entries.

Support & Resistance Clustering

All pivot prices are grouped by proximity.

Levels with multiple touches are drawn as dashed horizontal lines labeled with touch count:

S (3)
R (4)

Stronger clusters appear as thicker lines.

Confluence Zones

When three or more levels from different sources cluster together (pivots, S/R levels, supply and demand), a shaded confluence zone is drawn.

These areas often produce the strongest market reactions.

Liquidity — Equal Highs / Equal Lows

Swing highs and lows within a defined tolerance are identified as EQH and EQL liquidity pools.

These levels extend forward and often attract price before reversals or breakouts.

Liquidity Sweeps

When price wicks through an equal high or low and closes back inside the level, a sweep marker (✕) appears.

Sweeps often signal liquidity grabs before reversals.

Compression & Squeeze Detection

Two compression signals identify volatility contraction.

ATR Compression
Occurs when fast ATR drops below 60% of slow ATR.

Bollinger / Keltner Squeeze
When Bollinger Bands contract inside Keltner Channels.

When the squeeze releases, a triangle marker signals expansion.

A wedge overlay connects compression pivots to visualize tightening ranges.

Real-Time Dashboard

A compact panel displays current market conditions.

Bias
Current structure trend (Bullish / Bearish / Neutral)

Zone
Premium, Discount, or Equilibrium

Volatility
Squeeze, Compression, or Expansion

ATR Ratio
Fast ATR vs Slow ATR

BBW
Bollinger Band Width percentage

Wedge
Active compression wedge detection

FVG
Active gap count

Sweeps
Recent liquidity sweep count

Inputs & Customization

Every module can be toggled independently.

Key settings include:

Swing Lookback (minor and major)
Rail Extension length
Max Cross-Rails
Supply / Demand Pivot Length
FVG Minimum Size and Max Age
Support / Resistance Tolerance and Minimum Touches
Confluence Width and Minimum Levels
Equal High / Low Tolerance

All colors are fully customizable.

How to Use

Identify bias
Check the dashboard for current structure direction and premium/discount location.

Find confluence
Look for areas where rails, zones, gaps, and support/resistance overlap.

Watch compression
Squeeze diamonds and wedges signal volatility building.

Trade displacement
Highlighted candles confirm impulsive moves through key levels.

Monitor liquidity sweeps
EQH/EQL sweeps often precede reversals or expansions.

Notes

Overlay indicator designed for use directly on price charts.
Compatible with all markets and timeframes.

Lower timeframes with large bar counts may increase drawing load. Adjust lookback settings if needed.

Best used alongside discretionary price action and market context.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน