Advertisements
$ £ ¥
¥ £ $

News Trader


Introduction

News Trader is a MetaTrader expert advisor developed to help Forex traders with news trading opportunities that arise during important macroeconomic releases. The EA can be used to trade news volatility straddle strategy. It is important to understand that News Trader is not a fully automatic solution — a trader has to set the date and time of the news release and also to decide on the appropriate stop-loss and take-profit. However, ATR-based stop-loss and take-profit setting is available too. This EA supports flexible position sizing in addition to the usual fixed position size. It is available for the following trading platforms: MT4, MT5, and cTrader.


Operation

News Trader opens one or two trades (Buy and Sell by default) some time before the news announcement (10 seconds by default). It applies stop-loss and take-profit levels according to the input parameters given by a trader. If requested by the trader, the EA continues to modify stop-loss and take-profit levels until the very release of the news to keep them relevant to the current price. When the news is out, the expert advisor will apply trailing stop according to the trader's choice. If one or both trades remain active one hour (by default) after the news, the EA closes them.


Trade example

The chart screenshot shows the EA operation during and after the US and Canadian monthly employment reports combined with the Canadian trade balance report. The news came out at 8:30 EST on December 4, 2015.

The Buy and Sell entries are shown with two arrows pointing to the right. Their stop-loss levels are marked with the red dashes above and below. The take-profit levels are the blue dashes.

The currency rate gapped up after the news, executing the Sell position's stop-loss. Unfortunately, it does not reach the take-profit of the Buy trade. The position is closed by timeout one hour after the news release (blue arrow pointing left). The profit was about three times the loss in this case, which is good but not great. Apparently, it could be bigger if a tighter take-profit was used.

Example chart showing a USD/CAD trade executed by News Trader expert advisor on nonfarm payrolls announcement.

Position sizing

News Trader expert advisor supports two position sizing modes: plain fixed position size and risk-based position size. The first mode is very simple — a trader just enters a volume in lots to be used with every position opened by the EA. The second mode enables either common fixed fractional position sizing or fixed money risk position sizing. Both use the maximum tolerated risk given as percentage or as money.


ATR-based stop-loss and take-profit

The expert advisor can use Average True Range indicator to automatically choose stop-loss and take-profit levels for a news trade base on the preceding volatility of the currency pair. ATR value is calculated based on the given period. The stop-loss and take-profit are then calculated based on separate multipliers before entering opening a position.


No backtesting

Due to the nature of the News Trader EA, there are no backtesting results for it.


Input Parameters

Trading

  • NewsTime — date and time of the news release to trade on. In cTrader, there are five separate parameters instead: year, month, day, hour, and minute.
  • StopLoss (default = 15) — the stop-loss in pips to be used when opening a trade. Ignored if UseATR = true.
  • TakeProfit (default = 75) — the take-profit in pips to be used when opening a trade. I recommend setting it to at least 5×stop-loss. Ignored if UseATR = true.
  • Direction (default = Both) — the direction of the position opened to trade the news. Can be of the following four types:
    • Buy — a buy position.
    • Sell — a sell position.
    • Both — both buy and sell positions.
    • Random — a random position.
    Notes: In MT5 (netting mode), the Both option uses pending orders because it is impossible to open two opposite positions for the same currency pair in MT5 without hedging mode. In hedging mode, MT5 version of the News Trader operates similarly to MT4. In cTrader, the direction choice is made by a trader using three separate input parameters (Buy, Sell, Randomize) as the platform does not support enumerated parameters.
  • TrailingStop (default = None) — the type of trailing stop to use with the position. Can be the following:
    • Breakeven — the stop-loss will be moved to breakeven when the profit matches stop-loss.
    • Full — classic trailing stop that moves the stop-loss up as the profit rises.
    • None — no trailing stop.
    Notes: In cTrader, the trailing stop selection is made by a trader using two separate input parameters (Trailing Stop and Breakeven Stop). If Trailing Stop is set to true, Breakeven Stop parameter is ignored.
  • PreAdjustSLTP (default = false) — if true, EA will be updating SL and TP values according to the current price after opening positions before news comes out.
  • SecondsBefore (default = 18) — the number of seconds before the news release to open the positions.
  • CloseAfterSeconds (default = 3600) — the number of seconds after the news release to close the positions. Ignored if zero.
  • SpreadFuse (default = true) — if true, the EA will not trade if the spreads widen to be greater or equal to the given stop-loss.

ATR

  • UseATR (default = false) — if true, ATR indicator determines the stop-loss and take-profit levels.
  • ATR_Period (default = 14) — the period of the ATR indicator, which is used for stop-loss and take-profit calculation. Works only if UseATR = true.
  • ATR_Multiplier_SL (default = 1) — a multiplier for the ATR indicator's value to get the stop-loss value. Works only if UseATR = true.
  • ATR_Multiplier_TP (default = 5) — a multiplier for the ATR indicator's value to get the take-profit value. Works only if UseATR = true.

Money management

  • Lots (default = 0.1) — basic lot size for fixed position sizing. Used when MM = false.
  • MM (default = true) — if true, flexible position sizing is enabled.
  • Risk (default = 1) — risk tolerance in percentage of account balance/equity. Works only if MM = true. This input parameter is ignored if UseMoneyInsteadOfPercentage is set to true.
  • FixedBalance (default = 0) — if set to non-zero value, it is used instead of account balance/equity for position size calculation. Works only if MM = true.
  • MoneyRisk (default = 0) — risk tolerance in account currency. Works only if MM = true. Requires UseMoneyInsteadOfPercentage set to true.
  • UseMoneyInsteadOfPercentage (default = false) — if true, position size is calculated based on risk amount given in account currency (MoneyRisk) instead of balance/equity percentage risk (Risk). Works only if MM = true.
  • UseEquityInsteadOfBalance (default = false) — if true, position size is calculated based on account equity instead of balance. Works only if MM = true. Ignored if UseMoneyInsteadOfPercentage = true.

