Discussing the article: "Developing a multi-currency Expert Advisor (Part 24): Adding a new strategy (II)"

 

Check out the new article: Developing a multi-currency Expert Advisor (Part 24): Adding a new strategy (II).

In this article, we will continue to connect the new strategy to the created auto optimization system. Let's look at what changes need to be made to the optimization project creation EA, as well as the second and third stage EAs.

We resume our work we started in the previous article. Let us remind you that after dividing the entire project code into the library and project parts, we decided to check how we can move on from the SimpleVolumes model trading strategy to another one. What do we need to do for this? How easy will it be? It goes without saying that it was necessary to write a class for a new trading strategy. But then some unobvious complications arose.

They were connected precisely with the desire to ensure that the library part could be independent from the project part. If we had decided to break this newly introduced rule, there would have been no difficulty. However, a way was eventually found to both preserve code separation and enable the integration of the new trading strategy. This required changes to the library files of the project, although not very large in volume, but significant in meaning.

As a result, we were able to compile and run the optimization of the first stage EA with a new strategy called SimpleCandles. The next steps were to get it working with the auto optimization conveyor. For the previous strategy, we developed the CreateProject.mq5 EA, which made it possible to create a task optimization database for execution on the conveyor. In the EA parameters, we could specify which trading instruments (symbols) and timeframes we wanted to optimize, the names of the EA stages, and other necessary information. If the optimization database did not exist before, it was created automatically.


Author: Yuriy Bykov

 

Hello @Yuriy

Thanks for the great article. What happens when your machine restarts unexpectedly? Alright it resumed the optimisation but i am getting this error and it stopped:


GBPUSD,H1: testing of Experts\Article.17328\Stage3.ex5 from 2022.09.01 00:00 to 2023.01.01 00:00 started with inputs:

idTask_=52

fileName_=article.17328.db.sqlite
=

passes_=

=

groupName_=SimpleCandles_v.1.00_2023.01.01

advFileName_=SimpleCandles-27183.test.db.sqlite

SELECT DISTINCT FIRST_VALUE(p.params) OVER (PARTITION BY p.id_task ORDER BY custom_ontester DESC) AS params FROM passes p WHERE p.id_task IN ( SELECT pt.id_task FROM tasks t JOIN jobs j ON j.id_job = t.id_job JOIN stages s ON s.id_stage = j.id_stage JOIN jobs pj ON pj.id_stage = s.id_parent_stage JOIN tasks pt ON pt.i

tester stopped because OnInit returns non-zero code 1

connection closed

Any advise

 

Hello @filippa.barbosa

I apologise for the delay in responding.

It looks like it's that elusive bug again that we thought had been fixed. When testing the code of the last article, it was no longer encountered. Unfortunately, what cannot be reproduced cannot be fixed.

The reason for this message is most likely that not a single completed passage was formed at the second stage. You can try manually restarting the second and third stages. To do this, open theoptimization database in the editor and replace the status "Done" with "Queued" in the stages table for the records ofthese stages. After that, run the Optimisation.ex5 Expert Advisor on the chart.

 
'ReadFile' - none of the overloads can be applied to the function call MTTester.mqh 1286 22
while compiling the Optimisation.mq5 and other files. pls correct it using the terminal v 5.00 build 5142
 

Hello, dave365

You need to replace this file to latest version from MultiTester library. It will be done in next part 28.

MultiTester
MultiTester
  • 2019.07.19
  • www.mql5.com
Множественные прогоны/оптимизации в Тестере.
 
Yuriy Bykov #:

Hello, dave365.

You need to replace this file to latest version from MultiTester library. It will be done in next part 28.

All comments to articles are automatically translated in each language branch.

And also there is a button "Auto-translation" if he wants to read in English here.

 
Rashid Umarov #:
Write in Russian in the Russian part.

Rashid, I fully support you! Can you solve this problem (see below) at the same time?

Forum on trading, automated trading systems and testing trading strategies.

Question to the administration of the site mql5.com

MrBrooklin, 2025.06.27 07:13 pm

Good morning everyone!

I went to the "All messages" section, and there is such a picture there:

Question for the site administration (or anyone else who is in the thread) - why do I need my posts in all world languages? Or somewhere I need to uncheck/check to keep only in Russian? It didn't happen before.

Regards, Vladimir.


 

Thanks, we'll take care of it.

We have already solved this problem, but it seems to be incomplete.

 
Rashid Umarov #:

Write in Russian in the Russian part.

Yes, of course. I'll be more careful - I thought from the last posts in the thread that the question was asked in the English thread.

 
Rashid Umarov #:

Thanks, we'll figure it out.

We have already solved this problem, but it seems to be incomplete.

Thank you!

Regards, Vladimir.

 
Rashid Umarov #:

Thanks, we'll figure it out.

We have already solved this problem, but it seems to be incomplete.

We've decided to leave it as it is.