Skip to main content

Realized P&L Summary

realized_gains_and_loses_summary

Input Parameters

ParameterTypeDescription
accountAccountAccount number

Return Result

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

RealizedSummary Fields

Return type : Object

ParameterTypeDescription
start_datestringSummary start date
end_datestringSummary end date
branch_nostringBranch code
accountstringAccount number
stock_nostringStock symbol
buy_sellBSActionSide: BUY, SELL
order_typeOrderTypeOrder Type: STOCK (Spot), MARGIN (Margin Buy), SHORT (Short Sell), DAY_TRADE (Day Trade), SBL (Securities Borrowing)
filled_qtyintFilled quantity
filled_avg_pricedoubleAverage filled price
realized_profit_and_lossintRealized P&L amount

Request Example

auto realized_summary_response = sdk->accounting->realized_gains_and_loses_summary(target_account);

// With custom .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;
}
}

Response Example

{
isSuccess = true,
message = ,
data = [
RealizedSummary{
startDate = 20230801, // Start Date (string)
endDate = 20230801, // End Date (string)
branchNo = 6460, // Branch Code (string)
account = 26, // Account Number (string)
stockNo = 1101, // Stock Symbol (string)
buySell = SELL, // Side (BSAction)
orderType = STOCK, // Order Type (OrderType)
filledQty = 3000, // Filled Quantity (int)
filledAvgPrice = 35.7, // Average Filled Price (double)
realizedProfitAndLoss = 34026 // Realized P&L Amount (int)
},
...
]
}