Discussing the article: "Distributed Tracing for Expert Advisors: A Native OpenTelemetry (OTLP) Exporter in MQL5"

Check out the new article: Distributed Tracing for Expert Advisors: A Native OpenTelemetry (OTLP) Exporter in MQL5.

This article builds a four-layer MQL5 tracer that works without gRPC or protobufs: OTLP/HTTP JSON via WebRequest, SHA-256–backed ID generation, a nanosecond-formatted clock, and a ratio sampler. Finished spans go to a bounded queue and flush in batches with exponential backoff. A W3C traceparent header links the EA's spans to a Python service for end-to-end visibility.

Most MQL5 monitoring stops at logs and the Strategy Tester report. That is fine for a single Expert Advisor sitting on one chart, but the moment a signal depends on something outside the terminal — a Python model, a risk service, a data feed — a log file on its own cannot show you where the time was spent or why a decision was made. You end up correlating timestamps by hand between two or three log files, which gets old fast once anything goes wrong at 3 a.m. on a live account.

This article builds a native OpenTelemetry (OTLP) tracer for MQL5: a clock, identifier generation, and an exporter. It then wires the tracer into an EMA-cross Expert Advisor that calls a small Python scoring service. Each bar cycle becomes a distributed trace. The EA's decision steps and the Python service's processing share the same trace ID, so Jaeger renders them as a single timeline.

Author: Adesewa Tolulope Gbadebo