Skip to main content

庫存查詢

inventories

輸入參數

參數類別說明
accountAccount帳號

Result 回傳

參數類別說明
is_successbool是否成功
dataList回傳庫存資訊
messagestring當is_success = False 回傳錯誤訊息

庫存資訊 Inventory 欄位

Return type : Object

參數類別說明
> datestring交易日期
> accountstring帳號
> branch_nostring分公司代號
> stock_nostring股票代號
> order_typeOrderType委託單類型 : STOCK 現股 、 MARGIN 融資 、 SHORT 融券 、 DAY_TRADE 現股當沖、SBL借券
> lastday_qtyint昨日庫存餘額
> buy_qtyint今日委買股數
> buy_filled_qtyint今日買進成交股數
> buy_valueint買進價金
> today_qtyint今日庫存餘額
> tradable_qtyint可委託股數
> sell_qtyint今日委賣股數
> sell_filled_qtyint今日賣出成交股數
> sell_valueint賣出價金
> oddlistObject
>> lastday_qtyint昨日庫存餘額
>> buy_qtyint今日委買股數
>> buy_filled_qtyint今日買進成交股數
>> buy_valueint買進價金
>> today_qtyint今日庫存餘額
>> tradable_qtyint可委託股數
>> sell_qtyint今日委賣股數
>> sell_filled_qtyint今日賣出成交股數
>> sell_valueint賣出價金

請求範例

auto inventories_response = sdk->accounting->inventories(target_account);

if (!inventories_response.is_success) {
std::cerr << "Inventories query failed: "
<< (inventories_response.message.has_value() ? inventories_response.message.value() : "No message")
<< std::endl;
}
// 搭配自定義 .cpp & hpp Output
else if (inventories_response.data.has_value()) {
const auto& inventories = inventories_response.data.value();
for (const auto& inventory : inventories) {
std::cout << inventory << std::endl;
}
}
else {
std::cout << "Inventories query succeeded but no data returned." << std::endl;
}

回傳範例

{
isSuccess = true,
message = ,
data = [
Inventory{
date = 2023/10/13, // 交易日期 (string)
account = 26, // 帳號 (string)
branchNo = 6460, // 分公司代號 (string)
stockNo = 1101, // 股票代號 (string)
orderType = STOCK, // 委託單類型 (OrderType)
lastdayQty = 2000, // 昨日庫存餘額 (int)
buyQty = 0, // 今日委買股數 (int)
buyFilledQty = 0, // 今日買進成交股數 (int)
buyValue = 0, // 買進價金 (int)
todayQty = 2000, // 今日庫存餘額 (int)
tradableQty = 2000, // 可委託股數 (int)
sellQty = 0, // 今日委賣股數 (int)
sellFilledQty = 0, // 今日賣出成交股數 (int)
sellValue = 0, // 賣出價金 (int)
odd = InventoryOdd { // 委託單狀態 (InventoryOdd 物件)
lastdayQty = 0, // 昨日庫存餘額 (int)
buyQty = 0, // 今日委買股數 (int)
buyFilledQty = 0, // 今日買進成交股數 (int)
buyValue = 0, // 買進價金 (int)
todayQty = 0, // 今日庫存餘額 (int)
tradableQty = 0, // 可委託股數 (int)
sellQty = 0, // 今日委賣股數 (int)
sellFilledQty = 0, // 今日賣出成交股數 (int)
sellValue = 0 // 賣出價金 (int)
}
},
...
]
}