Trade Expectancy and Sample-Aware Quality Scoring in MQL5
Summary
The article presents an MQL5 dashboard that evaluates closed trading history using expectancy and a Trade Quality Score. Its motivation is that win rate alone can mislead: it ignores the relative size of wins and losses, and an identical rate carries different uncertainty when based on different numbers of trades. The tool groups individual deals by position identifier to reconstruct completed round-trip trades, then calculates counts, win and loss rates, average outcomes, expectancy, and a Wilson interval. The score uses the conservative lower edge of that interval to reflect sample uncertainty.
The script can compare full-history statistics with results filtered to a configurable hour-of-day window, and presents metrics on a chart panel and in the Experts tab. It also marks measures as undefined when required inputs are missing, rather than substituting zero. This makes the report clearer about data limitations, including unavailable pip conversions or absent wins or losses. The dashboard supports strategy comparison but does not establish that any score predicts future results; the article explicitly treats it as an aid to judgment, not a guarantee.
Key ideas
- Win rate does not capture the relative size of gains and losses or the reliability of a small sample.
- The history reader groups deals sharing a position identifier into completed trade records.
- The calculator reports expectancy and uses a Wilson interval to account for uncertainty in the win rate.
- A configurable hour-of-day filter allows session-specific metrics to be compared with full-history results.
- Undefined calculations are flagged explicitly, and the resulting score is presented as an aid rather than a prediction guarantee.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.