Skip to content
Profit and Loss Analysis

Get Profit and Loss Analysis Overview

Returns the account's profit and loss overview for the reporting currency and range: total profit and loss and return (simple and time-weighted), assets at the start and end of the range, current total assets, net investment, and the breakdown and top performers by asset class such as stocks, funds, money market funds, and IPOs. Use it for the total profit and loss area and the asset tabs of P&L Summary on the analysis home page, and for the summary at the top of the ranking page. Request it again when the currency or range changes.

Returns are decimals (0.05 means 5%). For all time, pass start=0; start_date in the response is then the earliest date that can be counted.

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

GEThttps://api.lbkrs.com/v3/portfolio/asset/GetProfitAnalysisSummary

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

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 profit and loss analysis overview” operation.
Standard response envelopecodemessagedata
dataobjectdata structure
currencystring

Reporting currency

start_datestring

Actual range start date in YYYY-MM-DD format

end_datestring

Actual range end date in YYYY-MM-DD format

sum_profitstring

Total profit and loss in the range

sum_profit_ratestring

Return in the range as a decimal

total_simple_earning_yieldstring

Cumulative simple return in the range as a decimal

total_time_earning_yieldstring

Cumulative time-weighted return in the range as a decimal

initial_asset_valuestring

Assets at the start of the range

ending_asset_valuestring

Assets at the end of the range

current_total_assetstring

Current total assets

invest_amountstring

Net investment in the range

is_tradedstring

Whether there were trades in the range. Empty means no trades; you can then hide the share entry

trade_stock_numstring

Number of stocks traded in the range

trade_update_datestring

Latest update date of trade data

updated_datestring

Update date of the profit and loss data

profitsobject

Profit and loss breakdown by asset class

Child attributes
stockstring

Stock profit and loss

fundstring

Fund profit and loss

mmfstring

Money market fund return for idle cash

ipostring

IPO profit and loss

otherstring

Other asset profit and loss

ipo_subscriptionstring

Number of IPO subscriptions in the range

ipo_hitstring

Number of IPO allotments in the range. Allotment rate = ipo_hit / ipo_subscription

cumulative_transaction_amountstring

Cumulative turnover in the range

summary_infoarray<object>

Top performers of each asset class, distinguished by asset_type

Child attributes
asset_typestring

Asset class, such as stock, fund, or crypto

profit_maxstring

Profit and loss of the most profitable security in the period

profit_max_namestring

Name of the most profitable security in the period

loss_maxstring

Profit and loss of the security with the largest loss in the period

loss_max_namestring

Name of the security with the largest loss in the period

Whale Docs