Skip to content
All library documents

Logging Algorithmic and Human Trade Decisions with a CSV Journal

Article MQL5 articles

Summary

The article explains how to add a persistent CSV journal to a MetaTrader 5 Expert Advisor that combines automated signals with actions taken through a chart interface. Its central design is a reusable journal class built around the CFileTxt library. The class opens a shared text file, writes column headers when the file is new, appends records, and flushes writes to disk. Each record includes time, ticket, symbol, action, source, and profit, with source distinguishing algorithmic from human actions.

The article describes the journal as a way to attribute outcomes, review a timeline of system decisions, and move data into spreadsheet or analysis tools. It presents implementation excerpts and describes integration with an existing moving-average crossover and interactive trading system, but the supplied text omits part of that integration and gives no quantitative performance evaluation. Per-write flushing prioritizes persistence over speed, and a custom journal supplements rather than replaces platform trade history. The article also does not establish that its source labels capture every possible origin of a trade action.

Key ideas

  • A CSV journal can record whether an Expert Advisor action came from strategy logic or a human chart interaction.
  • A reusable journal class can centralize file opening, header creation, appending, and error reporting.
  • Flushing after writes aims to preserve entries if the terminal stops unexpectedly.
  • Structured records can support filtering and later analysis in external tools.
  • The journal supplements native history and does not itself validate the correctness of source attribution.

Tags

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