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:
Tên trường | Kiểu dữ liệu | Mô tả |
---|---|---|
type | string | Tên event: orderEvent |
uniqueID | string | |
prefix | string | |
ipAddress | string | Được xác định yêu cầu từ Client |
notifyID | string | Số serrial của msg |
orderID | string | |
instrumentID | string | Mã chứng khoán |
buySell | string | buy (B): mua/Sell (S): bán đã đặt theo orderID của lệnh B: Buy S: Sell |
orderType | string | Loại lệnh: LO|ATO|ATC|MP|MTL|MOK|MAK|PLO |
price | number | Giá |
quantity | number | Khối lượng |
marketID | string | Sàn: VN: thị trường cơ sở VNFE: thị trường phái sinh |
origRequestID | string | |
account | string | Số tài khoản |
cancelQty | number | Tổng khối lượng đã hủy |
osqty | number | Tổng khối lượng chưa khớp |
filledQty | number | Tổng khối lượng khớp |
avgPrice | number | Giá trung bình |
channel | string | Kênh đặt lệnh |
inputTime | string | Unixtime |
modifiedTime | string | Unixtime |
isForceSell | Boolean | |
orderStatus | Boolean | Trạng thái lệnh: WA: Chờ duyệt RS: Chờ gửi SD: Đã gửi QU: Chờ khớp FF: Đã khớp PF: Khớp 1 phần FFPC: Khớp 1 phần hủy phần còn lại WM: Chờ sửa WC: Chờ hủy CL: Đã hủy RJ: Từ chối EX: Hết hiệu lực SOR: Chờ kích hoạt SOS: Đã kích hoạt IAV: Lệnh trước phiên SOI: Lệnh điều kiện trước phiên |
origOrderID | string | |
rejectReason | string | |
stopOrder | string | Loại lệnh: True: Đối với lệnh điều kiện False: Đối với lệnh thường |
stopType | string | Loại điều kiện. Bắt buộc nhập nếu stopType = true - D: Down - U: Up - V: Trailling Up - E: Trailing Down - O: OCO - B: BullBear |
stopStep | number | |
stopPrice | number | |
profitPrice | number |
Ví dụ:
Streaming đặt lệnh thành công
Streaming đặt lệnh không thành công
Streaming về sửa lệnh thành công
Streaming sửa lệnh không thành công
Streaming hủy lệnh thành công
Streaming hủy lệnh không thành công
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:
Tên trường | Kiểu dữ liệu | Mô tả |
---|---|---|
type | string | Tên event: orderError |
data |
| Thông tin dữ liệu |
Detail of data | ||
uniqueid | string | |
ipaddress | string | |
notifyID | string | |
errorCode | string | Mã code lỗi trả ra |
message | string | Thông tin lệnh lỗi |
orderID | string | Số hiệu lệnh |
instrumentID | string | Mã CK |
buySell | string | Chiều mua/ bán B: Buy S: Sell |
prefix | string |
|
orderType | string | Loại lệnh: LO|ATO|ATC|MP|MTL|MOK|MAK|PLO |
price | number | Giá |
quantity | number | Khối lượng |
marketID | string | Sàn |
origOrderID | string |
|
account | string | Số tài khoản |
channel | string | Kênh |
inputTime | string | Thời gian nhận |
modifiedTime | string | Thời gian sửa lệnh |
isForceSell | Boolean | Luôn = F |
isShortSell | Boolean | Luôn = F |
origRequestID | string |
|
stopOrder | string | True hoặc False |
stopPrice | number |
|
stopType | string | Loại điều kiện. Bắt buộc nhập nếu stopType = true - D: Down - U: Up - V: Trailling Up - E: Trailing Down - O: OCO - B: BullBear |
stopStep | number |
|
profitPrice | number |
|
modifiable | string |
|
note | string | Ghi chú |
Ví dụ:
3. Order Match Event
Thông tin Streaming gồm những trường sau:
Tên trường | Kiểu dữ liệu | Mô tả |
---|---|---|
type | string | Tên event: orderMatchEvent |
data |
| Thông tin khớp lệnh |
orderID | string | Thông tin orderID |
instrumentID | string | Mã chứng khoán |
ipAddress | string | IP xác định từ yêu cầu Client |
uniqueID | string | |
notifyid | string | |
buySell | string |
|
matchPrice | number | giá khớp |
matchQty | number | khối lượng khớp |
prefix | string |
|
account | string | Số tài khoản |
matchTime | string | Thời gian khớp |
Ví dụ:
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.
Tên trường | Kiểu dữ liệu | Mô tả |
---|---|---|
type | string | Tên event: clientPortfolioEvent |
uniqueid | string |
|
connectionid | string |
|
ipaddress | string | IP được xác định từ yêu cầu Client |
notifyid | string | |
account | string | Số tài khoản |
marketid | string | Thị trường - VNFE: Phái sinh |
instrumentid | string | Mã chứng khoán |
longqty | number | Vị thế long |
shortqty | number | Vị thế short |
Net | number | Vị thế net (Tính bằng long - short). |
bidavgprice | number | Giá mua trung bình |
askavgprice | number | Giá bán trung bình |
tradeprice | number | Giá khớp |
marketprice | number | Giá thị trường |
floatingpl | number | Lãi/ Lỗ tạm tính |
tradingpl | number | Lãi/ Lỗ đã chốt |
Ví dụ:
Last updated