Discussion of article "Library for easy and quick development of MetaTrader programs (part VIII): Order and position modification events"
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
New article Library for easy and quick development of MetaTrader programs (part VIII): Order and position modification events 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 seventh part, we added tracking StopLimit orders activation and prepared the functionality for tracking other events involving orders and positions. In this article, we will develop the class for tracking order and position modification events.
Let's compile the EA.
Set StopLoss in points and TaleProfit in points values to zero to open positions and place pending orders without stop levels. Set StopLoss for modification (points) and TakeProfit for modification (points) to 20 and 60 accordingly (the default values) — these StopLoss and TakeProfit levels are to be set by pressing the buttons.
Launch the EA in the tester and set pending orders. Then press the buttons for setting StopLoss and TakeProfit one after another. The levels are set and the appropriate entries appear in the journal. Next, enable trailing and observe the orders as they follow the price and the appropriate entries appear in the journal. Positions triggered by orders have their StopLoss levels trailed, and the appropriate entries appear in the journal.
Netting:
Hedging:
Author: Artyom Trishkin