Reconstruction of positions — an example of working with a trading history on Hedge accounts.
An example of the final output:
As can be seen, deals taken from the trading history are grouped into positions to which they relate. Grouping by parameter
The ID of the position, which the deal opened, modified or closed. Each position has a unique ID that is assigned to all deals executed on the symbol during the position lifetime.
Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/17261
The EA places pending stop orders BUY_STOP and SELL_STOP.Autotrade
The Expert Advisor places two pending orders (BuyStop and SellStop) with the specified expiration.