Category: MQL4 – The Basic Strategy

Basic Strategy – Adjustment3 – Calendar

The following EA has been adjusted to incorporate the forex factory calendar.   It has the following key properties: When importing the calendar, it is possible to offset the time by a certain number of hours to ensure that the Forex Factory calendar matches the time of the Broker Server. It is possible to specify

Basic Strategy – Adjustment2 – Trading Day

In the following post, it became clear that the Broker spreads increase dramatically during certain periods of the day and that it is not advisable to trade during these periods: Record Spread, Stop and Freeze Levels It can also be dangerous to leave trades open during the weekend because an important news event may occur

Basic Strategy – Adjustment 1 – Optimiser

The following image shows a typical result from using the Strategy Optimiser: After a while, I found this report quite limiting.   It only shows successful strategies that have a positive P&L and it doesn’t show how the EA has performed within different sections of the time period.   For example, a strategy that is

The Basic Strategy

I wanted to create a very basic strategy as a reference point and explore its behaviour using MetaTrader.   The MQL code for this strategy is listed in the table below.   This strategy basically buys after an up candle and sells after a down candle, however some of the additional key characteristics are listed