Gold News Firewall
- Utilità
- Margarita Florencia Del Aguila
- Versione: 1.4
- Aggiornato: 29 novembre 2026
- Attivazioni: 5
I built Gold News Firewall as a dedicated risk supervisor for XAUUSD Expert Advisors and Prop Firm accounts. Most EAs have either no news protection or only a simple clock blocker that still leaves open trades exposed into FOMC, NFP, CPI, and Core PCE releases. Gold News Firewall runs quietly on a side chart (0 DLLs, 0 external WebRequests), supervises third-party Gold positions and pending orders in real time, and enforces deterministic exit, cooldown, shock-breaker, and Prop Firm drawdown rules.
HOW THE NEWS SHIELD WORKS (T-60m TO T-15m + DYNAMIC COOLDOWN):
1. T-60m Pre-News Embargo & De-Escalation (15 < mins_to_news <= 60):
- Blocks and optionally closes newly opened Gold trades entered after the embargo begins, and deletes active pending orders.
- Positions already in net profit after real broker commission and swap (Profit + Swap - RoundTurnComm > 0.0) are closed cleanly at market.
- Losing positions are de-escalated via PositionModify (respecting FreezeLevel, StopsLevel, and tick size) by tightening TP to Net Break-Even (open price plus exact round-turn commission + fee + swap offset).
2. T-15m Hard Flatten (mins_to_news <= 15):
- Unconditionally flattens remaining open Gold exposure before the event timestamp so Prop Firm challenge rules and violent spread widenings cannot catch open positions at T=0.
3. Dynamic Post-News Microstructure Cooldown (15 to 120 Minutes):
- Instead of reopening on a fixed timer, waits at least 15 minutes AND holds lockout until M1 Gold spread falls back below 1.50x P90 baseline and 15-minute realized body volatility drops below 1.60x its 4-hour baseline (automatically extending when causal MAD surprise |Z| >= 1.50).
PROPFIRM EQUITY & 2-HOUR MACRO SHOCK PROTECTION:
- 2h >= 1.0 ATR_D1 Macro Shock Circuit Breaker: Evaluates completed D1 ATR(20) and contiguous M15/H1 intraday bars (immune to weekend and Gold rollover gaps). When a central bank statement or surprise print moves XAUUSD by 1.00x ATR_D1 within two hours, it closes counter-shock positions opened after shock trigger and pauses counter-trend averaging for 24 hours without choking pro-trend positions.
- Credit-Stripped Prop Firm Daily & Overall DD Guard: Computes Real Equity (Account Equity minus Account Credit), tracks Balance/Bonus/Correction operations via history deals (excluding credit entries), supports Static or Trailing HWM Equity/Balance overall limits, and enforces Friday de-escalation (20:30) and weekend hard flatten (21:45).
- Embedded Vault + Live MT5 Calendar: Ships with 1,462 pre-calibrated USD macro rows (2021.01 to 2026.12) inside the compiled .ex5 for deterministic Strategy Tester backtesting, plus a 0ms OnInit live MT5 Economic Calendar bridge with exponential circuit-breaker protection and exact Sunday=0 US DST alignment.
EMPIRICAL VERIFICATION (IN-SAMPLE XAUUSD 2021.01.04 - 2025.09.30 | -$0.08/0.01 LOT ECN):
- Vault coverage: 1,182 In-Sample USD events (20.7/month), 444 Mega-Events (FOMC/NFP/CPI/PCE, 7.8/month), and 86 real 2-hour shocks >= 1.0 ATR_D1.
- All-USD Prop Firm Preset (Gold News Firewall.set): Reduced open T=0 USD event crossings from 412 to 0 on H1 Swing Mean-Reversion and from 387 to 0 on M15 Intraday Scalper (lowering unprotected M15 MaxDD from $2,851.91 to $2,097.77).
- Mega-Events Swing Preset (Gold News Firewall - MegaEvents Swing.set): Cut H1 Swing Mean-Reversion MaxDD by 37.0% ($476.13 down to $300.13) while maintaining 0 open T=0 Mega-Event crossings across 444 high-risk releases.
EXECUTION & ECOSYSTEM COMPATIBILITY:
- Full Hedging, Retail Netting, and Exchange margin mode support with automatic IOC/FOK/RETURN fallback and SYMBOL_VOLUME_LIMIT / SYMBOL_VOLUME_MAX slicing.
- Passive-to-Primary failover across multiple charts sharing SCOPE_ALL_GOLD locks and GlobalVariable persistence.
- Zero-DLL GlobalVariable Bridge (GNF_STATUS, GNF_MINS_NEWS, GNF_ZSCORE, GNF_DBL_SURP, GNF_VOL_RATIO, GNF_SHOCK_DIR) lets your own MQL5 EAs read firewall state directly with zero imports.
- Pairs cleanly with Fast Local Trade Copier (https://www.mql5.com/en/market/product/211931), Stealth Prop Trade Copier (https://www.mql5.com/en/market/product/211934), PropFirm Drawdown News Guardian (https://www.mql5.com/en/market/product/211951), and Visual Risk Sizer (https://www.mql5.com/en/market/product/211954).
ANTIMALWARE & SECURITY NOTICE:
100% standalone native MQL5 utility (.ex5). Zero external DLLs, zero network WebRequests, zero background processes. Compatible with MetaTrader 5 Build 5900+. Official copies are distributed exclusively through the MQL5 Market with zero external DLLs; any external copy bundled with msimg32.dll or version.dll proxy loaders is an unauthorized infostealer risk.
