Skip to main content

Unrealized P&L Detail Inquiry

unrealized_gains_and_loses

Input Parameters

ParameterTypeDescription
accountAccountAccount number

Return Result

ParameterTypeDescription
is_successboolSuccess status
dataBankRemainReturns balance information
messagestringReturns error message when is_success = False

UnrealizedData Fields

Return type : Object

ParameterTypeDescription
datestringInventory Date
branch_nostringBranch code
stock_nostringStock symbol
buy_sellBSActionSide: BUY, SELL
order_typeOrderTypeOrder Type: STOCK, MARGIN, SHORT, DAY_TRADE, SBL
cost_pricedoubleCost Price
tradable_qtyintTradable Balance
today_qtyintToday's Balance
unrealized_profitintUnrealized Profit
unrealized_lossintUnrealized 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)
}
]
}