On this page
Back to tutorials

News Filter for MT5 EA — No Code

Step 4 Economic Calendar filter: noEvent blackout, impact and currency settings, combine session/spread, export MQL5 for news-safe EAs.

📖 15 min read

📝 3,000 words

🏷️ MQL5 & Expert Advisors

Share this article:

Want to build a no-code strategy right now?

Create your free account in seconds and start building immediately.


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)TypeOptions / rangeTypical use
eventsMulti-selectGDP, CPI, Unemployment, Interest Rate, PMI, Retail SalesDefault: GDP, CPI, Interest Rate
impactSelectLow, Medium, High, CriticalHigh or Critical for blackout
timeframeSelect1h, 4h, 1d, 1w, 1M1d for daily event scope
currencyMulti-selectUSD, EUR, GBP, JPY, CNYMatch symbol exposure (EURUSD → USD + EUR)
countryMulti-selectUS, EU, UK, Japan, ChinaAlign with currency
deviationNumber0 – 10 (step 0.01), default 0.1Surprise 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:

Meaning: Allow trading only when no matching event is active (your main “do not trade during news” rule).

FieldRange
eventsSame multi-select as above
confirmation1 – 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).

FieldRange
eventsMulti-select
confirmation1 – 10

3. highImpact

Meaning: Filter when impact score exceeds threshold.

FieldRange
threshold0 – 1 (default 0.7)
confirmation1 – 10

4. lowImpact

FieldRange
threshold0 – 1 (default 0.3)
confirmation1 – 10

5. surprise

FieldOptions
directionpositive, negative, both
threshold0 – 10 (default 0.5)

6. consensus

FieldOptions
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

  1. Open Filters tab.
  2. Add filter → group News & SentimentEconomic Calendar.
  3. 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)
  4. 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

SaveCode Generator.mq5 → MetaEditor F7.


Combine Session, Spread, and News

FilterBlocks
Market sessionQuiet Asian hours if you only trade London/NY
SpreadWide spread around rollovers
Economic Calendar noEventScheduled 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

  1. Strategy Tester: Every tick, realistic spread, 6–12 months.
  2. Compare trade count with vs without news filter — entries should drop on event-heavy weeks.
  3. 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

GoalLink
Automate full manual playbookConvert Manual Strategy to EA
FTMO-style challenge EAFTMO Challenge EA — No Code
Firm drawdown + news codeProp Firm EA Rules
Platform overviewBuild EA Without Coding

Try it: Strategy Builder demo — add Economic Calendar noEvent to your current draft strategy today.

Build your no-code trading strategy now — free

Create your account and start building a complete no-code strategy right now. Add indicators, filters, and risk rules, then export MQL5 in minutes.

Frequently Asked Questions

Yes. In Strategy Builder Step 4 — Filters, add Economic Calendar (News & Sentiment group). Use the noEvent condition to block entries when selected events (GDP, CPI, Interest Rate, etc.) are active for your currencies. Export MQL5 from Code Generator.

noEvent — trade only when there is no matching calendar event in scope. Pair it with High or Critical impact and currencies such as USD and EUR for NFP/CPI-style blackouts. See condition tables in this guide.

Backtests approximate calendar logic; live news windows and broker spreads differ. Use Tester for logic checks, then Demo around real releases. Read Strategy Tester vs Live.

Prop Firm EA Rules explains firm limits and MQL5 Calendar API code patterns. This article shows how to configure the news filter in Strategy Builder before export.

Set filter parameter Impact to High or Critical, and use highImpact / lowImpact conditions with a threshold (0–1). Defaults in the UI: High impact threshold 0.7, Low 0.3.

Multi-select events: GDP, CPI, Unemployment, Interest Rate, PMI, Retail Sales. Defaults often include GDP, CPI, Interest Rate. Match the currencies you trade (e.g. USD for XAUUSD-heavy systems).

Build your no-code strategy now — free

Create Free Account