Chuyển tới nội dung chính

Chi tiết giao dịch đang nắm giữ

API này cấp thông tin chi tiết danh sách các giao dịch đang mở trong danh mục Nebula.

HTTP request

  • URL: /api/personalize/v1/partner/nebula-ultra/profiles/portfolio/positions/open
  • Method: GET
  • Content Type: None
  • Response Type: application/json

Tham số header

HeaderMô tảKiểu dữ liệuBắt buộc
X-Api-KeyKhóa duy nhất.string

Tham Số Truy Vấn (Query Parameters)

Tên Tham SốKiểu Dữ LiệuBắt buộcMô Tả
externalUserIdstringUserId của đối tác.
typestringkhôngLoại portfolio:
- backtest: Hiệu suất quá khứ (default)
- paper: Giao dịch giả lập
- live: Dành cho bạn
modestringkhôngChế độ tính toán:
- avg: Giá vốn bình quân (default)
- fifo: FIFO
recvWindowstringkhôngThời gian chấp nhận (ms), default: 5000.
timestampstringUnix timestamp (milliseconds).
signaturestringHMAC-SHA256 signature.

Phản Hồi (Response)

Response Mẫu

{
"status": 200,
"message": "Success",
"data": [
{
"ticker": "CTG",
"buyPrice": 21785.661834140436,
"buyTime": "2020-04-14T00:00:00.000Z",
"sellPrice": 26443,
"sellTime": "2020-05-11T00:00:00.000Z",
"holdingPeriod": 0,
"quantity": 2600,
"priceClose": 49650,
"pctChange": 0.3,
"pnl": 4778,
"pnlPercentage": 0,
"status": "open"
},
{
"ticker": "BID",
"buyPrice": 21785.661834140436,
"buyTime": "2020-04-14T00:00:00.000Z",
"sellPrice": 26443,
"sellTime": "2020-05-11T00:00:00.000Z",
"holdingPeriod": 0,
"quantity": 4200,
"priceClose": 37000,
"pctChange": 0,
"pnl": -935265,
"pnlPercentage": -0.6,
"status": "open"
},
{
"ticker": "BVS",
"buyPrice": 21785.661834140436,
"buyTime": "2020-04-14T00:00:00.000Z",
"sellPrice": 26443,
"sellTime": "2020-05-11T00:00:00.000Z",
"holdingPeriod": 0,
"quantity": 1600,
"priceClose": 29700,
"pctChange": -0.34,
"pnl": -326880,
"pnlPercentage": -0.68,
"status": "open"
},
{
"ticker": "BVH",
"buyPrice": 21785.661834140436,
"buyTime": "2020-04-14T00:00:00.000Z",
"sellPrice": 26443,
"sellTime": "2020-05-11T00:00:00.000Z",
"holdingPeriod": 13,
"quantity": 300,
"priceClose": 52000,
"pctChange": 0,
"pnl": 15645,
"pnlPercentage": 0.1,
"status": "open"
}
]
}

Chi Tiết Tham Số Response

Tên Thuộc TínhKiểu Dữ LiệuMô Tả
statusnumberMã trạng thái HTTP.
messagestringThông báo kết quả xử lý.
dataarray (Xem chi tiết)Dữ liệu các giao dịch.

Cấu trúc thuộc tính data

Quay lại

Tên Thuộc TínhKiểu Dữ LiệuMô Tả
tickerstringMã cổ phiếu.
buyPricenumberGiá mua.
buyTimestringThời gian mua (Định dạng: yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
sellPricenumberGiá bán.
sellTimestringThời gian bán (Định dạng: yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
holdingPeriodnumberSố ngày nắm giữ.
quantitynumberSố lượng.
priceClosenumberGiá đóng cửa gần nhất.
pctChangenumberPhần trăm thay đổi giá so với giá mua.
pnlnumberLãi/lỗ.
pnlPercentagenumber%Lãi lỗ hiện tại.
statusstringTrạng thái:
- closed: đang đóng
- open: đã mở

CREDENTIALS

* Timestamp và Signature sẽ được tự động tạo khi gọi API

RESPONSE200

{
"status": 200,
"message": "Success",
"data": [
{
"ticker": "CTG",
"buyPrice": 21785.661834140436,
"buyTime": "2020-04-14T00:00:00.000Z",
"sellPrice": 26443,
"sellTime": "2020-05-11T00:00:00.000Z",
"holdingPeriod": 0,
"quantity": 2600,
"priceClose": 49650,
"pctChange": 0.3,
"pnl": 4778,
"pnlPercentage": 0,
"status": "open"
},
{
"ticker": "BID",
"buyPrice": 21785.661834140436,
"buyTime": "2020-04-14T00:00:00.000Z",
"sellPrice": 26443,
"sellTime": "2020-05-11T00:00:00.000Z",
"holdingPeriod": 0,
"quantity": 4200,
"priceClose": 37000,
"pctChange": 0,
"pnl": -935265,
"pnlPercentage": -0.6,
"status": "open"
},
{
"ticker": "BVS",
"buyPrice": 21785.661834140436,
"buyTime": "2020-04-14T00:00:00.000Z",
"sellPrice": 26443,
"sellTime": "2020-05-11T00:00:00.000Z",
"holdingPeriod": 0,
"quantity": 1600,
"priceClose": 29700,
"pctChange": -0.34,
"pnl": -326880,
"pnlPercentage": -0.68,
"status": "open"
},
{
"ticker": "BVH",
"buyPrice": 21785.661834140436,
"buyTime": "2020-04-14T00:00:00.000Z",
"sellPrice": 26443,
"sellTime": "2020-05-11T00:00:00.000Z",
"holdingPeriod": 13,
"quantity": 300,
"priceClose": 52000,
"pctChange": 0,
"pnl": 15645,
"pnlPercentage": 0.1,
"status": "open"
}
]
}