A command is a JSON object. It always names your license and the action to run, plus the fields that action needs.
Simple version
Send a JSON message with license (your key), action (what to do, such as long or closeAll) and the fields of that action, for example symbol and volume. Names are case-sensitive and volume is in lots. The reply HTTP 200 means the command is queued for your EA, not that it ran. Anything the webhook can check up front, such as a missing field, is refused with HTTP 422 and a readable message.
{ "license": "YOUR_LICENSE_KEY", "action": "long", "symbol": "EURUSD", "volume": 0.01}Advanced version
| Field | Unit |
|---|---|
volume |
Lots. The EA rounds it to the symbol’s lot step and keeps it between the symbol’s minimum and maximum. |
sl, tp on long and short |
Price levels by default. If the EA input Stop level mode is pips or ticks, they are distances from the entry price. 0 means none. |
sl, tp on moveStops |
Always price levels, whatever the Stop level mode says. |
offset, trailDistance |
Pips. The EA counts a pip as 10 times the symbol’s point, for every symbol. |
percentage |
Percent of the position, above 0 and up to 100. |
Number fields also accept numeric text such as "0.01". positionID must be text.
Finding a position
Section titled “Finding a position”Commands that act on an open position find it by positionID, the label you gave it when you opened it (it becomes the MT5 order comment), or by ticket. If an open command carries no positionID, the server adds one (CMD followed by a number). A positionID that is all digits and matches no comment is also compared with the ticket. Use short, unique labels, because some commands act on every position that matches.
Checks before queuing
Section titled “Checks before queuing”The webhook checks the license, then the command. It refuses an unknown action, an unknown or missing field, a wrong type and an out-of-range value with HTTP 422, and nothing is queued. Names and actions are case-sensitive: Long is not long. The reply for a valid command is HTTP 200 with "status": "received". What happens next is in how delivery works.
Expiry and limits
Section titled “Expiry and limits”- A command that the EA does not collect within 5 minutes expires and is never run late.
- Each license can send 120 messages per minute. Beyond that the webhook answers HTTP 429.
- The EA can refuse a command for its own reasons, such as a position limit or a tripped safeguard. The reason appears in the MT5 Experts log.
The commands
Section titled “The commands”Each command has its own page with fields, examples and errors, and the cheat sheet lists them on one page.
Open positions
Close positions
close_percentage: Close a percentage of one position.closeAll: Close every open position (long and short), on all symbols.closeByID: Close the position (or positions) with a given positionID.closeByLotSize: Close a given number of lots of one position.closeLong: Close every open buy (long) position, on all symbols.closeShort: Close every open sell (short) position, on all symbols.closeSymbol: Close the open positions on one symbol, long, short or both.
Change stops and trailing
moveStops: Change the stop loss and/or take profit of one position.moveStopsBreakeven: Move the stop loss of one position to its entry price, with an optional offset.setTrailingStop: Attach a trailing stop to one position.
Accepted, not documented yet
The EA also runs the commands below. They have no reference page yet, so the webhook checks only that the action name is known and does not check their fields.
hedge, placePendingOrder, cancelPendingOrder, conditionalOrder, cancelConditionalOrder, batch, setEAStatus, getEAStatus, setSafeguardConfig, resetSafeguard, getAccountInfo, getPositions, getStats
Related tasks
Section titled “Related tasks”Verified for EA v1.9 · dashboard 2026-10-05 · reviewed by Claude Code (owner review pending)
Trading involves substantial risk of loss. ZB Connector is software only; it does not provide investment advice, signals or brokerage services.