Skip to content
All library documents

Grouping Trading Deals into Their Positions

Article MQL5 code base

Summary

This short example explains how to reconstruct positions from a trading history on hedge accounts. Rather than treating each deal as an independent trade, it groups deals according to the position they opened, modified, or closed. The grouping uses a position identifier attached to deals executed on a symbol during the position’s lifetime. This can help make a trading history easier to interpret by connecting individual executions with the larger position they belong to.

The page gives only a brief description and a small table entry; it does not show the reconstruction algorithm, sample history, or validation results. It also does not discuss edge cases such as partial closes, simultaneous positions, or how account-specific hedge mechanics affect grouping. The material introduces a useful trade-record interpretation concept, but leaves implementation details and the reliability of the method unspecified.

Key ideas

  • Individual deals can be grouped into the positions they opened, modified, or closed.
  • A position identifier links deals associated with a position on a symbol during its lifetime.
  • The example provides no implementation details or evidence about handling edge cases.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.