PropNewsSpreadGuard (MT5 Expert Advisor)
Standalone, zero-DLL MetaTrader 5 risk-protection utility engineered for algorithmic and prop-firm traders running automated EAs across major FX pairs and metals (EURUSD, GBPUSD, USDJPY, XAUUSD, XAGUSD).
Maintained by ForexNewsRadar.
Live Chart HUD Preview
1. Calm Market (SAFE · CLEAR)
2. Active Macro / Spread Shock (DO NOT TRADE · VETO)
Core Architecture
- Pre-News & Post-News Blackout (
T-5m/T+5m): Reads the native MetaTrader 5 Economic Calendar (CalendarValueHistory) for currencies matching the chart symbol (including automaticUSDmapping onXAUUSD/XAGUSD) and activates a configurable pre-release and post-release cooldown window. - Dynamic Spread-Spike & Liquidity Vacuum VETO: Computes a calm-regime rolling EMA of live broker spread (
SYMBOL_SPREAD) without polluting the baseline during news spikes, triggeringSPREAD_VETOwhenever spread breaches either your hard point cap (InpMaxSpreadPoints) or dynamic multiplier (InpSpreadSpikeMultiplier). - Non-Destructive Pending-Order Sweeper: Optionally clears unfilled pending stop/limit orders (
Buy Stop,Sell Stop,Buy Limit,Sell Limit) during activePRE_NEWSorSPREAD_VETOwindows while never closing or modifying already open positions. Supports filtering byMagicNumber(-1= all pending orders on symbol). - Cross-EA Terminal RAM Bridge (
GlobalVariableSet): PublishesFNR_GUARD_SAFE_<SYMBOL>(1.0= safe to open new trades,0.0= stand aside) andFNR_GUARD_STATE_<SYMBOL>every second so any custom EA in the same MT5 terminal can gate new entries with a singleGlobalVariableGet()check and zero file or DLL overhead.
Installation & Quick Integration
- Copy
PropNewsSpreadGuard.mq5intoMQL5/Experts/and compile in MetaEditor (0 errors, 0 warnings). - Attach to any FX or metal chart (
Enable Algorithmic Tradingchecked). - (Optional) Gate entries inside your own EA via the terminal RAM variable:
string guardKey = "FNR_GUARD_SAFE_" + _Symbol;
if(GlobalVariableCheck(guardKey) && GlobalVariableGet(guardKey) < 0.5)
{
// Active Pre-News or Spread-Spike VETO — skip new entry
return;
}
Author
- MQL5 Profile: ForexNewsRadar

