Discussing the article: "Developing a multi-currency Expert Advisor (Part 23): Putting in order the conveyor of automatic project optimization stages (II)"

 

Check out the new article: Developing a multi-currency Expert Advisor (Part 23): Putting in order the conveyor of automatic project optimization stages (II).

We aim to create a system for automatic periodic optimization of trading strategies used in one final EA. As the system evolves, it becomes increasingly complex, so it is necessary to look at it as a whole from time to time in order to identify bottlenecks and suboptimal solutions.

Let's start by implementing long-overdue changes to the project file structure. Currently, they are located in a single folder, which, on the one hand, simplifies the transfer and use of all the code in a new project, but on the other hand, in the process of continuous development, we end up with several almost identical working project folders for different trading strategies, each of which needs to be updated separately. Therefore, we will divide all the code into a library part, which will be the same for all projects, and a project part, which will contain code specific to different projects.

Next, we implement a check to ensure that if new strategy groups appear during the final EA's operation, it will be able to correctly load the updated parameters and continue working. Let's start, as usual, with modeling the desired behavior in an EA running in the strategy tester. If the results there are satisfactory, then it will be possible to move on to using it in final EAs that no longer work in the tester.

What do we need for this? In the previous section, we have not implemented saving information about the end dates of the optimization interval and the completion of the optimization conveyor execution in the EA database. Now we need this information, otherwise, when running the tester, the final EA will not be able to determine whether this group of strategies has already been formed on a specific simulated date or not.

The final EA will also need to be modified so that it can perform its own re-initialization when new strategy groups appear in its EA database. Currently, it simply does not have such functionality. Here, it would be useful to have at least some information about the current group of trading strategies, so that one could clearly see the successful transition from one group to another. It would be more convenient to see this information directly on the chart, on which the EA is running, but you can, of course, use the regular output to the terminal log for this purpose.

Finally, we will provide a description of the general algorithm for working with the tools developed to date.


Author: Yuriy Bykov