Discussion of article "MQL5 Wizard: Placing Orders, Stop-Losses and Take Profits on Calculated Prices. Standard Library Extension"

 

New article MQL5 Wizard: Placing Orders, Stop-Losses and Take Profits on Calculated Prices. Standard Library Extension has been published:

This article describes the MQL5 Standard Library extension, which allows to create Expert Advisors, place orders, Stop Losses and Take Profits using the MQL5 Wizard by the prices received from included modules. This approach does not apply any additional restrictions on the number of modules and does not cause conflicts in their joint work.

The practical purpose of this article is adding to generated Experts a capability to place orders, Stop Losses and Take Profits at required price levels, not only at the specified distance from the current price.

Similar idea was discussed in the article "MQL5 Wizard: How to Teach an EA to Open Pending Orders at Any Price". The significant drawback of the suggested solution is the "forced" change of the parameter of the trading signal module from the subordinate filter. This approach does not abet working with a lot of modules and using the Wizard for process optimization makes no sense.

Implementation of placing orders as well as Stop Losses and Take Profits at any prices in classes inherited from the standard ones is considered in detail further down. That said, any conflicts between modules are impossible. I hope that this article serves an example and inspires readers for writing own improvements of the standard framework and also allows users to implement the developed Library extension.


Fig. 2. Modified pattern of decision making on entering the market

Fig. 2. Modified pattern of decision making on entering the market

Author: Andrey Shpilev

 

Hi, thank you for your code and perspective on employing a different logic to the CSignal class. What would the opposite for this be?

   double direction=Direction();
//--- prohibitive signal
   if(direction==EMPTY_VALUE)
      return(false);


To allow signals to be taken on each opportunity regardless of running positions?

Reason: