OPEN-SOURCE SCRIPT
EMA Crossover Strategy [15M]

EMA Crossover Strategy [15M] — Stats Panel + Pip/$ Tracking + Chop Filter
A clean, rules-based EMA crossover strategy built for XAUUSD (Gold) on the 15-minute timeframe, with multi-timeframe signal confirmation, dynamic risk/reward boxes, and a full live stats panel.
🔧 How It Works
Signals are generated when the Fast EMA (5) crosses the Slow EMA (13) on the higher timeframe. The stop loss is placed at the EMA intersection point, and the take profit is calculated automatically using your chosen Risk:Reward ratio (default 2:1).
📊 Features
✅ Multi-timeframe EMA crossover detection (no repainting)
✅ Dynamic SL placed at EMA intersection — not a fixed pip distance
✅ Automatic TP calculated from your RR ratio
✅ Visual Risk/Reward boxes anchored by time (stay pinned when scrolling/zooming)
✅ VWAP filter — only takes longs above VWAP, shorts below
✅ ADX chop filter — avoids sideways markets below your ADX threshold
✅ EMA separation filter — skips signals when EMAs are too close together
✅ Stats panel (bottom left) — total trades, win rate, net RR, pips captured/lost, net $/oz
✅ Active trade panel (top right) — live entry, SL, TP, risk in pips and price
✅ JSON alerts for webhook/bot integration
✅ TP ✓ and SL ✗ hit labels on chart
⚙️ Inputs
SettingDefaultDescriptionHigher Timeframe15MHTF for EMA signalsFast EMA5Fast EMA lengthSlow EMA13Slow EMA lengthRR Ratio2.0Risk:Reward multiplierVWAP FilterOnTrend direction filterADX FilterOnChop/sideways filterADX Threshold20Minimum ADX for a valid signalEMA Sep FilterOnMinimum EMA gap filterPip Size0.1Set to 0.1 for XAUUSD (OANDA)
📌 Notes
Built and optimised for XAUUSD on OANDA — adjust pip size for other brokers or instruments
Uses barmerge.lookahead_off to prevent repainting
Drawings are anchored by time (xloc.bar_time) so they stay correctly positioned when scrolling or changing zoom
Alerts fire in JSON format — ready for webhook or bot automation
⚠️ Disclaimer
This script is for educational and informational purposes only. Past performance is not indicative of future results. Always manage your own risk.
A clean, rules-based EMA crossover strategy built for XAUUSD (Gold) on the 15-minute timeframe, with multi-timeframe signal confirmation, dynamic risk/reward boxes, and a full live stats panel.
🔧 How It Works
Signals are generated when the Fast EMA (5) crosses the Slow EMA (13) on the higher timeframe. The stop loss is placed at the EMA intersection point, and the take profit is calculated automatically using your chosen Risk:Reward ratio (default 2:1).
📊 Features
✅ Multi-timeframe EMA crossover detection (no repainting)
✅ Dynamic SL placed at EMA intersection — not a fixed pip distance
✅ Automatic TP calculated from your RR ratio
✅ Visual Risk/Reward boxes anchored by time (stay pinned when scrolling/zooming)
✅ VWAP filter — only takes longs above VWAP, shorts below
✅ ADX chop filter — avoids sideways markets below your ADX threshold
✅ EMA separation filter — skips signals when EMAs are too close together
✅ Stats panel (bottom left) — total trades, win rate, net RR, pips captured/lost, net $/oz
✅ Active trade panel (top right) — live entry, SL, TP, risk in pips and price
✅ JSON alerts for webhook/bot integration
✅ TP ✓ and SL ✗ hit labels on chart
⚙️ Inputs
SettingDefaultDescriptionHigher Timeframe15MHTF for EMA signalsFast EMA5Fast EMA lengthSlow EMA13Slow EMA lengthRR Ratio2.0Risk:Reward multiplierVWAP FilterOnTrend direction filterADX FilterOnChop/sideways filterADX Threshold20Minimum ADX for a valid signalEMA Sep FilterOnMinimum EMA gap filterPip Size0.1Set to 0.1 for XAUUSD (OANDA)
📌 Notes
Built and optimised for XAUUSD on OANDA — adjust pip size for other brokers or instruments
Uses barmerge.lookahead_off to prevent repainting
Drawings are anchored by time (xloc.bar_time) so they stay correctly positioned when scrolling or changing zoom
Alerts fire in JSON format — ready for webhook or bot automation
⚠️ Disclaimer
This script is for educational and informational purposes only. Past performance is not indicative of future results. Always manage your own risk.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。