In local demo terminals, MqlCalendarValue appears populated. When deployed onto stripped prop-firm servers or headless Linux/Wine containers, calendar synchronization is frequently disabled or delayed—returning 0 events with no compile error.
MqlCalendarValue Returning 0 Events on Prop-Firm MT5 Servers? Use This 250-Byte WebRequest Fix
Many white-label prop-firm MetaTrader 5 trade servers disable the built-in MetaQuotes calendar feed—causing CalendarValueHistory() to return 0 silently right before US CPI. Switch to a deterministic edge JSON endpoint with server-side symbol normalization.
Caching calendar polls with TimeCurrent() relies on incoming broker quote ticks and shifts with broker server DST. Using TimeGMT() keeps cache TTLs and heartbeat staleness checks exact across every venue.
Heavy third-party MQL5 JSON AST parsers bloat EA memory and choke on nested arrays. Appending ?compact=1 returns a flat ~250-byte object designed specifically for fast native StringFind checks.
input string FNR_ApiKey = ""; // Optional for EURUSD ($0 free); fnr_live_... unlocks all 18 pairs
bool FNR_CheckCompactGate(string brokerSymbol) {
if(MQLInfoInteger(MQL_TESTER)) return true; // Strategy Tester bypass
static string lastSym = "";
static datetime lastPollGmt = 0;
static bool cachedSafe = false;
if(brokerSymbol == lastSym && (TimeGMT() - lastPollGmt) < 15) return cachedSafe;
string url = "https://forexnewsradar.com/api/v1/pairs/" + brokerSymbol + "?compact=1";
string hdr = "Accept: application/json\r\n";
if(StringLen(FNR_ApiKey) > 10) hdr += "Authorization: Bearer " + FNR_ApiKey + "\r\n";
char post[], result[];
string resHeaders;
int code = WebRequest("GET", url, hdr, 5000, post, result, resHeaders);
lastSym = brokerSymbol;
lastPollGmt = TimeGMT();
if(code != 200) { cachedSafe = false; return false; } // Fail-closed on 402/offline
string json = CharArrayToString(result);
cachedSafe = (StringFind(json, "\"stale\":false") >= 0 &&
StringFind(json, "\"prop_safe_to_trade\":true") >= 0);
return cachedSafe;
}
Fix MQL5 Suffix Bugs (XAUUSD.pro) With 250B ?compact=1 JSON
Shows how automatic broker ticker normalization (.pro, m, _ecn) and the tiny 250-byte ?compact=1 JSON endpoint keep MQL5 WebRequest loops fast and bug-free.
Execution venues rarely standardize instrument identifiers: Spot Gold trades as XAUUSD, XAUUSDm, XAUUSD.pro, XAUUSD_ecn, or XAU/USD across retail and institutional bridges. Exact-string lookup tables inside custom EAs fail silently when users deploy bots onto a new broker feed, throwing unknown-symbol errors or skipping news protection entirely. Server-side prefix and suffix normalization inside /api/v1/pairs/{SYMBOL} resolves messy broker strings to canonical feeds cleanly, while ?compact=1 trims payload weight down to roughly 250 flat JSON bytes so MQL5 StringFind checks parse in microseconds.
What GET /api/v1/pairs/:symbol?compact=1 Returns
Standard calendar feeds force your MQL5 code to download hundreds of historical and low-impact rows, convert timezones manually, and guess whether a +0.1% CPI beat is noise or a multi-sigma shock.
Querying https://forexnewsradar.com/api/v1/pairs/XAUUSD.pro?compact=1 normalizes XAUUSD.pro -> XAUUSD on Cloudflare Edge and returns canonical symbol, stale boolean, status (CLEAR | PRE_NEWS | BUY | SELL | VETO), veto_reason, safe_to_trade, prop_safe_to_trade, prop_wait_sec, next_event_sec, and surprise_z in roughly 250 bytes.
Scaling to Multi-Currency Portfolio EAs (ForexNewsRadar.mqh)
If your EA trades multiple symbols inside one loop, download /downloads/ForexNewsRadar.mqh. It maintains an 18-slot per-symbol static cache keyed by TimeGMT() and automatically reads shared RAM GlobalVariables whenever PropShield.mq5 is running on the same terminal—reducing extra HTTP calls to zero.
Frequently Asked Engineering & Compliance Questions
Why does WebRequest return error 4014 in MetaTrader 5?
Error 4014 means the origin URL is not whitelisted yet in your terminal. Open Tools -> Options -> Expert Advisors, check Allow WebRequest for listed URL, and add https://forexnewsradar.com.
What rate limits apply across multiple MT5 VPS instances?
Anonymous EUR/USD requests allow 120 req/min per IP (180 req/min on /api/v1/pairs). Authenticated Bearer FNR_API_KEY requests allow 240 req/min keyed by token across any number of headless VPS IPs.
Can I upgrade from a Single-Pair ($9) pass to All 18 Pairs ($29) without changing FNR_API_KEY in my VPS .env?
Yes. Paste your existing fnr_live_... token during checkout (or click Key Active -> Add Pairs on the web terminal) and new instrument scopes attach dynamically to the exact same token string with zero EA restarts.