Annual return values in metadata
and state
don't match
#1031
Labels
bug
Something isn't working
priority: P1
An important issue that must be fixed before the next release, but does nto require immediate focus.
size: S
A small task that can be completed in less than a day
Issue
A strategy's annual return percent value is available from both
metadata
andstate
endpoints, but the values don't match.Background
See item "B" in this discord thread.
The annual return percent is displayed in multiple places on
frontend
:metadata
endpoint'skey_metrics.cagr
propertystate
endpoint'slong_short_metrics_latest
…annualised_return_percent
propertyWhy two different data sources?
The data displayed on strategy tiles and overview page needs to be available fast and without massive data overhead, so it is included in the
metadata
endpoint.The metrics table shown on the Performance page includes a lot more statistics, and is therefore included in the
state
endpoint (to avoid overloadingmetadata
with too much data). The display of this data (order of elements, value formatting, labels, etc.) is fully controlled by the API – the only role thatfrontend
plays is the table styling.Steps to reproduce
The following steps can be reproduced for any strategy. Note that some strategies currently use live data for the
metadata
cagr
value, while others use backtested data. When comparing themetadata
andstate
values, be sure to compare the same source – thelong_short_metrics_latest
data includes bothlive_stats
andbacktested_stats
. The example below uses live data forcagr
, so it is compared the thelive_stats
data from thestate
endpoint.cagr
data frommetadata
endpoint:response
annualised_return_percent
data fromstate
endpoint:response
metadata
value is a decimal value and thestate
value is a formatted percent)0.05299…
=5.3%
frommetadata
vs.5.19%
fromstate
The text was updated successfully, but these errors were encountered: