Skip to main content

Unrealized P&L

unrealized_gains_and_loses

Input Parameters

ParameterTypeMeaning
accountAccountAccount

Result

ParameterTypeMeaning
is_successboolWhether successful
dataListUnrealizedData list is returned
messagestringError message returned when is_success = false

UnrealizedData Parameter

Return type : Object

ParameterTypeMeaning
datestringDate of inquiry
accountstringAccount
branch_nostringBranch number
stock_nostringSymbol
buy_sellBSActionBuy/Sell Type : Buy, Sell (Note. Please refer to the information block below the table)
order_typeOrderTypeOrder Type : Stock, Margin, Short, DayTrade, SBL Securities borrowing and lending
cost_pricefloatHolding price
tradable_qtyintAvailable quantity
today_qtyintToday Share balance
unrealized_profitintUnrealized profit
unrealized_lossintUnrealized loss
info

For spot trades, buy_sell is always Buy and quantity could be positive or negative to denote the net position. For margin trades,buy_sell could be Buy or Sell depends on the trade direction.

Request Example

sdk.accounting.unrealized_gains_and_loses(account)

Response Example

Result {
is_success: True,
message: None,
data : [UnrealizedData{
date: "2021/08/09", # Data query date (string)
account: "26", # Account (string)
branch_no: "6460", # Branch code (string)
stock_no: "2303", # Symbol (string)
buy_sell: Buy, # Buy/sell side (BSAction)
order_type: Margin, # Order type (OrderType)
cost_price: 50.0, # Cost price (double)
tradable_qty: 1000, # Tradable balance (int)
today_qty: 1000, # Today's balance (int)
unrealized_profit: 48650, # Unrealized profit (int)
unrealized_loss: 0 # Unrealized loss (int)
},
...
]
}