Unrealized P&L
unrealizedGainsAndLoses
Input Parameters
| Parameter | Type | Meaning |
|---|---|---|
| account | Account | Account |
Result
| Parameter | Type | Meaning |
|---|---|---|
| isSuccess | bool | Whether successful |
| data | Object | UnrealizedData list is returned |
| message | string ? (optional) | Error message returned when isSuccess = false |
UnrealizedData Parameter
Return type : Object
| Parameter | Type | Meaning |
|---|---|---|
| date | string | Date of inquiry |
| branchNo | string | Branch number |
| stockNo | string | Symbol |
| buySell | js:string / ts:BSAction | Buy/Sell Type : Buy, Sell (Note. Please refer to the information block below the table) |
| orderType | js:string / ts:OrderType | Order Type : Stock, Margin, Short Short sale, DayTrade, SBL Securities borrowing and lending |
| costPrice | number | Holding cost |
| tradableQty | number | Available quantity |
| todayQty | number | Today Share balance |
| unrealizedProfit | number | Unrealized profit |
| unrealizedLoss | number | Unrealized loss |
info
For spot trades, buySell is always Buy and quantity could be positive or negative to denote the net position. For margin trades,buySell could be Buy or Sell depends on the trade direction.
Request Example
sdk.accounting.unrealizedGainsAndLoses(account);
Response Example
{
isSuccess: true,
data:[
{
date: '2021/08/09',
account: '26',
branchNo: '6460',
stockNo: '2303',
buySell: Buy,
orderType: Margin,
costPrice: 50,
tradableQty: 1000,
todayQty: 1000,
unrealizedProfit: 45200,
unrealizedLoss: 0
},
...
]
}