Skip to content
Profit and Loss Analysis

Get Profit and Loss Trend

Returns profit and loss and return series at daily, monthly, and yearly granularity for the reporting currency and range. Use it for the trend chart on the analysis home page, the day, month, and year cells of the profit and loss calendar, and share cards. Each daily point includes the return for the day and the cumulative return up to that day; returns are decimals. You can pass only start_date and end_date; for a single day, use the same date for both.

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

WhaleCore portfolioService() already wraps this capability through getProfitTrend(currency:period:indexCounterId:) and getPLCalendar(currency:period:markets:). When you use WhaleCore, prefer the WhaleCore capability over calling this operation directly.

GEThttps://api.lbkrs.com/v1/portfolio/asset/GetProfitAnalysisTrend

Parameters

currencystringqueryRequired

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

account_channelstringquery

Account channel. Use the account_channel of the current account

chart_typestringquery

Return only the specified granularity, such as DAY or MONTH. The Broker App analysis page omits it

startstringquery

Range start as a Unix timestamp in seconds

endstringquery

Range end as a Unix timestamp in seconds

start_datestringquery

Range start date in YYYY-MM-DD format

end_datestringquery

Range end date in YYYY-MM-DD format

Responses

HTTP 200The request succeeded. The response body contains the result of the “Get profit and loss trend” operation.
Standard response envelopecodemessagedata
dataobjectdata structure
daily_pl_chartarray<object>

Daily series in ascending date order

Child attributes
date_timestring

Date in YYYY-MM-DD format

date_timestampinteger

Unix timestamp in seconds for the day

current_day_profitstring

Profit and loss for the day

asset_valuestring

Asset value for the day

simple_earning_yieldstring

Simple return for the day as a decimal (0.01 means 1%)

time_earning_yieldstring

Time-weighted return for the day as a decimal

accumulate_simple_earning_yieldstring

Cumulative simple return up to the day as a decimal

accumulate_time_earning_yieldstring

Cumulative time-weighted return up to the day as a decimal

month_pl_chartarray<object>

Monthly series

Child attributes
date_keystring

Period key: year and month for monthly points, year for yearly points

current_profitstring

Profit and loss for the period

start_asset_valuestring

Asset value at the start of the period

current_asset_valuestring

Asset value at the end of the period

simple_earning_yieldstring

Simple return for the period as a decimal

time_earning_yieldstring

Time-weighted return for the period as a decimal

year_pl_chartarray<object>

Yearly series

Child attributes
date_keystring

Period key: year and month for monthly points, year for yearly points

current_profitstring

Profit and loss for the period

start_asset_valuestring

Asset value at the start of the period

current_asset_valuestring

Asset value at the end of the period

simple_earning_yieldstring

Simple return for the period as a decimal

time_earning_yieldstring

Time-weighted return for the period as a decimal

Whale Docs