Skip to main content

Unrealized P&L

unrealizedGainsAndLoses

Input Parameters

ParameterTypeMeaning
accountAccountAccount

Result

ParameterTypeMeaning
isSuccessboolWhether successful
dataObjectUnrealizedData list is returned
messagestring ? (optional)Error message returned when isSuccess = false

UnrealizedData Parameter

Return type : Object

ParameterTypeMeaning
datestringDate of inquiry
branchNostringBranch number
stockNostringSymbol
buySelljs:string / ts:BSActionBuy/Sell Type : Buy, Sell (Note. Please refer to the information block below the table)
orderTypejs:string / ts:OrderTypeOrder Type : Stock, Margin, Short Short sale, DayTrade, SBL Securities borrowing and lending
costPricenumberHolding cost
tradableQtynumberAvailable quantity
todayQtynumberToday Share balance
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',
account: '26',
branchNo: '6460',
stockNo: '2303',
buySell: Buy,
orderType: Margin,
costPrice: 50,
tradableQty: 1000,
todayQty: 1000,
unrealizedProfit: 45200,
unrealizedLoss: 0
},
...
]
}