Skip to content
All library documents

Building a Live-Refreshing HTML Dashboard for MQL5 Open Positions

Article MQL5 articles

Summary

The article presents an MQL5 Expert Advisor that reads open positions and exports their details to a self-contained HTML dashboard. On each tick, it gathers position properties such as symbol, direction, volume, entry and current prices, protective levels, floating profit, swap, and comment. It builds the entire page in memory before writing the file, so a browser refresh is less likely to encounter an incomplete document. Inline styling color-codes rows by profit status, and a JavaScript timer reloads the page at a configured interval.

The described implementation separates position snapshots, reading, HTML generation, and file writing into components. It handles accounts with no open positions and overwrites the old file with the current snapshot. The dashboard is useful as a monitoring display, but its update rate depends on incoming ticks and browser refresh settings. The article also identifies disk access, reload flicker, and limited filtering as constraints; it gives implementation examples rather than evidence that the dashboard improves trading results.

Key ideas

  • The EA reads current open-position data through MQL5 position-selection and property functions.
  • Building a complete HTML string before writing reduces the chance of displaying a partial page during refresh.
  • Inline CSS and JavaScript make the dashboard independent of external web resources.
  • The browser reload interval and the EA’s tick-driven writes jointly determine how current the display appears.
  • The design has limits including local file access, reload flicker, and restricted filtering.

Tags

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