Skip to main content

未實現損益查詢

unrealized_gains_and_loses

輸入參數

參數類別說明
accountAccount帳號

Result 回傳

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

未實現 UnrealizedData 欄位

Return type : Object

參數類別說明
datestring庫存建立日
branch_nostring分公司代號
stock_nostring股票代號
buy_sellBSAction買賣別 : BUY 買 、 SELL
order_typeOrderType委託單類型 : STOCK 現股 、 MARGIN 融資 、 SHORT 融券 、 DAY_TRADE 現股當沖、SBL借券
cost_pricedouble成本價
tradable_qtyint可交易餘額
today_qtyint今日餘額
unrealized_profitint未實現獲利
unrealized_lossint未實現虧損

請求範例

auto unrealized_response = sdk->accounting->unrealized_gains_and_loses(target_account);

// 搭配自定義 .cpp & hpp Output
if (unrealized_response.is_success && unrealized_response.data.has_value()) {
for (const auto& u : *unrealized_response.data) {
std::cout << u << std::endl;
}
}

回傳範例

{
isSuccess = True,
message = ,
data = [
UnrealizedData{
date = 2021/08/09, // 庫存建立日 (string)
account = 26, // 帳號 (int)
branchNo = 6460, // 分公司代號 (string)
stockNo = 2303, // 股票代號 (string)
buySell = BUY, // 買賣別 (BSAction)
orderType = SHORT, // 委託單類型 (OrderType)
costPrice = 50.0, // 成本價格 (double)
tradableQty = 1000, // 可交易餘額 (int)
todayQty = 1000, // 今日餘額 (int)
unrealizedProfit = 45200, // 未實現獲利 (int)
unrealizedLoss = 0 // 未實現虧損 (int)
}
]
}