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

Giao dịch đã đóng trạng thái

API này cung cấp thông tin chi tiết về kết quả của từng giao dịch đã được đóng trong danh mục Nebula, .

HTTP request​

  • URL: /api/personalize/v1/partner/nebula-ultra/profiles/portfolio/positions/closed
  • 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.stringcó

Tham Số Truy Vấn (Query Parameters)​

Tên Tham SốKiểu Dữ LiệuBắt buộcMô Tả
externalUserIdstringcóUserId 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:
- AVCO: Giá vốn bình quân (default)
- FIFO: Phương pháp tính fifo
recvWindowstringkhôngThời gian chấp nhận (ms), default: 5000.
timestampstringcóUnix timestamp (milliseconds).
signaturestringcóHMAC-SHA256 signature.

Phản Hồi (Response)​

Response Mẫu​

{
"status": 200,
"message": "Success",
"data": [
{
"ticker": "BVH",
"buyPrice": 51969.191192787795,
"buyTime": "2025-12-05T00:00:00.000Z",
"sellPrice": 56000,
"sellTime": "2025-12-23T00:00:00.000Z",
"holdingPeriod": 18,
"quantity": 159300,
"pnl": 601964242,
"pnlPercentage": 7.27124804962113,
"status": "closed"
},
{
"ticker": "CTG",
"buyPrice": 34717.69972067039,
"buyTime": "2025-11-18T00:00:00.000Z",
"sellPrice": 35000,
"sellTime": "2025-12-23T00:00:00.000Z",
"holdingPeriod": 35,
"quantity": 183800,
"pnl": 22938291,
"pnlPercentage": 0.35947161964220087,
"status": "closed"
},
{
"ticker": "BVH",
"buyPrice": 51969.191192787795,
"buyTime": "2025-12-05T00:00:00.000Z",
"sellPrice": 56000,
"sellTime": "2025-12-22T00:00:00.000Z",
"holdingPeriod": 17,
"quantity": 201200,
"pnl": 760296332,
"pnlPercentage": 7.271248062138129,
"status": "closed"
}
]
}

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 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.
pnlnumberLãi/lỗ.
pnlPercentagenumber%Lãi lỗ hiện tại.
statusstringTrạng thái:
- closed: giao dịch đã đóng trạng thái - đã mua và được bán rồi.
- open: giao dịch đang nắm giữ - mới mua chưa bán.

CREDENTIALS▼

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

RESPONSE200

{
"status": 200,
"message": "Success",
"data": [
{
"ticker": "BVH",
"buyPrice": 51969.191192787795,
"buyTime": "2025-12-05T00:00:00.000Z",
"sellPrice": 56000,
"sellTime": "2025-12-23T00:00:00.000Z",
"holdingPeriod": 18,
"quantity": 159300,
"pnl": 601964242,
"pnlPercentage": 7.27124804962113,
"status": "closed"
},
{
"ticker": "CTG",
"buyPrice": 34717.69972067039,
"buyTime": "2025-11-18T00:00:00.000Z",
"sellPrice": 35000,
"sellTime": "2025-12-23T00:00:00.000Z",
"holdingPeriod": 35,
"quantity": 183800,
"pnl": 22938291,
"pnlPercentage": 0.35947161964220087,
"status": "closed"
},
{
"ticker": "BVH",
"buyPrice": 51969.191192787795,
"buyTime": "2025-12-05T00:00:00.000Z",
"sellPrice": 56000,
"sellTime": "2025-12-22T00:00:00.000Z",
"holdingPeriod": 17,
"quantity": 201200,
"pnl": 760296332,
"pnlPercentage": 7.271248062138129,
"status": "closed"
}
]
}