Skip to content
All library documents

Measuring Trade Excursions to Assess Exit and Stop Placement

Article MQL5 code base

Summary

This indicator analyzes closed trades from account history by estimating each trade’s maximum favourable excursion (MFE) and maximum adverse excursion (MAE). It displays the range between the worst and best unrealized outcomes, alongside entry and exit markers, and summarizes winners’ MFE, MAE, and profit capture, losers’ MAE, trade counts, and median holding time in bars. The capture ratio compares a winner’s realized profit with the best unrealized profit it reached, helping identify profits surrendered before exit and stops triggered despite limited adverse movement.

Excursions are inferred from bar highs and lows on the chart timeframe, so price movement within each bar is unknown. The document recommends matching timeframe resolution to trade duration; single-bar trades are reported separately, and unavailable chart histories are marked as unmeasured. Positions assembled or reduced in parts are grouped by identifier and use volume-weighted average prices. A demo-account example reports 158 closed trades, 47 measurable trades, and a 74% median capture ratio. Netting accounts were not tested, and the tool measures historical trades rather than predicting future results.

Key ideas

  • MFE and MAE show each closed trade’s best unrealized gain and worst unrealized loss.
  • The capture ratio compares realized profit with a winner’s peak unrealized profit.
  • Low adverse excursion relative to a stop may indicate that the stop was placed within ordinary price fluctuation.
  • Bar high-low data cannot reveal the price path within a bar, so timeframe resolution affects measurement quality.
  • Unavailable symbol history is reported as unmeasured, and partial position changes are grouped by position identifier.

Tags

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