NewsGuard Economic News Guard for Positions MT5

  • Utilities
  • Ibrahim Yahya
    Ibrahim Yahya
    • MQL5 & Python developer: EAs, trade copiers, MT5 automation at  Self-employed
    • Palestine
    • 219
    I build MetaTrader 5 tools that follow your rules exactly: Expert Advisors, trade managers and trade copiers that size every trade from your risk and manage it to the end, unattended on a VPS.
    What I have built and run:
  • Version: 1.0
  • Activations: 5

NewsGuard protects your open positions from news spikes. You attach it to one chart, and it reads the economic calendar built into MetaTrader 5. When an important event for your currencies is close, it looks after the positions you choose: it warns you, secures them with a break-even stop, or closes them. It does not open trades and it does not generate signals.

What it does

  • Guards positions around news. Inside a window (by default 15 minutes before to 15 minutes after the event) it applies the action you chose to your positions.
  • Three actions. 1 = warn only: a pop-up alert, an optional push notification, the panel turns red, and a position opened inside the window is reported once. 2 = secure: the stop moves to break-even (entry +/- InpBEPoints) for positions that are in profit by more than that; other positions are left alone. 3 = close every position in the filter.
  • Built-in calendar. No web requests and no DLLs. Importance: high only, or high and medium. Currencies: by default the base and profit currency of the chart symbol (gold and silver also get USD), or your own list. The event list is refreshed every 5 minutes and looks 48 hours ahead by default.
  • You choose the positions. Every position, manual trades only, or one EA's magic number. Every symbol, or only the chart's symbol.
  • Panel. Status, next or current event, currency, impact, server and UTC time, countdown, the active rules, the last action and the calendar status.
  • Notifications. Pop-up alert at the start of a window and an optional push message to the MetaTrader mobile app.

Honest limits

  • NewsGuard cannot stop another EA, or you, from opening a trade inside the window. With action 3 it closes such a position at the next tick (live: one pass per second). The position can exist for a moment and the spread is paid. Action 1 only reports it.
  • The calendar is the broker's built-in MT5 calendar, in broker server time. The panel shows both server and UTC time and the calendar status.
  • Break-even needs room: the new stop must be at least the broker's minimum distance away from the price, otherwise the position is retried on the next pass.
  • If an event is re-timed after its window has started, it is not re-planned until the next refresh.
  • Stops and closes are market operations. There is no guarantee against slippage, gaps or price spikes: the price can pass a stop before it is moved or filled.
  • It works only while the terminal and the EA are running. A VPS keeps them running.

How to use it

  1. Attach NewsGuard to one chart (any symbol, any timeframe). Attach it once: one copy guards all the positions you select.
  2. Allow Algo Trading in the terminal and in the EA's settings.
  3. Choose the importance, the window (minutes before and after) and the action: 1, 2 or 3. The default is 1, warn only, so you can watch it first.
  4. Choose which positions it guards (all, manual only, or one magic number).
  5. Keep the terminal running. For push messages, enter your MetaQuotes ID in Tools > Options > Notifications and set InpPush to true.

In the Strategy Tester there is no economic calendar. With the default inputs (InpTestEvent empty), NewsGuard places a demo event every weekday at 12:00 server time and opens minimum-lot demo BUY and SELL trades around it, so that you can see the guard at work in visual mode. If the action input is 1, it is forced to 3 (close) in the tester, so that the effect is visible. This happens only in the tester. On a live or demo account NewsGuard never opens a trade of its own. In the tester you can also set your own event with InpTestEvent. On a live chart InpTestEvent gives a preview that only warns and never trades.

Inputs

InputDefaultWhat it does
InpImportanceHigh onlyHigh only, or high and medium
InpCurrencies(empty)Currencies, e.g. USD,EUR. Empty = the chart symbol's currencies (gold and silver also USD)
InpLookAheadHours48How many hours ahead events are listed
InpMinBefore15The window starts this many minutes before the event
InpMinAfter15The window ends this many minutes after the event
InpAction1 (warn)1 = warn only, 2 = break-even, 3 = close all
InpBEPoints10Action 2: the stop goes to entry +/- this many points
InpSymbolsALLALL symbols, or only the chart's symbol
InpMagic-1-1 all positions, 0 manual trades only, N one EA
InpAlerttruePop-up alert at the start of a window
InpPushfalsePush notification to the mobile app (needs the MetaQuotes ID)
InpUtcOffset99Server UTC offset in hours for the panel, 99 = auto detect
InpDarkChartfalseRecolour this chart dark
InpShotfalseSave a screenshot to MQL5\Files 6 seconds after start
InpTestEvent(empty)Tester: fake event as YYYY.MM.DD HH:MM (server time) or +N minutes. Live chart: preview, warn only
InpTestTradesfalseTester only: demo trades around the fake event

FAQ

Does NewsGuard open trades or give signals?
No. It only watches and manages positions that you or another EA opened. The only trades it opens are the demo trades in the Strategy Tester.

Can it prevent a trade from being opened during news?
No. It cannot block another EA or you. With action 3 it closes such a position at the next tick or second, and the spread is paid. With action 1 it only reports it.

Does it protect me from slippage and gaps?
No. It reduces the time your positions stay exposed, but stops and closes are executed at market. A spike can pass a stop, and nothing here is a guarantee or a promise of results.

Which time zone does the calendar use?
The broker's server time. The panel shows the event in server time and in UTC, and the detected server offset.

Does it work with other Expert Advisors?
Yes. Use the magic filter: -1 for all positions, 0 for manual trades only, or one EA's magic number.

Why was break-even not applied?
Break-even is applied only when the position is in profit by more than InpBEPoints, and the new stop must be at least the broker's minimum distance from the price. Otherwise the position is left alone or retried on the next pass.

More from author
LadderGuard is a trade manager and account guard for MetaTrader 5. You attach it to one chart, and it looks after the positions you already have, whether you opened them by hand or another Expert Advisor did. It does not open trades and it does not generate signals. It takes partial profits at the targets, moves the stop to break-even, then moves it up level by level. It also watches the whole account and locks trading when a daily loss or drawdown limit is hit. What it does Trade manager You ch
RiskPanel is a risk-based lot calculator and one-click trade panel for MetaTrader 5, built around one rule: never risk more than you chose . You pick the risk (a percentage of your account or a fixed amount of money) and the stop. RiskPanel sizes the lot so that, if the stop is hit, the loss is at most the amount you chose, rounded DOWN to the broker's volume step, and shows it on the chart before you click. Then BUY or SELL opens the trade with that stop and an optional take profit. It does not
GoldSessions is a chart indicator for MetaTrader 5. For every day it draws one box per trading session: Asian, London and New York. The top edge of a box is the session high, the bottom edge is the session low, and optional labels show both prices. You see where each session ended and how wide it was, so you do not walk into a thin or volatile session hand-over blindly. It is a read-only chart tool: it never opens, modifies or closes a trade, uses no DLLs and makes no web requests, so it cannot
Filter:
No reviews
Reply to review