Discussing the article: "Developing a multi-currency Expert Advisor (Part 22): Starting the transition to hot swapping of settings"

 

Check out the new article: Developing a multi-currency Expert Advisor (Part 22): Starting the transition to hot swapping of settings.

If we are going to automate periodic optimization, we need to think about auto updates of the settings of the EAs already running on the trading account. This should also allow us to run the EA in the strategy tester and change its settings within a single run.

Let's try to describe in more detail what we want to achieve. Ideally, the system should work something like this:

  1. A project is generated with the current date as the end date of the optimization period. 
  2. The project is launched on the conveyor. Its implementation takes some time - from several days to several weeks.
  3. The results are loaded into the final EA. If the final EA has not yet traded, it is launched on a real account. If it was already working on the account, then its parameters are replaced with new ones received after the last project completed passing through the conveyor.
  4. Let's move on to point 1.

Let's consider each of these points. To implement the first point, we already have a project generation script EA from the previous part, in which we can use parameters to select the end date of the optimization. But for now it can only be launched manually. This can be fixed by adding an additional stage to the project execution conveyor that generates a new project once all other stages of the current project are completed. Then we can only run it manually the first time.

For the second point, we only need to have a terminal with the installed Optimization.ex5 EA, which has the required database specified in its parameters. As soon as new outstanding project tasks appear in it, they will be launched for execution in the order of the queue. The last stage, which comes before the stage of creating a new project, should in some form transfer the results of the project optimization to the final EA.

The third point is the most difficult. We have already implemented a single option of passing parameters to the final EA, but it still requires manual operations: you need to run a separate EA that exports the parameter library to a file, then copy this file to the project folder, and then recompile the final EA. Although we can now delegate the execution of these operations to program code, the structure itself begins to seem unnecessarily cumbersome. I would like to do something simpler and more reliable.


Author: Yuriy Bykov