PROTECTED SOURCE SCRIPT
Aggiornato Gap Legout after Good Legin & Boring

// ============================================================================
// Script: Gap Legout after Good Legin & Boring (Supply/Demand Zone Highlighter)
// Version: Pine Script v6
// ---------------------------------------------------------------------------
// This indicator highlights high-quality demand and supply zone "legout" candles
// that follow a classic supply/demand sequence:
// 1. Good Legin → 2. Boring → 3. Gap Legout
//
// A candle is highlighted if ALL these rules are satisfied:
// 1. Two bars back: "Good Legin" candle
// - TR > ATR (shows strong expansion).
// - Size ≥ 1.9× previous boring candle, OR TR ≥ 1.9× boring candle's TR.
// - Body ≥ 70% of its range (body-dominant).
// - Wick on the close side (price rejection).
// - No significant gap between legin close and boring open (adaptive threshold).
//
// 2. Previous bar: "Boring" candle
// - ATR > TR (low volatility/consolidation).
//
// 3. Current bar: "Gap Legout" candle
// - TR > ATR (shows expansion/volatility).
// - Body ≥ 70% of its range (body-dominant).
// - Size ≥ 4× the boring candle.
// - If bullish (demand): body must gap up—fully above boring candle’s body, no touch.
// - If bearish (supply): body must gap down—fully below boring candle’s body, no touch.
//
// Highlight colors:
// - **Yellow** for demand (bullish gap-up legout).
// - **Fuchsia** for supply (bearish gap-down legout).
//
// Purpose:
// - For supply/demand zone and price action traders, this script helps spot
// only the highest-probability legout bars after proper structure and
// consolidation, reducing false signals and improving zone accuracy.
//
// Add this to any chart to visually scan for these A+ demand and supply zone formations.
//
// ============================================================================
// Script: Gap Legout after Good Legin & Boring (Supply/Demand Zone Highlighter)
// Version: Pine Script v6
// ---------------------------------------------------------------------------
// This indicator highlights high-quality demand and supply zone "legout" candles
// that follow a classic supply/demand sequence:
// 1. Good Legin → 2. Boring → 3. Gap Legout
//
// A candle is highlighted if ALL these rules are satisfied:
// 1. Two bars back: "Good Legin" candle
// - TR > ATR (shows strong expansion).
// - Size ≥ 1.9× previous boring candle, OR TR ≥ 1.9× boring candle's TR.
// - Body ≥ 70% of its range (body-dominant).
// - Wick on the close side (price rejection).
// - No significant gap between legin close and boring open (adaptive threshold).
//
// 2. Previous bar: "Boring" candle
// - ATR > TR (low volatility/consolidation).
//
// 3. Current bar: "Gap Legout" candle
// - TR > ATR (shows expansion/volatility).
// - Body ≥ 70% of its range (body-dominant).
// - Size ≥ 4× the boring candle.
// - If bullish (demand): body must gap up—fully above boring candle’s body, no touch.
// - If bearish (supply): body must gap down—fully below boring candle’s body, no touch.
//
// Highlight colors:
// - **Yellow** for demand (bullish gap-up legout).
// - **Fuchsia** for supply (bearish gap-down legout).
//
// Purpose:
// - For supply/demand zone and price action traders, this script helps spot
// only the highest-probability legout bars after proper structure and
// consolidation, reducing false signals and improving zone accuracy.
//
// Add this to any chart to visually scan for these A+ demand and supply zone formations.
//
// ============================================================================
Note di rilascio
// ============================================================================// Indicator: Gap Legout after Good Legin & Boring (Supply/Demand Zone Highlighter)
// Version: Pine Script v6
// ---------------------------------------------------------------------------
// Highlights strong demand and supply "legout" candles that follow a classic
// three-bar supply/demand setup:
// 1. Good Legin (expansion, strong candle, wick at close, no big gap)
// 2. Boring (consolidation, ATR > TR)
// 3. Gap Legout (expansion, TR > ATR, body-dominant, at least 4x boring,
// and gapped away from boring body)
//
// Criteria:
// - Two bars ago: "Good Legin" (body ≥ 70% of range, wick at close, size/TR ≥ 1.9x boring, no big gap)
// - One bar ago: "Boring" (ATR > TR)
// - Current bar:
// • "Gap Legout" (body ≥ 50% of range, size ≥ 4x boring, TR > ATR)
// • For demand: bullish candle with body fully above boring candle body (gap up)
// • For supply: bearish candle with body fully below boring candle body (gap down)
//
// Highlights:
// - Yellow for demand (bullish gap-up legout)
// - Fuchsia for supply (bearish gap-down legout)
//
// Use: Visually identify strong, textbook legout bars for supply/demand trading setups.
// ============================================================================
Note di rilascio
This script highlights the highest-quality demand and supply "legout" candles using a three-candle setup:- Good Legin (expansion, body ≥ 70%, wick at close, strong size/TR, no big gap)
- Boring (contraction, ATR > TR)
- Legout (body ≥ 50%, TR > ATR, size ≥ 4x boring, size ≥ 1.5x legin, gap up/down)
Highlight criteria:
Two bars back: "Good Legin"
• TR > ATR (expansion), body ≥ 70% of size, wick at close,
• Size or TR ≥ 1.9x boring
• No large gap between legin close and boring open (adaptive, size/ATR-based)
One bar back: "Boring" (ATR > TR)
Current bar: "Legout"
• TR > ATR (expansion), body ≥ 50% of size,
• Size ≥ 4x boring size AND size ≥ 1.5x legin size,
• For demand: bullish and body gapped above boring body (no touch)
• For supply: bearish and body gapped below boring body (no touch)
Highlights:
- Yellow for demand zones (bullish gap-up legout)
- Fuchsia for supply zones (bearish gap-down legout)
Use: For supply/demand zone and price action traders seeking only the strongest, cleanest breakout legouts after proper contraction and structured buildup.
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.