Streaming data

1. Order Event

Realtime update of orders through streaming:

FieldTypeDescription

type

string

orderEvent

uniqueID

string

prefix

string

ipAddress

string

notifyID

string

orderID

string

instrumentID

string

buySell

string

B: Buy

S: Sell

orderType

string

LO|ATO|ATC|MP|MTL|MOK|MAK|PLO

price

number

quantity

number

marketID

string

VN: cash market

VNFE: derivatives market

origRequestID

string

account

string

cancelQty

number

osqty

number

filledQty

number

avgPrice

number

channel

string

inputTime

string

Unixtime

modifiedTime

string

Unixtime

isForceSell

Boolean

orderStatus

Boolean

origOrderID

string

rejectReason

string

stopOrder

string

True: conditional order

False: normal order

stopType

string

stopStep

number

stopPrice

number

profitPrice

number

Sample

Successful order streaming

{ 
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”
 }

Unsuccessful order streaming

{ 
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”
 }

Successful order amendment streaming

{
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

Unsuccessful order amendment streaming

{
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”
}

Successful order cancellation streaming

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

Unsuccessful order cancellation streaming

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

2. OrderError

To notify if an instruction (place/amend/cancel) has error.

FieldTypeDescription

type

string

orderError

data

Detail of data

uniqueid

string

ipaddress

string

notifyID

string

errorCode

string

message

string

orderID

string

instrumentID

string

buySell

string

prefix

string

orderType

string

price

number

quantity

number

marketID

string

origOrderID

string

account

string

channel

string

inputTime

string

modifiedTime

string

isForceSell

Boolean

isShortSell

Boolean

origRequestID

string

stopOrder

string

stopPrice

number

stopType

string

stopStep

number

profitPrice

number

modifiable

string

note

string

Sample

{
  "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

To notify of matched deal:

FieldTypeDescription

type

string

orderMatchEvent

data

orderID

string

instrumentID

string

ipAddress

string

uniqueID

string

notifyid

string

buySell

string

matchPrice

number

matchQty

number

prefix

string

account

string

matchTime

string

Sample

{
  "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. Derivatives position

To notify realtime open and close position for derivatives account.

FieldTypeDescription

type

string

clientPortfolioEvent

uniqueid

string

connectionid

string

ipaddress

string

notifyid

string

account

string

marketid

string

instrumentid

string

longqty

number

shortqty

number

Net

number

bidavgprice

number

askavgprice

number

tradeprice

number

marketprice

number

floatingpl

number

tradingpl

number

Sample

{
  "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