Introduction
Hosted MT5 accounts behind an API.
Pipsocket runs your MT5 accounts on its own hosts, each in its own MT5 terminal, and gives you one API for all of them: trade, read positions and history, and get prices and fills as they happen.
How a call works
Every call is for one account:
https://api.pipsocket.com/v1/accounts/{account}/...
Authorization: Bearer $PIPSOCKET_KEYThe API checks your workspace's key, finds the host that runs the account, and hands the call to the account's terminal. Hosts don't accept connections from the internet: each keeps one connection open to Pipsocket, and calls and events travel over it.
One call, one MT5 request
A trade call is exactly one MT5 trade request (MqlTradeRequest), sent once:
- Nothing is changed. No splitting, no retries, no rounding, no picked filling mode. Fields you leave out are MT5's own empty values (0,
"",gtc). - MT5's answer, as it is. A fill and a rejection both come back as
200with MT5'sretcode. A rejection is not an HTTP error: read theretcode. - 5 seconds for the broker. If the trade server hasn't answered by then, you get
202with"state": "pending". The request is never sent again; look it up or watch for it on the stream. - Safe to retry. Send an
Idempotency-Keyand a repeat returns the first request instead of trading again.
What's here
- Quickstart: your first calls, from key to a closed position.
- Authentication: your workspace's key, and rolling it.
- Accounts and ids: account ids, tickets, request ids, and times.
- API reference: every call, its fields with their MT5 fields, and its answers.
- The WebSocket stream: fills, deals, prices and the account as they happen, and calls over the same socket.
- Errors and retcodes, the MT5 field map and rate limits.
The API reference is generated from the engine's own routes, and the whole API is also an OpenAPI document. For tools and LLMs, /llms.txt lists every page as Markdown, and /llms-full.txt is all of them in one file.