MetaTrader 5 blocks every WebRequest() until you open Tools -> Options -> Expert Advisors, enable "Allow WebRequest for listed URL", and add the exact origin https://forexnewsradar.com (no trailing slash or path needed).
Fixing MQL5 WebRequest Error 4014 & Broker Symbol Suffix Mismatches (XAUUSD.pro, XAUUSDm, iEURUSD)
Test your fix live in 10 seconds on EUR/USD for $0 forever. Two bugs break 90% of MetaTrader 5 news filters during prop-firm deployment: Error 4014 (unlisted origin URL or indicator-thread restriction) and broker symbol suffixes/prefixes like XAUUSD.pro, XAUUSDm, iEURUSD, or GOLD.
MQL5 strictly forbids WebRequest() inside Custom Indicators (OnCalculate) and Strategy Tester runs—always returning 4014 even when the URL is whitelisted. Run HTTP polling inside an Expert Advisor (OnTimer) and share flags via GlobalVariableSet().
Prop firms routinely rename symbols across accounts (EURUSD.pro, EURUSDm, iEURUSD, XAUUSD.raw, GOLD). Instead of fragile MQL5 StringSubstr() hacks, pass raw _Symbol straight to ForexNewsRadar—our edge router normalizes every variant canonically.
// 1. Must run in an Expert Advisor (.mq5 in MQL5/Experts/), NEVER in a Custom Indicator!
// 2. Tools -> Options -> Expert Advisors -> Allow WebRequest for listed URL -> https://forexnewsradar.com
// 3. Test live for $0 with EURUSD (even if your broker names it EURUSD.pro, EURUSDm, or mEURUSD):
bool FNR_FetchLiveGate(string rawSymbol = "") {
if(MQLInfoInteger(MQL_TESTER)) return true; // WebRequest is disabled in Strategy Tester
string sym = (StringLen(rawSymbol) > 0) ? rawSymbol : _Symbol;
// Server normalizes EURUSD.pro, mEURUSD, XAUUSDm, iXAUUSD.pro automatically:
string url = "https://forexnewsradar.com/api/v1/pairs/" + sym + "?compact=1";
char post[], result[];
string resHeaders;
ResetLastError();
int code = WebRequest("GET", url, "Accept: application/json\r\n", 5000, post, result, resHeaders);
if(code == -1) {
int err = GetLastError();
if(err == 4014) Print("FNR Error 4014: Whitelist https://forexnewsradar.com in Tools->Options->Expert Advisors (and run as EA, not Indicator).");
return false; // Fail-closed on network/whitelist error
}
if(code != 200) return false; // 402 = locked Pro pair; fail-closed
string body = CharArrayToString(result);
return (StringFind(body, "\"stale\":false") >= 0 && StringFind(body, "\"prop_safe_to_trade\":true") >= 0);
}
Common MT5 Broker Symbol Formats Automatically Normalized by ForexNewsRadar
| Raw MT5 _Symbol | Broker / Prop Pattern | Normalized Canonical Pair | Test Endpoint (?compact=1) |
|---|---|---|---|
| EURUSD.pro / EURUSDm / EURUSD_ecn | Suffix brokers & prop accounts | EURUSD (Free $0) | /api/v1/pairs/EURUSD.pro?compact=1 |
| mEURUSD / iEURUSD / .EURUSD | Prefix & institutional feeds | EURUSD (Free $0) | /api/v1/pairs/mEURUSD?compact=1 |
| XAUUSD.pro / XAUUSDm / iXAUUSD | Spot Gold prop variants | XAUUSD (Gold) | /api/v1/pairs/XAUUSD.pro?compact=1 |
| GOLD / XAU/USD (MCP & Alias) | CFD / Metals alias symbols | XAUUSD (Gold) | /api/v1/pairs/XAUUSD?compact=1 |
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.
Complete 3-Step Checklist to Eliminate MQL5 Error 4014
First, verify your code is compiled inside MQL5/Experts/ (not MQL5/Indicators/). MetaTrader 5 enforces single-threaded chart painting for indicators and immediately rejects WebRequest() with error 4014 inside any indicator. If an indicator needs live news status, attach our Zero-DLL ForexNewsRadar_PropShield.mq5 EA to one chart and read GlobalVariableGet("FNR_PROP_SAFE_EURUSD") from your indicator with zero HTTP calls.
Second, open Tools -> Options -> Expert Advisors, tick Allow WebRequest for listed URL, and paste https://forexnewsradar.com verbatim (make sure there are no trailing spaces and that you click OK to persist the setting). Third, guard Strategy Tester backtests with if(MQLInfoInteger(MQL_TESTER)) return true; because MT5 blocks external HTTP during backtesting.
Why Server-Side Suffix Normalization Beats Local StringSubstr(0, 6)
Hardcoding StringSubstr(_Symbol, 0, 6) breaks immediately when a broker uses a 1-character prefix like mEURUSD or iXAUUSD.pro (turning iXAUUSD.pro into "iXAUUS"). ForexNewsRadar’s Cloudflare Edge router parses institutional prefixes, suffixes, dots, underscores, and slashes canonically before looking up pair telemetry—returning canonical "symbol":"EURUSD" or "symbol":"XAUUSD" every time.
Primary Technical References & Verification Sources
- MetaQuotes MQL5 Reference — WebRequest() Function & Error 4014 (ERR_FUNCTION_NOT_ALLOWED)
- MetaQuotes MQL5 Reference — MQL_TESTER Execution Environment Flag
- ForexNewsRadar OpenAPI 3.1 Path Parameter Normalization (/openapi.json)
Frequently Asked Engineering & Compliance Questions
Can I test broker suffix normalization without an API key?
Yes. Call https://forexnewsradar.com/api/v1/pairs/EURUSD.pro?compact=1 or https://forexnewsradar.com/api/v1/pairs/mEURUSD?compact=1 right now—both resolve to free live EUR/USD and return HTTP 200 with zero API key.
Why does WebRequest return 4014 even after I added https://forexnewsradar.com?
In 95% of cases, either (1) the script is running as a Custom Indicator instead of an Expert Advisor, (2) it is running inside Strategy Tester without an MQL_TESTER bypass, or (3) a typo/trailing space exists in the Allowed URLs box.
What if my broker names Spot Gold "GOLD" instead of "XAUUSD"?
ForexNewsRadar normalizes GOLD and XAUUSD variants seamlessly on our Remote MCP server and PropShield.mq5 symbol mapper, and supports canonical XAUUSD / XAUUSD.pro / XAUUSDm / iXAUUSD on REST.