OPEN-SOURCE SCRIPT
FVG & Order Block - Market Structure

Overview
A comprehensive Smart Money Concepts (SMC) indicator that combines Fair Value Gaps, Order Blocks, Market Structure analysis, and Key Levels into one powerful tool. Designed for traders who follow ICT (Inner Circle Trader) methodology and institutional trading concepts.
🔹 Features
Fair Value Gaps (FVG)
Automatically detects bullish and bearish imbalances in price
Customizable mitigation logic: choose between "Close" (candle must close through the gap) or "Touch" (wick into the gap)
FVGs extend forward and auto-remove when mitigated
Separate colors for bullish (demand) and bearish (supply) gaps
Order Blocks (OB)
Identifies institutional order blocks based on significant price moves
Detects the last opposing candle before a breakout move
Customizable mitigation type (Close vs Touch)
Adjustable lookback period for sensitivity control
Market Structure (CHoCH & BOS)
CHoCH (Change of Character): Detects trend reversals when price breaks structure against the current trend
BOS (Break of Structure): Confirms trend continuation when price breaks structure in the direction of the trend
Visual labels and dashed lines mark each structural break
Adjustable swing length for different trading styles
Key Levels
PDH/PDL: Previous Day High/Low
PWH/PWL: Previous Week High/Low
PMH/PML: Previous Month High/Low
Clean horizontal lines with labels that auto-update
Liquidity Levels
Identifies clusters of equal lows where stop losses likely accumulate
Shows percentage distance from current price
Helps anticipate liquidity grabs and stop hunts
Info Dashboard
Real-time display of current market structure (Bullish/Bearish/Neutral)
Count of active FVGs and Order Blocks
⚙️ Customization
Toggle each feature on/off independently
Fully customizable colors for all elements
Adjustable zone extension periods
Choose mitigation type per zone (Close vs Touch)
Swing length adjustment for market structure sensitivity
📈 How to Use
Identify Trend: Check the dashboard for current market structure
Find Entry Zones: Look for unfilled FVGs and untested Order Blocks in the direction of the trend
Confirm with Structure: Wait for BOS to confirm trend continuation or CHoCH for reversals
Use Key Levels: PDH/PDL/PWH/PWL act as support/resistance and liquidity targets
Watch Liquidity: Equal lows often get swept before reversals
🎯 Best Used On
Indices (NiftyFifty, BankNifty, S&P 500, Nasdaq)
Forex pairs
Crypto (BTC, ETH)
Works on all timeframes (15m, 1H, 4H, Daily recommended)
⚠️ Disclaimer
This indicator is a technical analysis tool and should not be considered financial advice. Always use proper risk management and combine with your own analysis. Past performance does not guarantee future results.
📝 Release Notes
v1.0
Initial release
FVG detection with customizable mitigation
Order Block detection
CHoCH & BOS market structure
PDH/PDL, PWH/PWL, PMH/PML levels
Liquidity level detection
Info dashboard
Tags: smartmoney smc ict fairvaluegap fvg orderblock marketstructure choch bos liquidity supplydemand priceaction
A comprehensive Smart Money Concepts (SMC) indicator that combines Fair Value Gaps, Order Blocks, Market Structure analysis, and Key Levels into one powerful tool. Designed for traders who follow ICT (Inner Circle Trader) methodology and institutional trading concepts.
🔹 Features
Fair Value Gaps (FVG)
Automatically detects bullish and bearish imbalances in price
Customizable mitigation logic: choose between "Close" (candle must close through the gap) or "Touch" (wick into the gap)
FVGs extend forward and auto-remove when mitigated
Separate colors for bullish (demand) and bearish (supply) gaps
Order Blocks (OB)
Identifies institutional order blocks based on significant price moves
Detects the last opposing candle before a breakout move
Customizable mitigation type (Close vs Touch)
Adjustable lookback period for sensitivity control
Market Structure (CHoCH & BOS)
CHoCH (Change of Character): Detects trend reversals when price breaks structure against the current trend
BOS (Break of Structure): Confirms trend continuation when price breaks structure in the direction of the trend
Visual labels and dashed lines mark each structural break
Adjustable swing length for different trading styles
Key Levels
PDH/PDL: Previous Day High/Low
PWH/PWL: Previous Week High/Low
PMH/PML: Previous Month High/Low
Clean horizontal lines with labels that auto-update
Liquidity Levels
Identifies clusters of equal lows where stop losses likely accumulate
Shows percentage distance from current price
Helps anticipate liquidity grabs and stop hunts
Info Dashboard
Real-time display of current market structure (Bullish/Bearish/Neutral)
Count of active FVGs and Order Blocks
⚙️ Customization
Toggle each feature on/off independently
Fully customizable colors for all elements
Adjustable zone extension periods
Choose mitigation type per zone (Close vs Touch)
Swing length adjustment for market structure sensitivity
📈 How to Use
Identify Trend: Check the dashboard for current market structure
Find Entry Zones: Look for unfilled FVGs and untested Order Blocks in the direction of the trend
Confirm with Structure: Wait for BOS to confirm trend continuation or CHoCH for reversals
Use Key Levels: PDH/PDL/PWH/PWL act as support/resistance and liquidity targets
Watch Liquidity: Equal lows often get swept before reversals
🎯 Best Used On
Indices (NiftyFifty, BankNifty, S&P 500, Nasdaq)
Forex pairs
Crypto (BTC, ETH)
Works on all timeframes (15m, 1H, 4H, Daily recommended)
⚠️ Disclaimer
This indicator is a technical analysis tool and should not be considered financial advice. Always use proper risk management and combine with your own analysis. Past performance does not guarantee future results.
📝 Release Notes
v1.0
Initial release
FVG detection with customizable mitigation
Order Block detection
CHoCH & BOS market structure
PDH/PDL, PWH/PWL, PMH/PML levels
Liquidity level detection
Info dashboard
Tags: smartmoney smc ict fairvaluegap fvg orderblock marketstructure choch bos liquidity supplydemand priceaction
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.