Unrealized Gains and Loses
unrealizedGainsAndLoses
Request Parameter
| Parameter | Type | Meaning |
|---|---|---|
| account | Account | Account |
Result Response
| Parameter | Type | Meaning |
|---|---|---|
| isSuccess | bool | Interface result |
| data | Object | UnrealizedData list is returned |
| message | string ? (optional) | isSuccess = False error description is returned |
UnrealizedData Parameter
Return type : Object
| Parameter | Type | Meaning |
|---|---|---|
| date | string | Date of inquiry |
| account | string | Account |
| branchNo | string | Branch number |
| stockNo | string | Symbol |
| buySell | js:string / ts:BSAction | Buy/Sell Type : Buy 、 Sell (Note. Please refer to the infomation block below the table) |
| orderType | js:string / ts:OrderType | Order Type : Stock 、 Margin 、 Short Short sale 、 DayTrade 、 SBL Security Landing |
| costPrice | number | Holding cost |
| tradableQty | number | Available quantity |
| todayQty | number | Today Share balacne |
| 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', // Date of inquiry (string)
account: '26', // Account (string)
branchNo: '6460', // Branch number (string)
stockNo: '2303', // Symbol (string)
buySell: 'Buy', // Buy / Sell Type (string)
orderType: 'Margin', // Order Type (string)
costPrice: 50, // Holding cost (number)
tradableQty: 1000, // Available quantity (number)
todayQty: 1000, // todayQty (number)
unrealizedProfit: 47000, // Unrealized profit (number)
unrealizedLoss: 0 // Unrealized loss (number)
},
...
]
}