AY.

MT5 → Pocket Option Trade Copier

Real-time trading signal relay that reads positions from MetaTrader 5 via Python, publishes to RabbitMQ, and executes mirrored trades on Pocket Option through a Node.js WebSocket consumer.

PythonNode.jsRabbitMQWebSocketsReal-time

Overview

A real-time trading automation system that mirrors positions from MetaTrader 5 to Pocket Option — enabling signal providers to broadcast trades to subscribers.

Architecture

MT5 Terminal
   └─► Python MT5 Connector
            └─► RabbitMQ (signal exchange)
                     └─► Node.js Consumer
                              └─► Pocket Option WebSocket API

How it works

  1. The Python connector connects to the MT5 terminal via the MetaTrader5 library and polls for new/closed positions on a 1-second interval.
  2. Position changes are published to a RabbitMQ exchange as typed events (POSITION_OPENED, POSITION_MODIFIED, POSITION_CLOSED).
  3. The Node.js consumer subscribes to the exchange and maps MT5 trade parameters to Pocket Option equivalents.
  4. Trades are executed via the Pocket Option WebSocket API with latency typically under 200ms.

Key Challenges

  • Handling WebSocket reconnection and session re-auth on Pocket Option's API
  • Maintaining monotonic order of events under high throughput
  • Mapping MT5 lot sizes to PO trade amounts with configurable ratios