Skip to content
All library documents

Logging MT5 Trade Transaction Events for Diagnosis

Article MQL5 code base

Summary

This document describes a read-only MT5 expert advisor for tracing the lifecycle of orders, deals, and positions. It records trade-transaction events in arrival order in a local CSV file and can also write a compact entry to the Experts Journal. Logged fields include event sequence and server time, transaction type, symbol, magic number, trade tickets, order and deal details, prices, protective levels, volume, and request outcomes. When an event lacks context, the logger attempts to resolve it from related requests and available live or historical trading records.

The stated workflow is to attach the advisor to a chart, set symbol and magic-number filters, reproduce the event to investigate, then inspect the resulting file. The document says the logger does not submit trade requests or alter orders, and notes that trace files can contain comments and ticket identifiers that merit review before sharing. It describes a diagnostic tool, not a trading strategy, and provides no sample traces or evidence about coverage across all MT5 event scenarios.

Key ideas

  • The advisor records MT5 trade transaction events in arrival order for later diagnosis.
  • Its CSV can include order, deal, position, request, and server-result details.
  • It resolves missing event context from related requests and available trading records.
  • Users can filter the trace by symbol and magic number.
  • The document describes read-only logging and cautions that trace files may contain identifying details.

Tags

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