Discussing the article: "Overcoming Accessibility Problems in MQL5 Trading Tools (Part III): Bidirectional Speech Communication Between a Trader and an Expert Advisor"

 

Check out the new article: Overcoming Accessibility Problems in MQL5 Trading Tools (Part III): Bidirectional Speech Communication Between a Trader and an Expert Advisor.

Build a local, bidirectional voice interface for MetaTrader 5 using MQL5 WebRequest and two Python services. The article implements offline speech recognition with Vosk, wake‑word detection, an HTTP command endpoint, and a text‑to‑speech server on localhost. You will wire an Expert Advisor that fetches commands, executes trades, and returns spoken confirmations for hands‑free operation.

Manual order entry in MetaTrader 5 is precise but painfully slow. A trader who spots a breakout must move the mouse, click a few buttons, type lot size, set stop‑loss – all while price moves. For algorithmic traders, the lack of voice integration forces them to stay glued to the screen. Existing workarounds include:

  • Third‑party macro recorders: They simulate keystrokes but cannot react to market conditions. They are brittle and non‑reproducible.
  • Cloud speech‑to‑text APIs: Google, Amazon, or Microsoft services offer high accuracy, but they require an internet connection, introduce latency, and raise privacy concerns (your trading commands leave your machine).
  • File‑based polling: A Python listener writes commands to a text file, and the EA reads it every second. This works but suffers from encoding mismatches, file lock collisions, and noticeable delay. Moreover, there is no feedback – the trader never knows if the command was understood or executed.

This article presents a lighter, self‑contained solution that runs entirely on your local machine. It uses Vosk – an offline, lightweight speech recognition engine – and a two‑way HTTP communication layer. The EA does not poll a file; it sends a WebRequest to a local Python server that holds the latest recognized command. A second Python server provides text‑to‑speech feedback using Windows' built‑in synthesizer. The result is a bidirectional voice interface: you speak, the EA trades and speaks back. No cloud, no file corruption, no guessing.

The limitations of the file‑based approach (garbled text, missed commands, no confirmation) are eliminated. Let us now design the architecture that makes this possible.


Flow diagram

Author: Clemence Benjamin