OPEN-SOURCE SCRIPT
MSS + Multi FVG Tracker

MSS + Multi FVG Tracker
Description
An advanced institutional trading tool that combines Market Structure Shift (MSS) detection with multi-level Fair Value Gap (FVG) tracking. This indicator identifies breakouts of previous swing highs/lows on higher timeframes, then systematically tracks and validates multiple FVGs within each trend direction, generating precise entry signals when price respects the gap structure.
How It Works
Higher Timeframe Trend Detection
The indicator analyzes a higher timeframe (default 15-minute) to determine the overall bias, displaying background colors that show bullish or bearish directionality. This ensures you only trade with institutional trend direction.
Market Structure Shift (MSS/BOS)
When price closes above a previous swing high (in uptrends) or below a previous swing low (in downtrends), a BOS (Break of Structure) is marked with a line and label. This signals that the institutional structure has shifted and a new trend impulse is beginning.
Multi-Level FVG Tracking
Once an MSS occurs:
The indicator begins scanning for Fair Value Gaps (gaps between candles where no trading occurred)
Bullish FVGs: Gaps above the closing price of a bearish candle (low > high[2])
Bearish FVGs: Gaps below the closing price of a bullish candle (high < low[2])
Multiple FVGs are tracked simultaneously (up to 5 configurable) across the same impulse
Intelligent FVG Validation
Each FVG is continuously monitored:
Invalidated: If price closes through the gap (below a bullish FVG or above a bearish FVG), it's automatically deleted
Touched: If price enters the gap zone, it's marked as "touched"
Signal Generated: When a touched FVG shows strong directional confirmation (bullish candle closing above the FVG top, or bearish candle closing below the FVG bottom), a LONG or SHORT signal is triggered
Key Features
HTF Trend Confirmation: Only trades aligned with higher timeframe bias (eliminates counter-trend noise)
Multi-FVG Architecture: Tracks up to 5 gaps per trend impulse simultaneously
Automatic Gap Invalidation: Removes FVGs that break below/above, keeping only valid levels
Smart Signal Generation: Entry signals require both FVG respect + directional confirmation
Color-Coded Structure: Bullish signals in green, bearish in red with instant visual clarity
Background Trend Visualization: Subtle background shading shows HTF bias at all times
Customizable Parameters: Adjust swing period, HTF timeframe, and max FVGs to track
Ideal For
ICT Smart Money traders using FVG + MSS methodologies
Institutional order flow analysts trading market structure
Multi-timeframe traders looking for confluence-based entries
Scalpers to swing traders on 5-minute to 1-hour charts
Anyone seeking high-probability setups with clear invalidation rules
Trading Applications
Scalp FVG reversals: Enter when price respects a touched FVG with confirmation
Trade impulses with structure: Follow MSS with FVG confluence for institutional-grade entries
Identify pullback opportunities: Track multiple FVGs during retracements for re-entry zones
Confirm breakout validity: Only take breaks when aligned with HTF trend + FVG structure
Avoid false breakouts: Invalidated FVGs signal that the move is losing structure
How to Use
Wait for the MSS: Background color shift + BOS line confirms market structure break
Monitor FVG Creation: Boxes appear as gaps form within the new impulse
Watch for Invalidation: Red boxes disappear if price breaks the gap—signal invalid
Wait for Touch + Confirmation: FVG must be touched AND show strong directional candle
Take the Signal: Triangle entry markers appear with audio/visual alerts
Clear Risk Management: Use the invalidated FVG level as your stop loss
Signal Strength Indicators
Strongest Setup: Multiple FVGs created + one respects while others invalidate (shows structure)
Medium Setup: Single FVG touched and confirmed
Weaker Setup: Quick touch with weak confirmation candle (wait for better structure)
Customization Options
HTF Timeframe: Change from 15-min to 5, 30, 60 min or higher for different trading styles
Swing Period: Adjust from 10 bars for faster detection to 20+ for structural shifts
Max FVGs: Track 1-5 simultaneous gaps (lower = cleaner, higher = more opportunities)
Colors: Customize bullish/bearish colors to match your chart theme
Default Settings Optimized For
NASDAQ futures and liquid forex pairs
5-minute to 1-hour timeframe trading
Smart Money / ICT methodology
High-probability impulse + gap trading
Pro Tips
The cleaner your chart (fewer invalidated FVGs), the stronger the structural move
Multiple valid FVGs in one impulse suggest institutional accumulation/distribution
HTF background color changes are early warnings of trend structure shift
Best setups occur when 2-3 FVGs exist and one shows clear confirmation
Description
An advanced institutional trading tool that combines Market Structure Shift (MSS) detection with multi-level Fair Value Gap (FVG) tracking. This indicator identifies breakouts of previous swing highs/lows on higher timeframes, then systematically tracks and validates multiple FVGs within each trend direction, generating precise entry signals when price respects the gap structure.
How It Works
Higher Timeframe Trend Detection
The indicator analyzes a higher timeframe (default 15-minute) to determine the overall bias, displaying background colors that show bullish or bearish directionality. This ensures you only trade with institutional trend direction.
Market Structure Shift (MSS/BOS)
When price closes above a previous swing high (in uptrends) or below a previous swing low (in downtrends), a BOS (Break of Structure) is marked with a line and label. This signals that the institutional structure has shifted and a new trend impulse is beginning.
Multi-Level FVG Tracking
Once an MSS occurs:
The indicator begins scanning for Fair Value Gaps (gaps between candles where no trading occurred)
Bullish FVGs: Gaps above the closing price of a bearish candle (low > high[2])
Bearish FVGs: Gaps below the closing price of a bullish candle (high < low[2])
Multiple FVGs are tracked simultaneously (up to 5 configurable) across the same impulse
Intelligent FVG Validation
Each FVG is continuously monitored:
Invalidated: If price closes through the gap (below a bullish FVG or above a bearish FVG), it's automatically deleted
Touched: If price enters the gap zone, it's marked as "touched"
Signal Generated: When a touched FVG shows strong directional confirmation (bullish candle closing above the FVG top, or bearish candle closing below the FVG bottom), a LONG or SHORT signal is triggered
Key Features
HTF Trend Confirmation: Only trades aligned with higher timeframe bias (eliminates counter-trend noise)
Multi-FVG Architecture: Tracks up to 5 gaps per trend impulse simultaneously
Automatic Gap Invalidation: Removes FVGs that break below/above, keeping only valid levels
Smart Signal Generation: Entry signals require both FVG respect + directional confirmation
Color-Coded Structure: Bullish signals in green, bearish in red with instant visual clarity
Background Trend Visualization: Subtle background shading shows HTF bias at all times
Customizable Parameters: Adjust swing period, HTF timeframe, and max FVGs to track
Ideal For
ICT Smart Money traders using FVG + MSS methodologies
Institutional order flow analysts trading market structure
Multi-timeframe traders looking for confluence-based entries
Scalpers to swing traders on 5-minute to 1-hour charts
Anyone seeking high-probability setups with clear invalidation rules
Trading Applications
Scalp FVG reversals: Enter when price respects a touched FVG with confirmation
Trade impulses with structure: Follow MSS with FVG confluence for institutional-grade entries
Identify pullback opportunities: Track multiple FVGs during retracements for re-entry zones
Confirm breakout validity: Only take breaks when aligned with HTF trend + FVG structure
Avoid false breakouts: Invalidated FVGs signal that the move is losing structure
How to Use
Wait for the MSS: Background color shift + BOS line confirms market structure break
Monitor FVG Creation: Boxes appear as gaps form within the new impulse
Watch for Invalidation: Red boxes disappear if price breaks the gap—signal invalid
Wait for Touch + Confirmation: FVG must be touched AND show strong directional candle
Take the Signal: Triangle entry markers appear with audio/visual alerts
Clear Risk Management: Use the invalidated FVG level as your stop loss
Signal Strength Indicators
Strongest Setup: Multiple FVGs created + one respects while others invalidate (shows structure)
Medium Setup: Single FVG touched and confirmed
Weaker Setup: Quick touch with weak confirmation candle (wait for better structure)
Customization Options
HTF Timeframe: Change from 15-min to 5, 30, 60 min or higher for different trading styles
Swing Period: Adjust from 10 bars for faster detection to 20+ for structural shifts
Max FVGs: Track 1-5 simultaneous gaps (lower = cleaner, higher = more opportunities)
Colors: Customize bullish/bearish colors to match your chart theme
Default Settings Optimized For
NASDAQ futures and liquid forex pairs
5-minute to 1-hour timeframe trading
Smart Money / ICT methodology
High-probability impulse + gap trading
Pro Tips
The cleaner your chart (fewer invalidated FVGs), the stronger the structural move
Multiple valid FVGs in one impulse suggest institutional accumulation/distribution
HTF background color changes are early warnings of trend structure shift
Best setups occur when 2-3 FVGs exist and one shows clear confirmation
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.