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
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.