Skip to content
All library documents

Visualizing Recent Trade History During MetaTrader 4 Backtests

Article MQL5 articles

Summary

This article explains how to add an Account History view to MetaTrader 4’s strategy tester visualization. It uses information already available in the tester’s results rather than building a separate copy of the terminal account history. An indicator provides the chart subwindow, while an included helper file updates the displayed trade history as the Expert Advisor runs.

The view prioritizes recent events because the display is limited, with the newest closed positions shown at the top. Configurable settings control the number of visible rows, text size, highlighting near order prices and stop levels, colors, and whether canceled or expired orders appear. The article illustrates positions moving from the terminal view into account history and highlights closures by stop loss or take profit. It also notes a possible subwindow-number issue in tester templates and gives a way to specify the expected window. This is a testing and inspection aid, not a trading strategy or performance evaluation; it relies on the tester’s results and does not establish that an Expert Advisor is profitable.

Key ideas

  • The tester’s results contain enough trade information to build a compact account history display without duplicating the terminal history.
  • An indicator in a tester chart subwindow can show recent closed trades alongside the terminal view.
  • Inputs control visible rows, order status filters, colors, text size, and proximity highlighting.
  • The newest closed positions appear first, making recent tester events easier to inspect.
  • The indicator may need an explicitly assigned subwindow number to work with some templates.

Tags

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