Skip to main content
Version: 2.0

No.30: Avoiding of high impact calendar events

Description

You can find an example for the Expert Advisor Builder on this page. If you need to familiarize yourself with the MetaTrader strategy tester and the Expert Advisor Builder, please begin with the Getting Started article.

Many strategies yield profits only when market conditions and volatility remain relatively stable. Such strategies may operate over an extended period, generating modest but consistent positive returns. However, news events often significantly affect these types of strategies, which can cause temporary changes in volatility and market conditions. The Expert Advisor Builder, capable of formulating strategies based on news events, can also utilize this information to avoid initiating trades, for instance, before and after a high-impact event. This can shield long-term strategies from short-term volatility, ensuring steady and consistently positive results. Consider examining the following example, which illustrates the utilization of this feature.

Please note that this is not a plug-and-play trading strategy. A trading strategy needs suitable adjustments, fine-tuning to the timeframe and symbol, and thorough backward and forward testing. Therefore, providing fully working trading strategies as read-to-use examples is impossible. However, this example could serve as a foundation for your trading strategy.

Reset of inputs

Locate the Expert Advisor Builder application in the dropdown menu of the strategy tester settings under FEA Trading\MT4\Expert Advisor Builder 2.0 if you're using a MetaTrader 4 instance or FEA Trading\MT5\Expert Advisor Builder 2.0 if you're using a MetaTrader 5 instance. You can replicate the entire example in minutes by following the steps outlined in this article. To begin, kindly reset the strategy tester input as indicated.

Reset of MetaTrader strategy tester inputs.png

The default input parameters of the Expert Advisor Builder are designed to be highly functional. This implies that only some parameters must be adjusted when creating a new strategy. As a result, even with minimal reconfiguration, the output strategy can be significantly different.

Inputs configuration

Most examples can be executed in any timeframe and on any symbol. However, please set EURUSD as the symbol to be tested, M15 as the timeframe, select Open prices only (MT4) or 1 minute OHLC (MT5) as the model, and the previous four weeks as the test period. Finally, enable the visual testing mode.

Refer to the table below to set up the input parameters for the Expert Advisor Builder.

Input variable within MetaTrader
(Identifier in SET file)
Example valueUser manual chapters
> (OUF) Idea output description (max 63 characters)
(IN_strOufIdeaOutputDescription)
No.30: Avoiding of high impact calendar eventsOutput Folder
> (EVT) Signal in use
(IN_enmEvtSignalInUse)
ONEvents
> (EVT) Draw table
(IN_enmEvtDrawTable)
ON
> (EVT) Signal negation
(IN_enmEvtSignalNegation)
ON
> (EVT) Pre signal time
(IN_nEvtPreSignalTime)
18000
> (EVT) Post signal time
(IN_nEvtPostSignalTime)
18000
> (EVT) Region ALL
(IN_enmEvtRegionAll)
OFF
> (EVT) Region AUD
(IN_enmEvtRegionAud)
OFF
> (EVT) Region BRL
(IN_enmEvtRegionBrl)
OFF
> (EVT) Region CAD
(IN_enmEvtRegionCad)
OFF
> (EVT) Region CHF
(IN_enmEvtRegionChf)
OFF
> (EVT) Region GBP
(IN_enmEvtRegionGbp)
OFF
> (EVT) Region HKD
(IN_enmEvtRegionHkd)
OFF
> (EVT) Region INR
(IN_enmEvtRegionInr)
OFF
> (EVT) Region JPY
(IN_enmEvtRegionJpy)
OFF
> (EVT) Region KRW
(IN_enmEvtRegionKrw)
OFF
> (EVT) Region MXN
(IN_enmEvtRegionMxn)
OFF
> (EVT) Region NOK
(IN_enmEvtRegionNok)
OFF
> (EVT) Region NZD
(IN_enmEvtRegionNzd)
OFF
> (EVT) Region SEK
(IN_enmEvtRegionSek)
OFF
> (EVT) Region SGD
(IN_enmEvtRegionSgd)
OFF
> (EVT) Region ZAR
(IN_enmEvtRegionZar)
OFF
> (EVT) Importance undefined
(IN_enmEvtImportanceUndefined)
OFF
> (EVT) Importance low
(IN_enmEvtImportanceLow)
OFF
> (EVT) Importance moderate
(IN_enmEvtImportanceModerate)
OFF
> (INA) CONF, Signal in use
(IN_enmInaSignalInUse)
ONConfiguration
Available Indicators and Default Values
Example
> (INA) COND, Relation 1 INA1 to INA2
(IN_enmInaRelation1)
ANGLE 1 CROSS ANGLE 2
> (INA1) CONF, Signal in use
(IN_enmIna1SignalInUse)
ON
> (INA2) CONF, Signal in use
(IN_enmIna2SignalInUse)
ON

Confirm the inputs by pressing OK, and finally, start the test run with Start.

Chart example and SET file download

The underlying algorithm is highly optimized for execution speed. Generally, it only takes a few minutes until the entire test period is simulated. At the end, you will see a chart similar to the following.

Expert advisor builder example chart 0, Avoiding of high impact calendar events.png
tip

To reproduce the chart from this example, you can download and use the SET file package eab_example_30_v_2_0.set.