Skip to content
All library documents

Analyzing MT4 Trade History by Day and Time with CSV Heat Maps

Article MQL5 code base

Summary

This document describes an MT4 script that exports account order history to a delimited file for analysis in spreadsheet software. Alongside the available trade attributes, it calculates fields such as net profit after swap and commission, price movement, points and pips, trade duration, and potential stop-loss or take-profit distances. It also assigns opening and closing day, hour, and time-slot values so a trader can group results by when trades were opened or closed.

The default time grid divides each day into 15-minute slots, with settings available to change the interval. The exported data can be used in spreadsheet pivot reports to examine a trading record by time, instrument, or other included fields. The document cautions that the export reflects the account-history filter currently in effect, and that timestamps use broker server time, which may complicate comparisons across brokers. It describes a data-analysis workflow, but provides no findings about trading performance or evidence that time-based patterns will persist.

Key ideas

  • The script exports MT4 order history and derived trade statistics for spreadsheet analysis.
  • Opening and closing times are labeled by weekday, hour, and configurable time slot.
  • The default heat-map interval is 15 minutes, producing 96 daily slots.
  • Exports reflect the account history currently available, and timestamps use broker server time.
  • Spreadsheet pivot reports can help summarize a trader’s historical results by time and other attributes.

Tags

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