Discussion of article "Universal Expert Advisor: Trading in a Group and Managing a Portfolio of Strategies (Part 4)"

 

New article Universal Expert Advisor: Trading in a Group and Managing a Portfolio of Strategies (Part 4) has been published:

In the last part of the series of articles about the CStrategy trading engine, we will consider simultaneous operation of multiple trading algorithms, will learn to load strategies from XML files, and will present a simple panel for selecting Expert Advisors from a single executable module, and managing their trading modes.

Upon a click on any button on the panel, it defines the action to be performed and performs it. For example, if we select a strategy from the list of strategies, the index of the current strategy will be equal to the selected one, then you can perform further trading actions. For example, you can change the trading mode of the elected strategy by selecting the appropriate option from the drop-down list of the strategy modes:

Fig. 2. The list of modes of a selected strategy

Fig. 2. The list of modes of a selected strategy

Buying and selling on behalf of the selected strategy is performed the same way. A pointer to the strategy calls the Buy and Sell methods of the CStrategy base class. These methods buy and sell the volume passed in them. In this case, the magic number in the operations performed corresponds to the magic number of the strategy, so it is impossible to distinguish manual trading from the EA's actions.

Author: Vasiliy Sokolov