Yellow BoxTrading APIv1 · pre-release

User Data Streams

Event: POSITION_UPDATE

Event Description

A position was opened, changed or closed.

Event Name

POSITION_UPDATE

Response Example

JSON
{
  "e": "POSITION_UPDATE",
  "E": 1789012400000,
  "L": 100123,
  "x": "UPDATE",
  "p": 44412345,
  "s": "XAUUSD",
  "S": "BUY",
  "v": "0.10",
  "po": "2331.42",
  "pc": "2331.15",
  "sl": "2320.00",
  "tp": "2350.00",
  "up": "-2.7000",
  "sw": "0.0000",
  "ot": 1789012345000,
  "ut": 1789012400000
}
Field Type Description
e STRING "POSITION_UPDATE"
E LONG Event time, Unix ms.
L LONG Login.
x ENUM NEW (position opened), UPDATE (volume, SL/TP, price or profit changed), CLOSE (position no longer exists).
p LONG Position id.
s STRING Symbol.
S ENUM BUY or SELL.
v DECIMAL Current open volume, lots. Reduced by a partial close.
po DECIMAL Volume-weighted open price.
pc DECIMAL Current price at the time of the event.
sl DECIMAL Stop loss. "0" if none.
tp DECIMAL Take profit. "0" if none.
up DECIMAL Floating (unrealised) profit, in the account's deposit currency. Excludes swap and commission.
sw DECIMAL Swap accumulated on the position.
ot LONG Position open time, Unix ms.
ut LONG Position last-update time, Unix ms.

x: "CLOSE" means the position is gone. The matching DEAL with en: "OUT" carries the realised profit; up on the close event is not a realised figure.