OPEN-SOURCE SCRIPT
MNQ Fractal SFP & FVG Master

Overview:
This script is a Multi-Timeframe (MTF) execution assistant designed specifically for the Micro E-mini Nasdaq 100 (MNQ). It mechanically automates the visual detection of the "Fractal SFP Model"—a high-probability mean-reversion strategy that capitalizes on algorithmic stop-hunts and subsequent institutional displacement.
How It Works (The Logic):
The indicator runs natively on the 5-Minute (M5) chart while quietly pulling 15-Minute (M15) data in the background to calculate institutional rejection wicks without requiring you to switch timeframes.
Phase 1: The Trap (M15 SFP): The script scans the background M15 timeframe for a Swing Failure Pattern. It mathematically defines a valid "trap" as an M15 candle where the sweep wick is at least 1.5x larger than the physical body of the candle, proving violent institutional rejection of a price level.
Phase 2: The Displacement (M5 FVG): Once a trap is confirmed, the script actively scans the current M5 chart for a 3-candle Fair Value Gap (FVG) forming in the opposite direction. This proves that institutional order flow has stepped in and created a structural void.
Phase 3: The Confluence: If a valid M5 FVG prints within a customizable lookback window (default 3 bars) of an M15 trap, the system locks in the setup and fires a trigger.
Visual Guide:
Green/Red Shaded Boxes: Highlights valid 5-Minute Fair Value Gaps natively on the chart. The boxes extend to the right until mitigated.
Green Triangle (Up): Prints below the candlestick when a Bullish M15 Sweep perfectly aligns with a new Bullish M5 FVG.
Red Triangle (Down): Prints above the candlestick when a Bearish M15 Sweep perfectly aligns with a new Bearish M5 FVG.
Execution Protocol & Rules of Engagement:
This is an alert-driven alert system, not a blind autotrader. It includes native TradingView alert conditions (🚨 BULLISH FRACTAL SFP and 🚨 BEARISH FRACTAL SFP).
The Human Filter: When an alert fires and a triangle prints, the trader must manually verify that the M15 trap wick actively pierced a mapped 1-Hour (H1) structural liquidity pool (e.g., London High/Low, Previous Session High/Low).
The Kill Switch: If the trigger prints in the middle of a choppy range, it is algorithmic noise. The setup is ignored.
The Green Light: If the trigger prints exactly at a predefined H1 structural line, the trader calculates risk and places a limit order at the nearest boundary of the highlighted FVG.
This script is a Multi-Timeframe (MTF) execution assistant designed specifically for the Micro E-mini Nasdaq 100 (MNQ). It mechanically automates the visual detection of the "Fractal SFP Model"—a high-probability mean-reversion strategy that capitalizes on algorithmic stop-hunts and subsequent institutional displacement.
How It Works (The Logic):
The indicator runs natively on the 5-Minute (M5) chart while quietly pulling 15-Minute (M15) data in the background to calculate institutional rejection wicks without requiring you to switch timeframes.
Phase 1: The Trap (M15 SFP): The script scans the background M15 timeframe for a Swing Failure Pattern. It mathematically defines a valid "trap" as an M15 candle where the sweep wick is at least 1.5x larger than the physical body of the candle, proving violent institutional rejection of a price level.
Phase 2: The Displacement (M5 FVG): Once a trap is confirmed, the script actively scans the current M5 chart for a 3-candle Fair Value Gap (FVG) forming in the opposite direction. This proves that institutional order flow has stepped in and created a structural void.
Phase 3: The Confluence: If a valid M5 FVG prints within a customizable lookback window (default 3 bars) of an M15 trap, the system locks in the setup and fires a trigger.
Visual Guide:
Green/Red Shaded Boxes: Highlights valid 5-Minute Fair Value Gaps natively on the chart. The boxes extend to the right until mitigated.
Green Triangle (Up): Prints below the candlestick when a Bullish M15 Sweep perfectly aligns with a new Bullish M5 FVG.
Red Triangle (Down): Prints above the candlestick when a Bearish M15 Sweep perfectly aligns with a new Bearish M5 FVG.
Execution Protocol & Rules of Engagement:
This is an alert-driven alert system, not a blind autotrader. It includes native TradingView alert conditions (🚨 BULLISH FRACTAL SFP and 🚨 BEARISH FRACTAL SFP).
The Human Filter: When an alert fires and a triangle prints, the trader must manually verify that the M15 trap wick actively pierced a mapped 1-Hour (H1) structural liquidity pool (e.g., London High/Low, Previous Session High/Low).
The Kill Switch: If the trigger prints in the middle of a choppy range, it is algorithmic noise. The setup is ignored.
The Green Light: If the trigger prints exactly at a predefined H1 structural line, the trader calculates risk and places a limit order at the nearest boundary of the highlighted FVG.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.