News Filter for MT5 EA — No Code
Quick Answer: News Filter in Strategy Builder
Quick answer: Open AlfaTactix Strategy Builder → complete Steps 1–3 (your entry signals) → Step 4 — Filters → add filter Economic Calendar (under News & Sentiment) → set parameters (Impact: High, Currency: USD + EUR, Events: GDP, CPI, Interest Rate) → add condition noEvent so the EA skips entries when those events are in scope → Step 5 risk → Save → export MQL5 → compile → backtest. For prop-firm rule context (not UI steps), see Prop Firm EA Rules.
Related guides: Advanced EA MTF & Filters · Convert Manual Strategy to EA · FTMO Challenge EA — No Code · Scalping EA
Why News Filters Matter for EAs
Manual traders often stand aside before NFP, CPI, or central-bank decisions. An EA without that habit will:
- Enter into spread spikes and slippage
- Hit stop loss on wicks that do not repeat in backtest
- Breach prop firm news rules even when the strategy is profitable in quiet hours
MetaQuotes documents calendar access in MQL5 via Calendar functions. Strategy Builder wraps that idea in Step 4 so you configure blackouts before export.
Economic Calendar Filter Parameters
When you add Economic Calendar on Step 4, set these parameters (global to the filter instance):
| Field (UI label) | Type | Options / range | Typical use |
|---|---|---|---|
| events | Multi-select | GDP, CPI, Unemployment, Interest Rate, PMI, Retail Sales | Default: GDP, CPI, Interest Rate |
| impact | Select | Low, Medium, High, Critical | High or Critical for blackout |
| timeframe | Select | 1h, 4h, 1d, 1w, 1M | 1d for daily event scope |
| currency | Multi-select | USD, EUR, GBP, JPY, CNY | Match symbol exposure (EURUSD → USD + EUR) |
| country | Multi-select | US, EU, UK, Japan, China | Align with currency |
| deviation | Number | 0 – 10 (step 0.01), default 0.1 | Surprise sensitivity for advanced conditions |
Gold (XAUUSD) tip: USD events often move gold as much as FX — include USD even on XAUUSD charts. See Gold RSI EA.
Economic Calendar Condition Types
After parameters, pick a condition type on Step 4:
1. noEvent (recommended for news blackout)
Meaning: Allow trading only when no matching event is active (your main “do not trade during news” rule).
| Field | Range |
|---|---|
| events | Same multi-select as above |
| confirmation | 1 – 10 bars (default 1) |
Use case: “No new trades while CPI/Interest Rate events are in scope for USD.”
2. hasEvent
Meaning: Trade only when specified events are present (niche — news breakout systems).
| Field | Range |
|---|---|
| events | Multi-select |
| confirmation | 1 – 10 |
3. highImpact
Meaning: Filter when impact score exceeds threshold.
| Field | Range |
|---|---|
| threshold | 0 – 1 (default 0.7) |
| confirmation | 1 – 10 |
4. lowImpact
| Field | Range |
|---|---|
| threshold | 0 – 1 (default 0.3) |
| confirmation | 1 – 10 |
5. surprise
| Field | Options |
|---|---|
| direction | positive, negative, both |
| threshold | 0 – 10 (default 0.5) |
6. consensus
| Field | Options |
|---|---|
| operator | >, <, >=, <=, =, != |
| value | -100 – 100 (default 0) |
Also in News & Sentiment group: News Sentiment filter (sentiment/source/keywords) — separate from calendar. Start with Economic Calendar for scheduled releases.
Build News Blackout Step by Step
Assume you already have a signal strategy (e.g. RSI mean reversion or MA crossover).
Step 1–3 — Strategy, timeframes, signals
Complete entry logic on Step 3 first. The news filter gates entries; it does not replace signals.
Step 4 — Add Economic Calendar
- Open Filters tab.
- Add filter → group News & Sentiment → Economic Calendar.
- Parameters:
- events: GDP, CPI, Interest Rate (add Unemployment for NFP-style coverage)
- impact: High
- timeframe: 1d
- currency: USD, EUR (extend for GBP/JPY if you trade them)
- country: US, EU
- deviation: 0.1 (default)
- Condition: noEvent
- events: same list
- confirmation: 2 (stricter than default 1)
Logic in plain English: “Only allow new entries when there is no high-impact calendar event in scope for these currencies.”
Step 5 — Risk
Keep conservative SL and risk % — news filters reduce entries but do not remove gap risk on open positions. See EA Risk Management.
Step 6 — Save and export
Save → Code Generator → .mq5 → MetaEditor F7.
Combine Session, Spread, and News
| Filter | Blocks |
|---|---|
| Market session | Quiet Asian hours if you only trade London/NY |
| Spread | Wide spread around rollovers |
| Economic Calendar noEvent | Scheduled high-impact releases |
Stack filters with AND on Step 4. Full patterns: Advanced EA MTF & Filters.
Prop / FTMO builds: Pair this article with FTMO Challenge EA Without Coding — rules live in Prop Firm EA Rules, not duplicated here.
Export, Compile, Backtest Limits
- Strategy Tester: Every tick, realistic spread, 6–12 months.
- Compare trade count with vs without news filter — entries should drop on event-heavy weeks.
- Forward test on Demo through at least one known release week.
Honest limit: Historical calendar simulation in Tester may not match broker server time or future revisions. Treat backtest as logic validation, not proof of prop compliance.
Hand-coded calendar patterns: Prop Firm EA Rules — News Filter and MQL5 CalendarValueHistory.
Next Steps
| Goal | Link |
|---|---|
| Automate full manual playbook | Convert Manual Strategy to EA |
| FTMO-style challenge EA | FTMO Challenge EA — No Code |
| Firm drawdown + news code | Prop Firm EA Rules |
| Platform overview | Build EA Without Coding |
Try it: Strategy Builder demo — add Economic Calendar noEvent to your current draft strategy today.