Discussion of article "Library for easy and quick development of MetaTrader programs (part X): Compatibility with MQL4 - Events of opening a position and activating pending orders"

 

New article Library for easy and quick development of MetaTrader programs (part X): Compatibility with MQL4 - Events of opening a position and activating pending orders has been published:

In the previous articles, we started creating a large cross-platform library simplifying the development of programs for MetaTrader 5 and MetaTrader 4 platforms. In the ninth part, we started improving the library classes for working with MQL4. Here we will continue improving the library to ensure its full compatibility with MQL4.

Testing

Let's check the applied changes. Compile the TestDoEasyPart10.mq4, launch it in the tester, open and close positions, place pending orders, wait till one of them is activated and check if stop levels and trailing are activated (modifying positions and pending orders). All events the library "sees" for MQL4 are to be displayed in the tester journal:


If we carefully observe the tester journal, we can see that the library still cannot see closing positions. When the BuyLimit #3 pending order is triggered, the journal entry informs that the [BuyLimit #3] is activated leading to the Buy #3 position. Now the library sees the events of pending order activation and knows a source order a position originated from. Besides, we can see a slight omission in the modification function — the label of the BuyStop #1 pending order modified by trailing becomes red. But the library sees all order and position modification events.

Author: Artyom Trishkin

Reason: