1. Order Event
Realtime update of orders through streaming:
Field Type Description LO|ATO|ATC|MP|MTL|MOK|MAK|PLO
VN: cash market
VNFE: derivatives market
True: conditional order
False: normal order
Sample
Successful order streaming
Place order request Streaming orderEvent
Copy {
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”
}
Copy {
"type" : "orderEvent" ,
"data" : {
"orderID" : "12663204" ,
"notifyID" : 10 ,
“instrumentID ":" VN30F2106 ",
" uniqueID ":" 30304045 ",
" buySell ":" B ",
“orderType" : "LO" ,
"ipAddress" : "192.168.202.36" ,
"price" : 1410 , "prefix" : "2mw" ,
"quantity" : 10 ,
"marketID" : "VNFE" ,
"origOrderId" : "" ,
"account" : "0901358" ,
"cancelQty" : 0 , "osQty" : 10 ,
"filledQty" : 0 ,
"avgPrice" : 0 ,
"channel" : "TA" ,
"inputTime" : "1606277281849" ,
"modifiedTime" : "1606277281850" ,
"isForceSell" : "F" ,
"isShortSell" : "F" ,
"orderStatus" : "RS" ,
"rejectReason" : "" ,
"origRequestID" : "30304045" ,
"stopOrder" : false ,
"stopPrice" : 0 ,
"stopType" : "" ,
"stopStep" : 0 ,
"profitPrice" : 0
}
}
Unsuccessful order streaming
Place order request Streaming orderError
Copy {
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”
}
Copy {
"type" : "orderError" ,
"data" : {
"message" : "Price 1,600.00 exceeds ceiling price 808.50!" ,
"notifyID" : 15455 ,
"data" : null ,
"errorCode" : "ERR500" ,
"uniqueID" : "02365132" ,
"connectionID" : "" ,
"ipAddress" : "192.168.202.87" ,
"prefix" : "23o"
}
}
Successful order amendment streaming
Amend order request Streaming orderEvent
Copy {
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
Copy {
"type" : "orderEvent" ,
"data" : {
"orderID" : "12663204" ,
"notifyID" : 11 ,
"instrumentID" : "VN30F2106" ,
"uniqueID" : "31618366" ,
"buySell" : "B" ,
"orderType" : "LO" ,
"ipAddress" : "192.168.202.36" ,
"price" : 1410 ,
"prefix" : "2mw" ,
"quantity" : 2 ,
"marketID" : "VNFE" ,
"origOrderId" : "" ,
"account" : "0901358" ,
"cancelQty" : 0 ,
"osQty" : 2 ,
"filledQty" : 0 ,
"avgPrice" : 0 ,
"channel" : "TA" ,
"inputTime" : "1606277281849" ,
"modifiedTime" : "1606277330852" ,
"isForceSell" : "F" ,
"isShortSell" : "F" ,
"orderStatus" : "RS" ,
"rejectReason" : "" ,
"origRequestID" : "30304045" ,
"stopOrder" : false ,
"stopPrice" : 0 ,
"stopType" : "" ,
"stopStep" : 0 ,
"profitPrice" : 0
}
}
Unsuccessful order amendment streaming
Amend request Streaming orderError
Copy {
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”
}
Copy {
"type" : "orderError" ,
"data" : {
"message" : "Price 1,000.00 exceeds ceiling price 808.50!" ,
"notifyID" : 15460 ,
"data" : null ,
"errorCode" : "ERR500" ,
"uniqueID" : "65896571" ,
"connectionID" : "" ,
"ipAddress" : "192.168.202.87" ,
"prefix" : "23o"
}
}
Successful order cancellation streaming
Cancel request Streaming orderEvent
Copy {
orderID : "12658867" ,
account : "0901358" ,
marketID : "VNFE" ,
instrumentID : "VN30F2106" ,
buySell : "B" ,
requestID : "52513603"
code:” 123456789 ” ,
deviceID : "MAC Address" ,
userAgent : “FCTrading”
}
Copy {
"type" : "orderEvent" ,
"data" : {
"orderID" : "12663204" ,
"notifyID" : 12 ,
"instrumentID" : "VN30F2106" ,
"uniqueID" : "59028516" ,
"buySell" : "B" ,
"orderType" : "LO" ,
"ipAddress" : "192.168.202.36" ,
"price" : 1410
, "prefix" : "2mw" ,
"quantity" : 2 ,
"marketID" : "VNFE" ,
"origOrderId" : "" ,
"account" : "0901358" ,
"cancelQty" : 2 ,
"osQty" : 0 ,
"filledQty" : 0 ,
"avgPrice" : 0 ,
"channel" : "TA" ,
"inputTime" : "1606277281849" ,
"modifiedTime" : "1606277330861" ,
"isForceSell" : "F" ,
"isShortSell" : "F" ,
"orderStatus" : "CL" ,
"rejectReason" : "" ,
"origRequestID" : "30304045" ,
"stopOrder" : false ,
"stopPrice" : 0 ,
"stopType" : "" ,
"stopStep" : 0 ,
"profitPrice" : 0
}
}
Unsuccessful order cancellation streaming
Cancel request Streaming orderError
Copy {
orderID : "12658867" ,
account : "0901358" ,
marketID : "VNFE" ,
instrumentID : "VN30F2106" ,
buySell : "B" ,
requestID : "52513603"
code:” 123456789 ” ,
deviceID : "MAC Address" ,
userAgent : “FCTrading”
}
Copy {
"type" : "orderError" ,
"data" : {
"message" : "Invalid Order Transition Error!" ,
"notifyID" : 15468 ,
"data" : null ,
"errorCode" : "ERR500" ,
"uniqueID" : "25162310" ,
"ipAddress" : ":" ,
"192.168.202.87" : "," ,
"prefix" : ":" ,
"23o" : "}}"
}
}
2. OrderError
To notify if an instruction (place/amend/cancel) has error.
Sample
Copy {
"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:
Sample
Copy {
"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.
Sample
Copy {
"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
}
}