Skip to main content

Unrealized Gains and Loses

unrealizedGainsAndLoses

Request Parameter

ParameterTypeMeaning
accountAccountAccount

Result Response

ParameterTypeMeaning
isSuccessboolInterface result
dataObjectUnrealizedData list is returned
messagestring ? (optional)isSuccess = False error description is returned

UnrealizedData Parameter

Return type : Object

ParameterTypeMeaning
datestringDate of inquiry
accountstringAccount
branchNostringBranch number
stockNostringSymbol
buySelljs:string / ts:BSActionBuy/Sell Type : BuySell (Note. Please refer to the infomation block below the table)
orderTypejs:string / ts:OrderTypeOrder Type : StockMarginShort Short sale 、 DayTradeSBL Security Landing
costPricenumberHolding cost
tradableQtynumberAvailable quantity
todayQtynumberToday Share balacne
unrealizedProfitnumberUnrealized profit
unrealizedLossnumberUnrealized 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)
},
...
]
}