Dữ liệu streaming

Cập nhật trạng thái lệnh/vị thế phái sinh thời gian thực

1. Order Event

Thông tin streaming cập nhật trạng thái lệnh về đặt/ hủy/ sửa lệnh bao gồm những thông tin sau:

Ví dụ:

Streaming đặt lệnh thành công

{ 
instrumentID: "SSI",
market: "VN",
buySell: "B",
orderType: "LO",
channelID: "IW",
price: 21000,
quantity: 300,
account: "0901351",
stopOrder: false,
stopPrice: 0,
stopType: "string",
stopStep: 0,
lossStep: 0,
profitStep: 0
requestID: "1678195",
code:123456789,
deviceID: "MAC Address",
userAgent: “FCTrading”
 }

Streaming đặt lệnh không thành công

{ 
instrumentID: "SSI",
market: "VN",
buySell: "B",
orderType: "LO",
channelID: "IW",
price: 1600,
quantity: 300,
account: "0901351",
stopOrder: false,
stopPrice: 0,
stopType: "string",
stopStep: 0,
lossStep: 0,
profitStep: 0
requestID: "1678195",
code:123456789,
deviceID: "MAC Address",
userAgent: “FCTrading”
 }

Streaming về sửa lệnh thành công

{
requestID: "93235974",
orderID: "12658867",
price: 1410,
quantity: 2,
account: "0901358",
instrumentID: "VN30F2106",
marketID: "VNFE",
buySell: "B",
orderType: "LO"
code:”123456789,
deviceID: "MAC Address",
userAgent: “FCTrading”
}son

Streaming sửa lệnh không thành công

{
requestID: "93235974",
orderID: "12658867",
price: 1000,
quantity: 2,
account: "0901358",
instrumentID: "VN30F2106",
marketID: "VNFE",
buySell: "B",
orderType: "LO"
code:”123456789,
deviceID: "MAC Address",
userAgent: “FCTrading”
}

Streaming hủy lệnh thành công

{
orderID: "12658867",
account: "0901358",
marketID: "VNFE",
instrumentID: "VN30F2106",
buySell: "B",
requestID: "52513603"
code:”123456789,
deviceID: "MAC Address",
userAgent: “FCTrading”
}

Streaming hủy lệnh không thành công

{
orderID: "12658867",
account: "0901358",
marketID: "VNFE",
instrumentID: "VN30F2106",
buySell: "B",
requestID: "52513603"
code:”123456789,
deviceID: "MAC Address",
userAgent: “FCTrading”
}

2. OrderError

Khi yêu cầu đặt/hủy/sửa bị lỗi, hệ thống sẽ cập nhật qua streaming các thông tin như sau:

Ví dụ:

{
  "type": "orderError",
  "data": {
    "message": "This channel has been block; disallow to place order ",
    "notifyID": 0,
    "errorCode": "ORD015",
    "uniqueID": "6163422",
    "orderID": "T20230504w3806163422",
    "instrumentID": "SSI",
    "ipAddress": "10.255.241.47",
    "buySell": "B",
    "prefix": "w38",
    "orderType": "LO",
    "price": 19600,
    "quantity": 200,
    "marketID": "VN",
    "origOrderId": "T20230504w3806163422",
    "account": "0322206",
    "channel": "TA",
    "inputTime": "1683165600160",
    "modifiedTime": "1683165600161",
    "isForceSell": "F",
    "isShortSell": "F",
    "origRequestID": "6163422",
    "stopOrder": false,
    "stopPrice": 0,
    "stopType": "",
    "stopStep": 0,
    "profitPrice": 0,
    "modifiable": false,
    "note": ""
  }
}

3. Order Match Event

Thông tin Streaming gồm những trường sau:

Ví dụ:

{
  "type": "orderMatchEvent",
  "data": {
    "orderID": "16201867",
    "notifyID": 101180,
    "instrumentID": "BVS",
    "uniqueID": "24194396",
    "buySell": "B",
    "matchPrice": 1000,
    "ipAddress": "10.48.41.16",
    "matchQty": 100,
    "prefix": "t4c",
    "account": "1184411",
    "matchTime": "1656665019000"
  }
}

4. Vị thế phái sinh

Thông tin streaming vị thế phái sinh bao gồm vị thế mở và vị thế đã đóng trong ngày.

Ví dụ:

{
  "type": "clientPortfolioEvent",
  "data": {
    "account": "0901358",
    "notifyID": 27,
    "data": null,
    "clientPortfoliosOpen": [
      {
        "martketID": "VNFE",
        "instrumentID": "VN30F2106",
        "longQty": 9,
        "shortQty": 0,
        "net": 9,
        "bidAvgPrice": 1402.4000244140625,
        "askAvgPrice": 0,
        "tradePrice": 0,
        "marketPrice": 873,
        "floatingPL": -476460000,
        "tradingPL": 0
      },
      {
        "martketID": "VNFE",
        "instrumentID": "VN30F2107",
        "longQty": 2,
        "shortQty": 0,
        "net": 2,
        "bidAvgPrice": 830,
        "askAvgPrice": 0,
        "tradePrice": 0,
        "marketPrice": 830,
        "floatingPL": 0,
        "tradingPL": 0
      }
    ],
    "uniqueID": null,
    "clientPortfoliosClose": null,
    "connectionID": "",
    "ipAddress": null,
    "prefix": null
  }
}

Last updated