Multi instrument robot - page 2

 

Forum on trading, automated trading systems and testing trading strategies

How to Start with Metatrader 5

Sergey Golubev, 2024.08.24 11:27

Developing a multi-currency Expert Advisor (Part 7): Selecting a group based on forward period

In the previous articles, I have been optimizing individual instances of trading strategies on the same time period - from 2018 to 2022. This is a fairly long period, which surely includes various events affecting the price dynamics. On the other hand, it is not too large and the time of one run remains small enough — within a few tens of seconds. The selected period is arranged so that there is still more than a year left until the current moment in time. This makes it possible to see how the strategy instances will behave in the section of history that was not used when optimizing their parameters.

 

Forum on trading, automated trading systems and testing trading strategies

How to Start with Metatrader 5

Sergey Golubev, 2024.08.31 09:20

Developing a multi-currency Expert Advisor (Part 8): Load testing and handling a new bar

In the first article, we have developed an EA featuring two instances of trading strategies. In the second one, we have already used nine instances, while in the last one this number jumped to 32. There were no problems with testing time. It is clear that the shorter the time of a single test pass, the better. But if the overall optimization takes about a few hours, this is still better than several days or weeks. Likewise, if we have combined several strategy instances in one EA and want to see its results, then a single pass should be completed in seconds or minutes, not hours or days.

Let's try to find out how the time of a single pass in the tester depends on the number of instances of trading strategies for testing periods of different durations. Let's also look at the memory consumed. Of course, we need to see how EAs behave with different numbers of trading strategy instances when launched on the terminal chart.


 

Forum on trading, automated trading systems and testing trading strategies

How to Start with Metatrader 5

Sergey Golubev, 2024.09.07 14:21

Developing a multi-currency Expert Advisor (Part 9): Collecting optimization results for single trading strategy instances

Developing a multi-currency Expert Advisor (Part 9): Collecting optimization results for single trading strategy instances

We have already implemented a lot of interesting things in the previous articles. We have a trading strategy or several trading strategies that we can implement in the EA. Besides, we have developed a structure for connecting many instances of trading strategies in a single EA, added tools for managing the maximum allowable drawdown, looked at possible ways of automated selection of sets of strategy parameters for their best work in a group, learned how to assemble an EA from groups of strategy instances and even from groups of different groups of strategy instances. But the value of the results already obtained will greatly increase if we manage to combine them together.

Let's try to outline a general structure within the article framework: single trading strategies are fed into the input, while the output is a ready-made EA, which uses selected and grouped copies of the original trading strategies that provide the best trading results.


 

Forum on trading, automated trading systems and testing trading strategies

How to Start with Metatrader 5

Sergey Golubev, 2024.09.14 12:37

Developing a multi-currency Expert Advisor (Part 10): Creating objects from a string

Developing a multi-currency Expert Advisor (Part 10): Creating objects from a string

In the previous article, I have outlined a general plan for developing the EA, which includes several stages. Each stage generates a certain amount of information to be used in the stages that follow. I decided to save this information in a database and created a table in it, in which we can place the results of single passes of the strategy tester for various EAs.

In order to be able to use this information in the next steps, we need to have some way of creating the necessary objects (trading strategies, their groups and EAs) from the information stored in the database. There is no option to save objects directly to the database. The best thing that can be suggested is to convert all the properties of objects into a string, save it in the database, then read this string from the database and create the required object from it.


 

Forum on trading, automated trading systems and testing trading strategies

How to Start with Metatrader 5

Sergey Golubev, 2024.10.03 08:51

Developing a multi-currency Expert Advisor (Part 11): Automating the optimization (first steps)

Developing a multi-currency Expert Advisor (Part 11): Automating the optimization (first steps)

In the previous article, we have laid the foundation for easy usage of the results obtained from optimization to build a ready-made EA with multiple instances of trading strategies working together. Now we do not have to manually enter the parameters of all used instances in the code or in the EA inputs. We only need to save the initialization string in a certain format to a file, or insert it as text into the source code so that the EA can use it.

