Discussing the article: "From Polling to Events: Building a Reactive MQL5 Trading System with Python and Redis Streams"

Check out the new article: From Polling to Events: Building a Reactive MQL5 Trading System with Python and Redis Streams.

An Expert Advisor that takes signals from an external process must know which messages were delivered, which were acknowledged, and which orders reached the broker. This article builds that confirmation protocol on Redis Streams: MQL5 publishes market events, Python suggests trades, and MQL5 alone decides what is executed. Live tests on a demo account show duplicate detection, guard refusals, and dead-lettering; crash recovery is verified with unit tests.

An Expert Advisor can poll an external service for signals, and at low volume nothing feels wrong. A timer, an HTTP request, and a list of pending actions are enough, and the code is easy to follow.

The trouble starts when the system has to survive a crash, a retry, or a broker reply that is neither a clear yes nor a clear no. Was this signal already handled? Did that order reach the broker before the restart? Should this message ever be read again?

This article follows that problem from a simple polling loop to a small prototype built on Redis Streams. MQL5 publishes market events, Python turns them into trading ideas, and the EA decides what happens next. The EA still polls on a timer. What changes is not the mechanism, but the semantics: every message gets a stable identity, an explicit acknowledgment, and a way out when it cannot be used.


Author: Stanley Kimathi Kibaara