Wrong Heatmap Values for Monthly Excess Returns (Baseline)

OS: Windows 11
PP version: 0.80.3

Observation:

On monthly return heatmap, excess returns are calculated incorrectly against a benchmark when:

  • The first transaction in the selected “Data Series“ for the widget is not the oldest transaction in the complete portfolio

Reproduction:

  • Create an empty portfolio
  • Create a securities account S1 referencing a deposit account D1
  • Create a cash account C1
  • Add the following transactions to C1:
    • 12 deposits on: 2024-01-01, 2024-02-01, …, 2024-12-01
  • Add the following transactions to D1:
    • 6 deposits on: 2024-06-15, 2024-07-15, …, 2024-12-15
  • Add the following transactions to S1:
    • 3 buy any security XYZ on: 2024-07-16, 2024-08-16, 2024-09-16,
  • Open a performance dashboard
  • Set the time interval for the dashboard to “3 years“
  • Add a monthly return heatmap widget
    • Select S1 account as “Data Series“ for the widget
    • Select security XYZ (or any other security) as “Exess Return → Benchmark“
  • Observe the wrong behavior

Expectation:

  • All month before the first buy on 2024-07-16 shall show ‘0’ as S1 has no securities
  • Any transaction in the cash account C1 shall not have any influence on the monthly heatmap widget as:
    • the selected data series for the widget is S1
    • There are no connections between S1 and C1 accounts

Observation:

  • The month before the first buy have non-zero values
  • Testing several scenarios led to the following conclusion:
    • The number of month with non-zero values is the smallest of the following:
      • The time interval of the dashboard or
      • The first available historical quota for the benchmark or
      • The first available transaction in the complete portfolio
  • In this scenario “the first available transaction in the complete portfolio” is the observed
  • Note: The values on the heatmap are wrong for all month before the first buy AND for the month in which the first buy occurs!

Simple test:

  • If you remove the account C1 and all its transactions, the values in the heatmap widget change i.e. they turn to expected values.
  • This shall not happen as C1 has no connection to data series selected for the widget

Possible root-cause:

  • Wrong data series for the widget when a benchmark is selected to calculate the excess returns
  • Somehow the transactions in the entire portfolio that are older that the first transaction in the selected data series influence the heatmap widget

Further related(?) issue:

  • An influence of older transactions is also observed in the The Yearly heatmap when benchmarks are added as data series to the widged
  • This issue is not further analyzed but it might have the same root cause.

It’s highly appreciated if you could create an example xml.

Thanks.

test_heatmap.xml (118.9 KB)

This is the test scenario that was described on the post.

Hi, just wanted to ask if there are any updates on this issue. Thanks.