已實現損益彙總
realized_gains_and_loses_summary
輸入參數
| 參數 | 類別 | 說明 |
|---|---|---|
| account | Account | 帳號 |
Result 回傳
| 參數 | 類別 | 說明 |
|---|---|---|
| is_success | bool | 是否成功 |
| data | List | 回傳已實現彙總資訊 |
| message | string | 當is_success = False 回傳錯誤訊息 |
已實現彙總 RealizedSummary 欄位
Return type : Object
| 參數 | 類別 | 說明 |
|---|---|---|
| start_date | string | 彙總起始日 |
| end_date | string | 彙總截止日 |
| branch_no | string | 分公司代號 |
| account | string | 帳號 |
| stock_no | string | 股票代號 |
| buy_sell | BSAction | 買賣別 : BUY 買 、 SELL 賣 |
| order_type | OrderType | 委託單類型 : STOCK 現股 、 MARGIN 融資 、 SHORT 融券 、 DAY_TRADE 現股當沖、SBL借券 |
| filled_qty | int | 成交股數 |
| filled_avg_price | double | 成交均價 |
| realized_profit_and_loss | int | 已實現損益金額 |
請求範例
auto realized_summary_response = sdk->accounting->realized_gains_and_loses_summary(target_account);
// 搭配自定義 .cpp & hpp Output
if (realized_summary_response.is_success && realized_summary_response.data.has_value()) {
const auto& realized_list = *realized_summary_response.data;
for (const auto& item : realized_list) {
std::cout << item << std::endl;
}
}
回傳範例
{
isSuccess = true,
message = ,
data = [
RealizedSummary{
startDate = 20230801, // 起始日期 (string)
endDate = 20230801, // 截止日期 (string)
branchNo = 6460, // 分公司代號 (string)
account = 26, // 帳號 (string)
stockNo = 1101, // 股票代號 (string)
buySell = SELL, // 買賣別 (BSAction)
orderType = STOCK, // 委託單類型 (OrderType)
filledQty = 3000, // 成交股數 (int)
filledAvgPrice = 35.7, // 成交均價 (double)
realizedProfitAndLoss = 34026 // 已實現損益金額 (int)
},
...
]
}