Unrealized P&L
unrealized_gains_and_loses
Input Parameters
| Parameter | Type | Meaning |
|---|---|---|
| account | Account | Account |
Result
| Parameter | Type | Meaning |
|---|---|---|
| is_success | bool | Whether successful |
| data | List | UnrealizedData list is returned |
| message | string | Error message returned when is_success = false |
UnrealizedData Parameter
Return type : Object
| Parameter | Type | Meaning |
|---|---|---|
| date | string | Date of inquiry |
| account | string | Account |
| branch_no | string | Branch number |
| stock_no | string | Symbol |
| buy_sell | BSAction | Buy/Sell Type : Buy, Sell (Note. Please refer to the information block below the table) |
| order_type | OrderType | Order Type : Stock, Margin, Short, DayTrade, SBL Securities borrowing and lending |
| cost_price | float | Holding price |
| tradable_qty | int | Available quantity |
| today_qty | int | Today Share balance |
| unrealized_profit | int | Unrealized profit |
| unrealized_loss | int | Unrealized 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)
},
...
]
}