So far, the initialization string has been generated manually. Now, finally, the time has come to start implementing the automatic formation of the EA initialization string based on the obtained optimization results. Most probably, we will not have a fully automated solution within the scope of this article, but at least we are going to make significant progress in the intended direction.


 

Forum on trading, automated trading systems and testing trading strategies

Buying or Selling all 7 pairs

Sergey Golubev, 2024.10.14 16:05

Developing a multi-currency Expert Advisor (Part 12): Developing prop trading level risk manager

Developing a multi-currency Expert Advisor (Part 12): Developing prop trading level risk manager

Throughout the entire series, we addressed the topic of risk control several times. The concepts of a normalized trading strategy were introduced, the parameters of which ensure that a drawdown level of 10% is achieved during the test period. However, normalizing trading strategy instances, as well as groups of trading strategies, in this way can only provide a given drawdown over a historical period. We cannot be sure that the specified drawdown level will be observed when starting a test of a normalized group of strategies on the forward period, or launching it on a trading account.

Recently, the topic of risk management was considered in the articles Risk manager for manual trading and Risk manager for algorithmic trading. In these articles, the author proposed a programmatic implementation that controls the compliance of various trading parameters with pre-set indicators. For example, if the set loss level for a day, week or month is exceeded, trading is suspended.


 

Forum on trading, automated trading systems and testing trading strategies

Buying or Selling all 7 pairs

Sergey Golubev, 2024.11.16 07:31

Developing a multi-currency Expert Advisor (Part 13): Automating the second stage — selection into groups

Developing a multi-currency Expert Advisor (Part 13): Automating the second stage — selection into groups

Having been distracted a bit by the risk manager in the last article, let's get back to the main topic test automation. In one of the previous articles, we outlined several stages that should be completed while optimizing and searching for the best parameters of the final EA. We have already implemented the first stage, at which we optimized the parameters of a single trading strategy instance. Its results were saved in the database.

The next stage is a selection of good groups of single instances of trading strategies that, when working together, will improve trading parameters reduce drawdown, increase the linearity of the balance curve growth, and so on. We already looked at how to carry out this stage manually in the sixth part of the series.


 

Forum on trading, automated trading systems and testing trading strategies

Buying or Selling all 7 pairs

Sergey Golubev, 2025.01.11 11:57

Developing a multi-currency Expert Advisor (Part 14): Adaptive volume change in risk manager

Developing a multi-currency Expert Advisor (Part 14): Adaptive volume change in risk manager

In one of the previous articles of the series, I touched on the topic of risk control and developed a risk manager class that implements basic functionality. It allows setting a maximum daily loss level and a maximum overall loss level, upon reaching which trading stops and all open positions are closed. If a daily loss was reached, trading was resumed the next day, and if an overall loss was reached, it was not resumed at all.

 

Forum on trading, automated trading systems and testing trading strategies

Buying or Selling all 7 pairs

Sergey Golubev, 2025.01.17 07:15

Developing a multi-currency Expert Advisor (Part 15): Preparing EA for real trading

Developing a multi-currency Expert Advisor (Part 15): Preparing EA for real trading

We have already achieved certain results in the previous articles, but there is still much to do. The end result we would like to see is a multi-currency EA that can be set to work on a real account or several real accounts with different brokers. So far, our efforts have been focused on achieving good trading results during testing, since without this it is impossible to achieve good trading with a developed EA on a real account. Now that we have more or less decent test results, we can look a little towards ensuring correct operation on a real account.

 

Forum on trading, automated trading systems and testing trading strategies

Buying or Selling all 7 pairs

Sergey Golubev, 2025.01.31 18:16

Developing a multi-currency Expert Advisor (Part 16): Impact of different quote histories on test results

Developing a multi-currency Expert Advisor (Part 16): Impact of different quote histories on test results

In the previous article, we started preparing the multi-currency EA for trading on a real account. As part of the preparation process, we added support for different names of trading instruments, automatic completion of trading when you want to change the settings of trading strategies, and correct resumption of the EA after restarting for various reasons.