How to backtest and optimize the NewWave Expert Advisor on MT5 platform. – My Trading – 27 September 2022

Hello friends!

With the arrival of the new MT5 platform, the testing and optimization process has become easier and better. Due to the fact that the platform uses the real quotes of the broker and the real values ​​​​of the spread, the quality of the tests has increased and tends to 100 percent.
It is of course up to the broker if they keep the historical data correctly.
There are these brokers that do not have some time intervals. This applies to different currency pairs.
In any case, the quality of the simulation is superior to that of the previous MT4 platform. Personally, I trust the new platform more.

What I also like about the new platform is that it can use multiple cores, computers, and cloud technologies when optimizing.
Thus, the optimization process of the expert advisor increases many times, even by tens and hundreds.
In my case, about 25-30 concurrent processes are involved in the optimization.

So. First, go to the MT5 Strategy Tester (Ctrl+R) and select a single test.

Take my New Wave Expert Advisor for example.
The link to the advisor is available at the link:

And my real signal at:
test mode

As a general rule, I first test with the following tester settings:

Test parameter.  First step.

I choose the period of testing and optimization in 1-2 years. Because history never repeats itself and good results in the past do not guarantee them in the future. Therefore, testing further shows the performance of the advisor’s own algorithm and its preliminary configuration.

Modeling that I proposed “Every tick based on real ticks” to get simulation results close to 100%.

I choose a reasonable value of the deposit based on the type of expert advisor.

For grid algorithms and different variations of Mertingale, the deposit must be at least 2000 units with a standard account type.
In my case, the EA uses an order grid, so I use values ​​of 2000 for testing.

My next step is to check the EA settings with a different value for the Delay parameter.

Backtesting - next step.
i use Delays like “Random Delay”.

Now we move on to the optimization mode of the expert advisor.
For faster and optimal optimization process, I choose this mode “Fast Genetics-Based Algorithm”.
As I said, I choose the test and optimization period in 1-2 years.
I see no reason to use a longer period. History does not repeat itself, just as world events that make serious adjustments to the currency market (in our case) do not repeat themselves.

A longer optimization period will average all values ​​more. But sometimes it’s useful too, I won’t hide.
I occasionally do setups for 5 year periods for different expert advisors and currency pairs.

Switch to optimization mode
And now which parameters do I optimize and in which ranges.

Range of optimization parameters

I usually do not include the “Time” parameter in the optimization process.
In this case, I already know that the EA shows the best results when working with two time frame values.
These are M5 and M15.

And so I split the optimization process into two. to speed up So I get sets of parameters for two different time periods.

But whoever wishes can also include this parameter in the optimization process.

This is how I decided which time periods to look at, quickly optimizing over a short period of time.

Optimization with varTF

After the EA optimization process is complete, I choose which sets I like best and run them in the backtest. Pre-write to files.

When choosing ready sets, I pay attention to benefits, benefit factor, and reduction. Therefore, the set of parameters used is not always the most cost-effective.

And finally, when I have already decided which set of parameters to use, I backtest these parameters with different values ​​of the risk parameter to find the optimal value according to my deposit and my desired risk.

That concludes my short
brief instructions on how to test and optimize my Expert Advisor.
Thank you all!

Best regards, Sergey.

Source link

Leave a Reply

Your email address will not be published. Required fields are marked *