Skip to main content

Connection

Subscribe to a Channel

Send a JSON message to start streaming:
Server confirms:

Receive Events

Quote Ticks

Quote data is wrapped in a data field containing the upstream quote object:

Order Updates

Sent when an order is opened, modified, or closed. Order data is wrapped in a data field:

Profit Updates

Live equity and P&L, wrapped in a data field:

Heartbeat

Periodic account health snapshot with balance, equity, margin, and position count:
Subscribe to heartbeat:

New Position

Fires when a new position is opened on the account. The full order object is delivered in the data field:
Subscribe to new positions:

Alerts

Register price, spread, or P&L alerts to be notified when conditions are met. Alerts are one-shot: they fire once and are automatically removed.

Price Alert

Register a price alert to trigger when a symbol’s price crosses a threshold:
Server confirms registration:
When triggered:

Spread Alert

Register a spread alert to trigger when the spread exceeds a threshold in pips:
When triggered:

P&L Alert

Register a P&L alert to trigger when account profit crosses a threshold:
When triggered:

Cancel Alert

Cancel a previously registered alert before it triggers:

Aggregate Feed

Use subscribe_aggregate to receive aggregate events for selected stream types across every account owned by the API key. This is separate from the normal per-account subscribe message and does not include an account_id field.
Aggregate events are delivered as:
To stop aggregate delivery:

Unsubscribe

Unsubscribe from everything on an account:

Available Channels

Aggregate delivery uses subscribe_aggregate with a channels array instead of a normal channel value.

Multi-Account Streaming

Subscribe to multiple accounts on the same WebSocket:
Every message includes account_id so you can route it to the correct handler.

Error Events

Error codes: SESSION_ERROR, INVALID_MESSAGE

Keepalive

Full JavaScript Example

Full Python Example

Session Behavior

  • Sessions auto-connect when you subscribe. No need to call /connect first.
  • If the MT5 session drops, the gateway reconnects automatically and resumes streaming.
  • On WebSocket disconnect, all subscriptions for that client are cleaned up.
  • Upstream quote subscriptions are ref-counted. Multiple clients on the same symbol share one upstream feed.