Skip to content
All library documents

Extracting HTML Tags from MetaTrader Strategy Tester Reports

Article MQL5 articles

Summary

The article describes a basic method for walking through an HTML file in MQL4 and collecting its tag structure, with the practical aim of extracting information from a MetaTrader 4 Strategy Tester report. It explains how to read a file into a string array, search across lines for opening brackets, closing brackets, and spaces, and assemble each tag from its start and end coordinates. The tag parser treats bracketed text as data and does not validate whether each item is a legitimate HTML tag.

The approach uses helper functions for file reading, text search, and rebuilding a tag that may span multiple lines. The article also recommends growing output arrays in capacity-sized batches to avoid excessive resizing. It gives implementation detail, but no benchmark or evidence that the method handles malformed HTML, nested structures, or varied encodings reliably. The described walkthrough extracts tag structure rather than interpreting report meaning, so further parsing would be needed to turn report contents into trading statistics.

Key ideas

  • The file-reading helper loads text lines into a string array and reports whether the operation succeeded.
  • The search helper locates text from a specified line and character position, returning coordinates or a not-found marker.
  • The parser finds angle brackets and spaces, then reconstructs tag text across line boundaries.
  • Growing arrays in batches can reduce the cost of repeated resizing.

Tags

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