In the previous article, we developed a straightforward EMA-CrossOver strategy. In this section, we will create a customized settings file and conduct a backtest using MetaBacktest.
Let us begin by creating a new setting file
- Open the Terminal -> open 'Strategy Tester' (Ctrl+R).
- In the 'Expert Advisor' field, select the EA. (In this case we will select the 'EMA-CrossOver' EA).
_Defining and saving desired settings
After successfully selecting Expert Advisor:
- Click on 'Expert properties'.
- Navigate to 'Inputs' tab.
- Here you can edit Inputs and define desired settings.
_The default input settings for the Expert Advisor (EA) that we established during the development phase are illustrated in the upper image. In this configuration, a long position is initiated when EMA1 crosses above EMA2, while a short position is established when EMA1 crosses below EMA2. We propose to modify the input parameters as follows:
- EMA1Period -> 13.
- EMA2Period -> 34.
- StopLoss -> 900.
- TakeProfit -> 900.
_ Now let's upload both EA & Setting on MetaBacktest Engine
_Scroll down to select Backtest settings.
we will start by backtesting a 10-years date on EURUSD H1 chart:
- Symbol -> “EURUSD”.
- Start Date -> “08/16/2014”.
- Start Date -> “08/16/2024”.
- Period -> “H1”.
- Start.
_Let's wait for the backtesting to get finished.
Typically, the results will be available within
15 to 30 seconds. However, please note that the duration may vary significantly based on the complexity of the code structure and the intricacies of the strategy employed. In some instances, it may take several hours for the results to be generated.
_The Backtest result.
That's it, the result Is now ready. Let us proceed to review it
_View the detailed result.
EMA-CrossOver.ex4
EMA-CrossOver.mq4
setting1.set
EMA-CrossOver_Detailed-result.zip
Please Login or Signup
to be able to download the files.