Dynamic EMA x VWAP Alerts

What it does (quick take)
- Detects EMA crossovers (double or optional triple) and evaluates them in VWAP context.
- Plots Buy/Sell markers only when all chosen conditions are met.
- Clean UX: keep all or parts of the engine visible or hide everything and let alerts run based on the silent engine behind your own S/R levels in an uncluttered, practical chart, as illustrated below.
Engine illustration: All selected engines visible
Practical use case: Same snapshot sequence as above but all selected engines invisible
Swing examples (beyond intraday)
Signals-only (clean value view):
Signals + your own S/R lines:
EMA selection (choose your playbook)
Defaults: Fast 9, Medium 21 (common intraday combo).
Modes: Double Cross — Fast vs Medium.
Triple Cross (optional) — adds a Slow EMA trend filter (enable Slow > 0).
Ranges: you can set each EMA 0–200 (0 = hidden/off)
Visuals are optional; you can display or hide each EMA line
EMA cross footprints (optional): Helps you assess trend continuation or change.
Use your own strategy: switch to 9/50, 20/50, 50/200, or whatever EMA set you trust for your instrument/timeframe.
VWAP Selection (the context engine)
- Daily VWAP – resets each chart day (00:00–23:59). Typical fit: scalpers and fast intraday decision points.
- Weekly VWAP – resets at the start of the calendar week. Typical fit: intraday with higher-timeframe context (aligns day trades with weekly bias).
- Rolling VWAP – an adjustable VWMA-based rolling anchor (not session-reset), used as a flexible context reference Typical fit: multi-day swings when you want a flexible anchor that adapts across sessions.
- Standard deviation bands (σ ±1/±2/±3) available for each anchor and help you express the “how far from fair value” idea.
Why VWAP matters: it’s a running, volume-weighted anchor where strong moves relative to VWAP and its bands help frame mean-reversion vs. trend-continuation risk. Evaluating crosses relative to VWAP/±σ reduces “everywhere” noise and helps frame potential setups.
How alerts are decided
An alert triggers only when:
- Your selected EMA crossover occurs, and
- Your chosen VWAP gate(s) and any filters pass. (Computed on bar close to avoid mid-bar noise)
- Signals and alerts do not repaint; alerts evaluate and fire once per bar close.
Alert gates (Single / AND / OR)
- Select one VWAP source or combine two (e.g., Daily + Weekly) with Single, AND, or OR logic.
- Choose gate levels from VWAP or standard deviation bands (±σ). Typical long logic: price at/under VWAP or −σ. Typical short logic: price at/over VWAP or +σ.
Practical recipes:
Trend-follow: Daily AND Weekly at/above VWAP → confirms strength on two anchors.
Mean-reversion probe: Daily OR Rolling at −1σ → allows earlier fades with flexibility.
Advanced filtering: Suitable for advanced/Quant traders
During the research and development of this indicator, the EMA/VWAP cross logic was tested on historical S&P500 Futures data to explore patterns on multiple timeframes. These selected filtering indicators below showed correlation between certain market conditions and chosen indicator thresholds, helping reduce noise and lower-quality alerts. Results were research-oriented and are not predictive of future performance.
Therefore, I have built these indicator filters that run silently in the background. They let you trim noise by requiring alerts to appear only in market regimes you define. Each one constrains alert conditions; using them together helps tailor alerts to your strategy—but overly strict settings may filter out most or all alerts.
- Relative Volume (RVOL): compares current volume to a baseline; ensures alerts arrive with participation instead of thin tape.
- Deviation Threshold (%): controls how close the cross must be to the VWAP/σ level; tight = anchored signals, loose = more activity.
- ATR Gate (+ Relative regime): keeps alerts inside a volatility regime; avoids both dead tape and chaotic spikes.
- Distance Guard: requires price to be at least X ticks/% away from VWAP; useful to avoid premature signals near fair value.
Note: It’s not recommended to activate all of them at once or change the values aggressively. Unless you’ve done deeper backtesting or machine learning calibration, you can easily filter out everything. Use small thresholds at first, then adjust to your instrument once you see how each filter changes alert frequency and quality. Advanced/quant users can fine-tune freely.
Case example:
Unfiltered: Timeframe 15 min, EMA Selection 9/21, VWAP gates Rolling (250 bars) OR Weekly
Filtered: Same setup as above + activated filters:
RVOL: 100 bars, Min. RVOL 0.4
Deviation threshold (%): 0.3
ATR Length: 14
Min ATR (%): 0.05
Relative regime: Base length 2000, Min Ratio 0.85, Max Ratio 2
Under the hood
This indicator leans on TradingView built-ins (e.g., EMA, VWMA, ATR, alertcondition) to maximize speed, stability, and compatibility while we implement the custom logic (VWAP anchors, band gating, combinator gates, advanced filters, time windows). Built-ins were easy to work with and reduced edge-case bugs and kept the visuals responsive, while the design gives fine-tuning and clean visuals—so both discretionary traders and quant-minded users can shape the alerts to their strategy and workflow.
Disclaimer
The tools, scripts, and indicators presented here are provided for educational and informational purposes only. They are not financial advice and should not be interpreted as investment recommendations, trading signals, or a solicitation to buy or sell any financial instrument.
All forms of trading and investing involve risk. The past performance of any security, strategy, or market condition does not guarantee future outcomes. Users are solely responsible for their own trading and investment decisions, including evaluating their financial situation, objectives, and risk tolerance.
By using this indicator, you acknowledge that you do so at your own risk. The author accepts no liability for any direct or indirect loss or damage—including, without limitation, loss of profits—that may arise from the use of, or reliance upon, this tool.
Skrip hanya-undangan
Hanya pengguna yang disetujui oleh penulis yang dapat mengakses skrip ini. Anda harus meminta dan mendapatkan izin untuk menggunakannya. Izin ini biasanya diberikan setelah pembayaran. Untuk detail lebih lanjut, ikuti petunjuk penulis di bawah ini atau hubungi Quantastico secara langsung.
TradingView TIDAK menyarankan untuk membayar atau menggunakan skrip kecuali anda benar-benar percaya kepada pembuatnya dan memahami cara kerjanya. Anda juga dapat menemukan alternatif sumber terbuka yang gratis di skrip komunitas kami.
Instruksi penulis
Pernyataan Penyangkalan
Skrip hanya-undangan
Hanya pengguna yang disetujui oleh penulis yang dapat mengakses skrip ini. Anda harus meminta dan mendapatkan izin untuk menggunakannya. Izin ini biasanya diberikan setelah pembayaran. Untuk detail lebih lanjut, ikuti petunjuk penulis di bawah ini atau hubungi Quantastico secara langsung.
TradingView TIDAK menyarankan untuk membayar atau menggunakan skrip kecuali anda benar-benar percaya kepada pembuatnya dan memahami cara kerjanya. Anda juga dapat menemukan alternatif sumber terbuka yang gratis di skrip komunitas kami.