Unrealized P&L Detail Inquiry
unrealized_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 |
UnrealizedData Fields
Return type : Object
| Parameter | Type | Description |
|---|---|---|
| date | string | Inventory Date |
| branch_no | string | Branch code |
| stock_no | string | Stock symbol |
| buy_sell | BSAction | Side: BUY, SELL |
| order_type | OrderType | Order Type: STOCK, MARGIN, SHORT, DAY_TRADE, SBL |
| cost_price | double | Cost Price |
| tradable_qty | int | Tradable Balance |
| today_qty | int | Today's Balance |
| unrealized_profit | int | Unrealized Profit |
| unrealized_loss | int | Unrealized Loss |
Request Example
auto unrealized_response = sdk->accounting->unrealized_gains_and_loses(target_account);
// With custom .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, // Inventory Date (string)
account = 26, // Account Number (int)
branchNo = 6460, // Branch Code (string)
stockNo = 2303, // Stock Symbol (string)
buySell = BUY, // Side (BSAction)
orderType = SHORT, // Order Type (OrderType)
costPrice = 50.0, // Cost Price (double)
tradableQty = 1000, // Tradable Balance (int)
todayQty = 1000, // Today's Balance (int)
unrealizedProfit = 45200, // Unrealized Profit (int)
unrealizedLoss = 0 // Unrealized Loss (int)
}
]
}