OPEN-SOURCE SCRIPT
FVG + EMA 9/21 + VWAP Scored Signals

Combined FVG, EMA 9/21 & VWAP Scored Signals
A confluence-scored signal engine that combines Fair Value Gap (FVG) imbalance zones, EMA 9/21/50 trend structure, anchored VWAP, and candle quality into a single 0–100 directional score. One BUY or SELL per direction until the opposite side fires.
What it does
Most pullback and FVG indicators print signals on every touch, every cross, every fresh gap — and the noise drowns out the edge. This indicator scores every bar against a weighted, four-factor confluence model and only prints a signal when the directional score clears a per-symbol threshold during regular trading hours. A built-in state machine guarantees one BUY (or SELL) per leg until the opposite side triggers, so the chart stays clean and signals stay actionable.
It is designed for intraday traders on 1–5 minute charts, particularly for 0DTE / weekly options entries on QQQ, SPX, SPY, IWM, and the Mag-8 names, but it works on any liquid symbol.
The four scoring components
The total score (0–100) is the weighted sum of:
EMA / Trend (default 30 pts) — Fast EMA vs Slow EMA, Slow vs Trend, price vs Trend EMA, normalized EMA gap, and candle direction. Rewards aligned trend structure on the entry bar.
FVG (default 30 pts) — Price must be touching one of the top-N highest-ranked FVG zones (sorted internally by size, volume, trend alignment, mitigation, and age). Score is scaled by the FVG's own directional strength %, so a 98%-strength zone contributes ~29 pts while a 50% zone contributes ~15 pts.
VWAP (default 20 pts) — Side (price above/below) plus slope (rising/falling, measured over a configurable lookback). Anchored VWAP with Session/Week/Month/Quarter/Year options.
Candle (default 20 pts) — Body-to-range ratio of the entry bar, rewarding decisive close-direction candles.
All four weights are user-adjustable and a live score table in the top-right shows each component's bull and bear contribution every bar, plus the active signal state.
How the state machine works
Trigger: in-session AND directional score ≥ threshold.
Per-symbol threshold: Mag-8 + index ETFs (AAPL, MSFT, GOOGL, AMZN, NVDA, META, TSLA, AVGO, QQQ, SPY, IWM) use a lower threshold (default 70). Everything else uses a higher threshold (default 90). Both are configurable.
One signal per direction: Once a BUY prints, no further BUYs print until a SELL fires (and vice versa). No clutter, no repainting signals, no second-guessing.
Tie-break: If both bull and bear clear threshold on the same bar, the higher score wins.
Fair Value Gap engine
The FVG component is built on the classic 3-bar imbalance definition (bull = low > high[2], bear = high < low[2]) and extends it with:
Quality scoring (size, volume vs MA, trend EMA alignment, age decay, mitigation penalty)
Continuous mitigation tracking (zones are removed when fully filled)
Internal storage of up to 200 FVGs with the top N displayed
Per-zone bull/bear strength bars (0–100%) and smart text labels ("Strong Bullish Imbalance," "Bearish Bias," etc.)
The FVG ranking and rendering logic is adapted from Zeiierman's Ranked FVG Imbalance Zones (CC BY-NC-SA 4.0), with the scoring, state machine, and confluence integration built on top.
Visuals
EMA 9/21/50 with ATR buffer band around the fast EMA
Optional EMA-cross triangles
Anchored VWAP line
FVG zone boxes with strength bars and text labels
Optional candle coloring by EMA 9/21 alignment
BUY/SELL labels with embedded score
Live score table (component breakdown + total + threshold + state)
Alerts
Combined real-time alert — uses alert() so a single TradingView alert on "Any alert() function call" fires on every printed BUY or SELL, with the score and ticker embedded in the message.
Separate alertcondition() entries for BUY, SELL, new bull FVG, new bear FVG, bull FVG touch, bear FVG touch.
Recommended use
Timeframe: 1m, 2m, 3m, or 5m for intraday; the EMA 9/21 framework is calibrated for these.
Session: RTH-gated by default (09:30–16:00 America/New_York). Configurable.
Workflow: Wait for a BUY/SELL label inside an FVG zone with score ≥ threshold and the score table showing alignment across at least three of four components. Use the FVG zone as structural invalidation.
Tuning: If you're getting too few signals on a non-Mag-8 name, lower the "Other Threshold." If you want stricter signals on the Mag-8, raise the "Day-11 Threshold."
Notes
Signals are gated by inSession, so no pre-market or after-hours prints.
Score is clamped 0–100 for display; VWAP can contribute negatively to the raw score, which is intentional (price on the wrong side of a sloping VWAP should hurt the directional case).
All visuals (zones, bars, text, EMA fill, score table) can be toggled off independently.
License & credits
Released under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0).
FVG ranking, rendering, and storage architecture adapted from Zeiierman — Ranked FVG Imbalance Zones. EMA/VWAP/candle scoring, state machine, per-symbol thresholds, score table, and combined alert engine are original work.
Disclaimer: This indicator is for educational and informational purposes only. It is not financial advice and does not guarantee profitable trades. 0DTE and weekly options carry significant risk of total loss. Always test on a paper account before risking capital, and size positions according to your own risk tolerance.
A confluence-scored signal engine that combines Fair Value Gap (FVG) imbalance zones, EMA 9/21/50 trend structure, anchored VWAP, and candle quality into a single 0–100 directional score. One BUY or SELL per direction until the opposite side fires.
What it does
Most pullback and FVG indicators print signals on every touch, every cross, every fresh gap — and the noise drowns out the edge. This indicator scores every bar against a weighted, four-factor confluence model and only prints a signal when the directional score clears a per-symbol threshold during regular trading hours. A built-in state machine guarantees one BUY (or SELL) per leg until the opposite side triggers, so the chart stays clean and signals stay actionable.
It is designed for intraday traders on 1–5 minute charts, particularly for 0DTE / weekly options entries on QQQ, SPX, SPY, IWM, and the Mag-8 names, but it works on any liquid symbol.
The four scoring components
The total score (0–100) is the weighted sum of:
EMA / Trend (default 30 pts) — Fast EMA vs Slow EMA, Slow vs Trend, price vs Trend EMA, normalized EMA gap, and candle direction. Rewards aligned trend structure on the entry bar.
FVG (default 30 pts) — Price must be touching one of the top-N highest-ranked FVG zones (sorted internally by size, volume, trend alignment, mitigation, and age). Score is scaled by the FVG's own directional strength %, so a 98%-strength zone contributes ~29 pts while a 50% zone contributes ~15 pts.
VWAP (default 20 pts) — Side (price above/below) plus slope (rising/falling, measured over a configurable lookback). Anchored VWAP with Session/Week/Month/Quarter/Year options.
Candle (default 20 pts) — Body-to-range ratio of the entry bar, rewarding decisive close-direction candles.
All four weights are user-adjustable and a live score table in the top-right shows each component's bull and bear contribution every bar, plus the active signal state.
How the state machine works
Trigger: in-session AND directional score ≥ threshold.
Per-symbol threshold: Mag-8 + index ETFs (AAPL, MSFT, GOOGL, AMZN, NVDA, META, TSLA, AVGO, QQQ, SPY, IWM) use a lower threshold (default 70). Everything else uses a higher threshold (default 90). Both are configurable.
One signal per direction: Once a BUY prints, no further BUYs print until a SELL fires (and vice versa). No clutter, no repainting signals, no second-guessing.
Tie-break: If both bull and bear clear threshold on the same bar, the higher score wins.
Fair Value Gap engine
The FVG component is built on the classic 3-bar imbalance definition (bull = low > high[2], bear = high < low[2]) and extends it with:
Quality scoring (size, volume vs MA, trend EMA alignment, age decay, mitigation penalty)
Continuous mitigation tracking (zones are removed when fully filled)
Internal storage of up to 200 FVGs with the top N displayed
Per-zone bull/bear strength bars (0–100%) and smart text labels ("Strong Bullish Imbalance," "Bearish Bias," etc.)
The FVG ranking and rendering logic is adapted from Zeiierman's Ranked FVG Imbalance Zones (CC BY-NC-SA 4.0), with the scoring, state machine, and confluence integration built on top.
Visuals
EMA 9/21/50 with ATR buffer band around the fast EMA
Optional EMA-cross triangles
Anchored VWAP line
FVG zone boxes with strength bars and text labels
Optional candle coloring by EMA 9/21 alignment
BUY/SELL labels with embedded score
Live score table (component breakdown + total + threshold + state)
Alerts
Combined real-time alert — uses alert() so a single TradingView alert on "Any alert() function call" fires on every printed BUY or SELL, with the score and ticker embedded in the message.
Separate alertcondition() entries for BUY, SELL, new bull FVG, new bear FVG, bull FVG touch, bear FVG touch.
Recommended use
Timeframe: 1m, 2m, 3m, or 5m for intraday; the EMA 9/21 framework is calibrated for these.
Session: RTH-gated by default (09:30–16:00 America/New_York). Configurable.
Workflow: Wait for a BUY/SELL label inside an FVG zone with score ≥ threshold and the score table showing alignment across at least three of four components. Use the FVG zone as structural invalidation.
Tuning: If you're getting too few signals on a non-Mag-8 name, lower the "Other Threshold." If you want stricter signals on the Mag-8, raise the "Day-11 Threshold."
Notes
Signals are gated by inSession, so no pre-market or after-hours prints.
Score is clamped 0–100 for display; VWAP can contribute negatively to the raw score, which is intentional (price on the wrong side of a sloping VWAP should hurt the directional case).
All visuals (zones, bars, text, EMA fill, score table) can be toggled off independently.
License & credits
Released under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0).
FVG ranking, rendering, and storage architecture adapted from Zeiierman — Ranked FVG Imbalance Zones. EMA/VWAP/candle scoring, state machine, per-symbol thresholds, score table, and combined alert engine are original work.
Disclaimer: This indicator is for educational and informational purposes only. It is not financial advice and does not guarantee profitable trades. 0DTE and weekly options carry significant risk of total loss. Always test on a paper account before risking capital, and size positions according to your own risk tolerance.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.