Reconstructing Strategy-Level Portfolio Metrics from MetaTrader 5 Deal History
Summary
The article presents a standalone MetaTrader 5 dashboard for analyzing account performance across strategies without changing the trading Expert Advisors. It reconstructs closed positions from individual buy and sell deals, groups records by position identifier, and sums profit, commission, and swap to calculate net results. Strategy attribution uses magic numbers or normalized comment tokens, while current account values and floating profit or loss come from live account state.
The dashboard is designed to display portfolio metrics, an equity curve, strategy filters, and correlations between daily strategy returns. Its implementation uses a self-contained class, configurable setters, and a canvas-rendered interface with coordinate-based button handling. The stated assumptions matter: attribution depends on stable identifiers or comments, comment grouping treats separators consistently, and history retrieval uses a forward time offset. The article describes the implementation and its intended analyses, but the supplied material does not report a performance study demonstrating that dashboard metrics improve trading outcomes.
Key ideas
- The dashboard reconstructs closed positions by grouping account deals that share a position identifier.
- Net position profit includes trading profit, commission, and swap.
- Strategy attribution relies on magic numbers or normalized trade comments, so inconsistent metadata can weaken grouping.
- Daily strategy returns can be compared with a Pearson correlation matrix.
- The analyzer reads account history and current account state without modifying active trading systems.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.