Skip to content
All library documents

Gesture-Controlled MQL5 Trading for Hands-Free Order Execution

Article MQL5 articles

Summary

This article describes a hands-free trading interface intended to help traders with motor impairments operate MQL5 tools. A webcam feed is processed with MediaPipe Hands and OpenCV; recognized gestures are passed from Python to an MQL5 expert advisor through terminal global variables. The example maps pointing to a buy, thumbs-up to a sell, and a fist to closing positions. A CTrade-based class handles execution, while a busy flag and neutral gesture help prevent a held pose from repeatedly submitting orders.

The article reports demo-chart measurements from 100 trials per gesture on a specified laptop and webcam, with average detection-to-execution latency between 68 and 85 milliseconds and accuracy between 95.4% and 97.2%. These results describe one setup and do not establish live-market reliability or trading performance. The system also depends on correct gesture recognition and setup, and the close-all gesture makes accidental classification consequential. The article presents HTTP polling as a simpler alternative, while noting its higher latency.

Key ideas

  • A Python process can classify webcam gestures and pass commands to an MQL5 expert advisor through terminal global variables.
  • The example maps distinct hand poses to buy, sell, and close-all actions.
  • A busy flag and a neutral pose are used to prevent repeated execution while a gesture is held.
  • Reported latency and recognition accuracy come from demo-chart trials on one hardware setup.
  • Gesture classification errors and the chosen action mapping remain practical limits of the interface.

Tags

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