Skip to content
Profit and Loss Analysis

Get Security Profit and Loss Ranking

Returns profit and loss of each security for the reporting currency and range, including the split between the underlying stock and derivatives, whether it is still held, and the number of full liquidations. Use it for the ranking page (request the profit list and the loss list separately), the per-security details of a calendar day (pass a single-day range), and share images. The list is not paged; take the top N items yourself.

When you call it through WhaleCore requestService(), declare the trade token requirement by setting requiresTradeToken to true.

WhaleCore portfolioService() already wraps this capability through getProfitRanking(currency:period:). When you use WhaleCore, prefer the WhaleCore capability over calling this operation directly.

GEThttps://api.lbkrs.com/v2/portfolio/asset/GetProfitAnalysisSummarySublist

Parameters

account_channelstringqueryRequired

Account channel. Use the account_channel of the current account

currencystringqueryRequired

Reporting currency, such as HKD. Use a currency whose supports.app_show is yes in Get Currency Configurations

profit_or_lossstringqueryRequired

List type:

  • profit - Profit list
  • loss - Loss list
  • all - All securities

profitlossall

startstringqueryRequired

Range start as a Unix timestamp in seconds. Pass 0 to start from the earliest queryable date

endstringqueryRequired

Range end as a Unix timestamp in seconds

start_datestringquery

Range start date in YYYY-MM-DD format, converted from start. Broker App omits it when start is 0

end_datestringqueryRequired

Range end date in YYYY-MM-DD format, converted from end. The server counts the dates as a closed range

Responses

HTTP 200The request succeeded. The response body contains the result of the “Get security profit and loss ranking” operation.
Standard response envelopecodemessagedata
dataobjectdata structure
start_datestring

Range start date

end_datestring

Range end date

updated_datestring

Update date of the profit and loss data in YYYY-MM-DD format

itemsarray<object>

Security profit and loss list. It is an empty array when there is no data

Child attributes
counter_idstring

Security ID (counter_id)

security_codestring

Security code

isinstring

ISIN code. Returned for products such as funds

namestring

Security name

marketstring

Market code

typestring

Security class. For example, fund means a fund

currencystring

Profit and loss currency

order_profitstring

Profit and loss in the period. The ranking is ordered by this field

profitstring

Profit and loss in the period

profit_ratestring

Return in the period as a decimal

underlying_profitstring

Profit and loss from the underlying stock

derivatives_profitstring

Profit and loss from derivatives

is_holdingboolean

Whether the security is still held at the end of the period

clearance_timesinteger

Number of full liquidations in the period

Whale Docs