Timer

  • ShowTimer (default = true) — if true, a countdown timer for the news release will be shown in the top-left corner of the chart.
  • FontSize (default = 18) — the font size to be used for the timer display. Works only if ShowTimer = true. Not present in cTrader.
  • Font (default = "Arial") — the font name to be used for the timer display. Works only if ShowTimer = true. Not present in cTrader.
  • FontColor (default = clrRed) — the font color to be used for the timer display. Works only if ShowTimer = true. Not present in cTrader.
  • Corner (default = CORNER_LEFT_UPPER) — the screen corner to display the timer. Works only if ShowTimer = true.
  • X_Distance (default = 10) — the horizontal distance from the screen's corner to the timer's top-left corner. Works only if ShowTimer = true. Not present in cTrader.
  • Y_Distance (default = 130) — the vertical distance from the screen's corner to the timer's top-left corner. Works only if ShowTimer = true. Not present in cTrader.

Miscellaneous

  • Slippage (default = 10) — the acceptable price slippage in pips.
  • Magic (default = 794823491) — the magic number for orders to filter positions opened by this EA. Not present in cTrader.
  • Commentary (default = "NewsTrader") — the commentary for positions opened by this EA.
  • IgnoreECNMode (default = true) — if true, the EA will issue market orders with SL/TP even in the account's trade execution mode is of the market type.

MiniFAQ

Which news are worth trading?

Any big news are good for this EA: interest rate decisions, central bank minutes releases, CPI, GDP, trade balance, employment reports, etc. The more important the news the better the chance to hit take-profit.

What stop-loss and take-profit should I set?

I recommend setting 10 standard pips stop-loss and 50 pips take-profit on such news as GDP, CPI, or retail sales. 15-20 pips stop-loss and 75-100 pips take-profit on such news as FOMC rate decision, FOMC minutes, or NFP.

What currency pairs are good for News Trader?

It can work with all trading instruments, but I recommend using it with very liquid currency pairs only: EUR/USD, GBP/USD, USD/CAD, NZD/USD, etc. Slippage and spread widening on exotic currency pairs may result in premature stop-loss execution.

What is the difference between the versions for MT4 and for MT5?

MT5 version (netting mode) cannot open both Buy and Sell positions on the same currency pair. Instead, it will open pending orders that will mimic those positions. Unfortunately, it increases exposure to market volatility — use MT5 version only with brokers you know for good execution and not for abnormal spread widening. Alternatively, use a hedging MT5 account.

Why is my actual loss bigger than the risk I set via input parameters when MM = true?

There are three possibilities:

  • The EA will adjust stop-loss during the period between position opening and news release if PreAdjustSLTP = true. It may result in a bigger stop-loss with the same position size, resulting in a higher potential loss.
  • When using two positions (both Buy and Sell), there is a small risk of both hitting stop-loss. In this case, you may experience a loss twice your original intended risk size.
  • Price gap after the news may result in your stop-loss executing at a worse price, adding extra loss to the bottom line.

This EA is ECN-compatible. If you are trading with an ECN broker (with market execution for orders), you cannot set SL/TP on position opening. You have to open a position first without SL/TP and only then modify it, adding stop-loss and/or take-profit level. This EA will do it automatically.


Download (ver. 1.11, 2024-01-19)

MetaTrader 4

News Trader in .zip News Trader in .mq4

MetaTrader 5

News Trader in .zip News Trader in .mq5

cTrader

News Trader in .zip News Trader in .cs


Discussion

 

Warning! Before you ask basic questions regarding installation of the expert advisors, please read this MT4 Expert Advisors Tutorial to get the elementary knowledge on handling them.

Do you have your own trading results or any other remarks regarding this expert advisor?

Discuss News Trader with other traders and MQL programmers on the experts forums.


Changelog

1.11 — 2024-01-19

  • Fixed potential problems with setting SL and TP on a position.
  • Fixed multiple positions sometimes being opened by the EA (MT5 only).
  • Removed the message that printed minimum position size and lot step from normal operation. It will now only be printed if there is some problem.

1.10 — 2022-07-09

  • Minor improvements of position size calculation.

1.09 — 2022-04-27

  • Added input parameters for Timer positioning.
  • Updated the cTrader version of the expert advisor.
  • Clarified some error messages and input parameter descriptions.

1.08 — 2020-12-13

  • Fixed position size calculation for pending orders when the currency pair's base currency is the same as the account currency (MT5 version only).

1.07 — 2020-11-19

  • Position size calculation update.

1.06 — 2020-06-24

  • Further improvements for unit cost calculation in MT4.

1.05 — 2020-05-30

  • Fixed a bug in MT5 version that caused incorrect pip value calculation in some cases.

1.04 — 2020-05-16

  • Improved accuracy of position size calculation.

1.03 — 2019-03-12

  • Optimized order opening and modification functions to avoid using outdated prices as much as possible.
  • Increased default time before news to open trades.
  • Added better logging of server's trade availability.

1.02 — 2017-09-27

  • Added hedging mode compatibility in MT5 version.
  • Fixed minor errors and problems.

1.01 — 2017-09-18

  • Initial public release of the expert advisor.