Trade

Notification (Trade)

WSPush · cmd 18

Order/execution push on the private topic. The Notification wrapper carries a JSON payload (event order_changed_lb; grid orders use gridtrading_order).

message Notification {
  string topic = 1;
  ContentType content_type = 2;
  DispatchType dispatch_type = 3;
  bytes data = 4;
}

enum ContentType { CONTENT_UNDEFINED = 0; CONTENT_JSON = 1; CONTENT_PROTO = 2; }

Push fields

NameTypeRequiredDescription
topicstringOptionalTopic
content_typeint32OptionalContent type (JSON/PROTO)
dispatch_typeint32OptionalDispatch type
databytesOptionalPayload data (order-changed)
└ sidestringOptionalOrder side (Buy/Sell)
└ stock_namestringOptionalStock name
└ submitted_quantitystringOptionalSubmitted quantity
└ symbolstringOptionalOrder symbol
└ order_typestringOptionalOrder type
└ submitted_pricestringOptionalSubmitted price
└ executed_quantitystringOptionalExecuted quantity
└ executed_pricestringOptionalExecuted price
└ order_idstringOptionalOrder id
└ currencystringOptionalCurrency
└ statusstringOptionalOrder status
└ submitted_atstringOptionalSubmitted time (timestamp, second)
└ updated_atstringOptionalLast updated time
└ trigger_pricestringOptionalLIT / MIT order trigger price
└ msgstringOptionalRejected message or remark
└ tagstringOptionalOrder tag (Normal/GTC/Grey)
└ trigger_statusstringOptionalConditional order trigger status
└ trigger_atstringOptionalConditional order trigger time (timestamp, second)
└ trailing_amountstringOptionalTSLPAMT order trailing amount
└ trailing_percentstringOptionalTSLPPCT order trailing percent
└ limit_offsetstringOptionalTSLPAMT / TSLPPCT order limit offset amount
└ account_nostringOptionalAccount no
└ remarkstringOptionalRemark message
└ last_sharestringOptionalLast share
└ last_pricestringOptionalLast price
└ multi_legobjectOptionalMulti-leg strategy information, only pushed for multi-leg option combination orders
 └ strategystringOptionalMulti-leg strategy
 └ strategy_namestringOptionalStrategy name
 └ multileg_idstringOptionalMulti-leg combination ID
 └ codestringOptionalMulti-leg combination code
 └ legsobject[]OptionalLegs of the combination order
  └ symbolstringOptionalOption symbol, use ticker.region format
  └ sidestringOptionalOrder side (Buy/Sell)
  └ positionstringOptionalPosition direction (LONG/SHORT)
  └ ratio_quantitystringOptionalLeg ratio quantity
  └ strike_pricestringOptionalStrike price
  └ expire_datestringOptionalOption expiry date, format YYYYMMDD
  └ contract_directionstringOptionalContract type (C=Call/P=Put)

Response JSON example

{
  "event": "order_changed_lb",
  "data": {
    "side": "Buy",
    "stock_name": "Tencent Holdings Ltd.",
    "submitted_quantity": "1000",
    "symbol": "700.HK",
    "order_type": "LO",
    "submitted_price": "213.2",
    "executed_quantity": "1000",
    "executed_price": "213.2",
    "order_id": "27",
    "currency": "HKD",
    "status": "NewStatus",
    "submitted_at": "1562761893",
    "updated_at": "1562761893"
  }
}