Realized P&L Detail Inquiry
realized_gains_and_loses
Input Parameters
| Parameter | Type | Description |
|---|---|---|
| account | Account | Account number |
Return Result
| Parameter | Type | Description |
|---|---|---|
| is_success | bool | Success status |
| data | BankRemain | Returns balance information |
| message | string | Returns error message when is_success = False |
Realized Fields
Return type : Object
| Parameter | Type | Description |
|---|---|---|
| date | string | Data Date |
| branch_no | string | Branch code |
| account | string | Account number |
| stock_no | string | Stock symbol |
| buy_sell | BSAction | Side: BUY, SELL |
| filled_qty | int | Filled Quantity |
| filled_price | double | Filled Price |
| order_type | OrderType | Order Type: STOCK, MARGIN, SHORT, DAY_TRADE, SBL |
| realized_profit | int | Realized Profit |
| realized_loss | int | Realized Loss |
Request Example
auto realized_response = sdk->accounting->realized_gains_and_loses(target_account);
// With custom .cpp & hpp Output
if (realized_response.is_success && realized_response.data.has_value()) {
for (const auto& r : *realized_response.data) {
std::cout << r << std::endl;
}
}
Response Example
{
isSuccess = true,
message = ,
data =[
Realized{
date = 2023/08/16, // Data Date (string)
branchNo = 6460, // Branch Code (string)
account = 26, // Account Number (string)
stockNo = 1101, // Stock Symbol (string)
buySell = SELL, // Side (BSAction)
filledQty = 1000, // Filled Quantity (int)
filledPrice = 36.5, // Filled Price (double)
orderType = STOCK, // Order Type (OrderType)
realizedProfit = 36339, // Realized Profit (int)
realizedLoss = 0 // Realized Loss (int)
},
...
]
}