OPEN-SOURCE SCRIPT
Two-Bar Fib Retrace Strategy [Futures]

Overview
The Two-Bar Fib Retrace Strategy is a momentum-based price action system designed for futures trading on intraday timeframes (5m recommended). It identifies two-bar impulse moves with rising volume, then waits for a precise 50–61.8% fibonacci retracement into the second bar's range before triggering an entry. The strategy is trend-filtered using VWAP — longs only above, shorts only below — and layered with a full suite of ICT institutional levels to provide confluence and context on every trade.
How It Works
Step 1 — Impulse Detection
The indicator looks back at the previous two closed bars and checks for a valid impulse:
Both bars must have a body that is at least 50% of their total range (full-body filter)
Bar 2 must have higher volume than Bar 1 (rising volume confirmation)
Two impulse types are supported:
Matched — both bars are the same color (both bullish or both bearish)
Mixed — opposite-colored bars where Bar 2 closes beyond Bar 1's high (bull) or low (bear), showing momentum continuation despite the color change
Step 2 — Retrace Zone
Once a valid impulse is detected on Bar 2's close, the indicator immediately draws a shaded retrace zone on the chart representing the 50% to 61.8% fibonacci retracement of Bar 2's range. For a bull impulse this zone sits in the lower half of Bar 2. For a bear impulse it sits in the upper half.
Step 3 — Entry Trigger
The entry fires in real time when the current bar's wick touches inside the retrace zone — no waiting for the bar to close. This allows you to enter on the retrace as it happens rather than one bar late.
Step 4 — Stop Loss
Stop loss is placed 1 point beyond Bar 2's wick — below Bar 2's low for longs, above Bar 2's high for shorts. Clean, mechanical, and tight.
VWAP Trend Filter
All signals are filtered by VWAP direction:
Long signals only fire when price is above VWAP
Short signals only fire when price is below VWAP
This keeps the strategy aligned with intraday institutional order flow and prevents counter-trend entries. The VWAP filter can be toggled off in settings if you prefer unfiltered signals.
ICT Institutional Levels
The strategy includes a full ICT-style level system with automatic tracking and smart label combining:
Previous Day High / Low (PDH / PDL) — resets and plots daily
Previous Week High / Low (PWH / PWL) — resets weekly on Monday
True Day Open — plots the 6 PM ET open as a dotted line
Session Highs / Lows — tracks and marks the high and low of each session as it closes: Asia (8pm–12am ET), London (2am–5am ET), NY AM (8:30am–11:30am ET), NY Lunch (12pm–1pm ET), NY PM (1:30pm–6pm ET)
Lookback control — limit visible levels to 1 Day, 1 Week, 1 Month, or Max
Mitigated levels — optionally keep levels visible after price trades through them
Combined overlapping labels — when multiple levels sit at the same price, labels are merged into a single clean label rather than stacking
All ICT levels are drawn in black with black text for a clean, uncluttered chart.
Dashboard
A live dashboard in the top right corner shows:
Current killzone session
VWAP direction
Volume ratio vs MA
Bar 2 volume confirmation status
Bar 1 and Bar 2 body percentage
Current impulse type
Proximity to nearest ICT level
Last signal direction
Settings
SettingDefaultDescriptionMin Body % of Range0.5Both impulse bars must meet this thresholdSL Offset1.0 ptPoints beyond Bar 2 wick for stop placementVWAP FilterOnLongs above / shorts below VWAPVolume MA Length20Baseline for volume ratio calculationShow Retrace ZoneOnDraws 50–61.8% fib box on impulse detectionLookback Period1 WeekControls how far back ICT levels are drawnTimeframe Limit30mICT levels hidden on timeframes above this
Recommended Usage
Timeframe: 5 minute (works on all intraday timeframes)
Markets: Futures (ES, NQ, CL, GC) — commission and slippage modeled at $2.50/contract
Best sessions: New York Open (8am–11am ET) and London Open (2am–5am ET) for highest quality impulses
Confluence tip: Signals that form near PDH, PDL, PWH, PWL, or session highs/lows carry significantly more weight — the dashboard flags proximity automatically
Alerts
Six pre-built alert conditions are included:
LONG Signal
SHORT Signal
LONG in NY Killzone
SHORT in NY Killzone
LONG in London Killzone
SHORT in London Killzone
Any Signal
Disclaimer
This script is for educational and informational purposes only. Past performance is not indicative of future results. Always use proper risk management. This is not financial advice.
The Two-Bar Fib Retrace Strategy is a momentum-based price action system designed for futures trading on intraday timeframes (5m recommended). It identifies two-bar impulse moves with rising volume, then waits for a precise 50–61.8% fibonacci retracement into the second bar's range before triggering an entry. The strategy is trend-filtered using VWAP — longs only above, shorts only below — and layered with a full suite of ICT institutional levels to provide confluence and context on every trade.
How It Works
Step 1 — Impulse Detection
The indicator looks back at the previous two closed bars and checks for a valid impulse:
Both bars must have a body that is at least 50% of their total range (full-body filter)
Bar 2 must have higher volume than Bar 1 (rising volume confirmation)
Two impulse types are supported:
Matched — both bars are the same color (both bullish or both bearish)
Mixed — opposite-colored bars where Bar 2 closes beyond Bar 1's high (bull) or low (bear), showing momentum continuation despite the color change
Step 2 — Retrace Zone
Once a valid impulse is detected on Bar 2's close, the indicator immediately draws a shaded retrace zone on the chart representing the 50% to 61.8% fibonacci retracement of Bar 2's range. For a bull impulse this zone sits in the lower half of Bar 2. For a bear impulse it sits in the upper half.
Step 3 — Entry Trigger
The entry fires in real time when the current bar's wick touches inside the retrace zone — no waiting for the bar to close. This allows you to enter on the retrace as it happens rather than one bar late.
Step 4 — Stop Loss
Stop loss is placed 1 point beyond Bar 2's wick — below Bar 2's low for longs, above Bar 2's high for shorts. Clean, mechanical, and tight.
VWAP Trend Filter
All signals are filtered by VWAP direction:
Long signals only fire when price is above VWAP
Short signals only fire when price is below VWAP
This keeps the strategy aligned with intraday institutional order flow and prevents counter-trend entries. The VWAP filter can be toggled off in settings if you prefer unfiltered signals.
ICT Institutional Levels
The strategy includes a full ICT-style level system with automatic tracking and smart label combining:
Previous Day High / Low (PDH / PDL) — resets and plots daily
Previous Week High / Low (PWH / PWL) — resets weekly on Monday
True Day Open — plots the 6 PM ET open as a dotted line
Session Highs / Lows — tracks and marks the high and low of each session as it closes: Asia (8pm–12am ET), London (2am–5am ET), NY AM (8:30am–11:30am ET), NY Lunch (12pm–1pm ET), NY PM (1:30pm–6pm ET)
Lookback control — limit visible levels to 1 Day, 1 Week, 1 Month, or Max
Mitigated levels — optionally keep levels visible after price trades through them
Combined overlapping labels — when multiple levels sit at the same price, labels are merged into a single clean label rather than stacking
All ICT levels are drawn in black with black text for a clean, uncluttered chart.
Dashboard
A live dashboard in the top right corner shows:
Current killzone session
VWAP direction
Volume ratio vs MA
Bar 2 volume confirmation status
Bar 1 and Bar 2 body percentage
Current impulse type
Proximity to nearest ICT level
Last signal direction
Settings
SettingDefaultDescriptionMin Body % of Range0.5Both impulse bars must meet this thresholdSL Offset1.0 ptPoints beyond Bar 2 wick for stop placementVWAP FilterOnLongs above / shorts below VWAPVolume MA Length20Baseline for volume ratio calculationShow Retrace ZoneOnDraws 50–61.8% fib box on impulse detectionLookback Period1 WeekControls how far back ICT levels are drawnTimeframe Limit30mICT levels hidden on timeframes above this
Recommended Usage
Timeframe: 5 minute (works on all intraday timeframes)
Markets: Futures (ES, NQ, CL, GC) — commission and slippage modeled at $2.50/contract
Best sessions: New York Open (8am–11am ET) and London Open (2am–5am ET) for highest quality impulses
Confluence tip: Signals that form near PDH, PDL, PWH, PWL, or session highs/lows carry significantly more weight — the dashboard flags proximity automatically
Alerts
Six pre-built alert conditions are included:
LONG Signal
SHORT Signal
LONG in NY Killzone
SHORT in NY Killzone
LONG in London Killzone
SHORT in London Killzone
Any Signal
Disclaimer
This script is for educational and informational purposes only. Past performance is not indicative of future results. Always use proper risk management. This is not financial advice.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.