Skip to content

fix: forward match_dates to metrics() in html/full/basic - #536

Open
kelvingao wants to merge 1 commit into
ranaroussi:mainfrom
kelvingao:fix/match-dates-forwarding
Open

fix: forward match_dates to metrics() in html/full/basic#536
kelvingao wants to merge 1 commit into
ranaroussi:mainfrom
kelvingao:fix/match-dates-forwarding

Conversation

@kelvingao

Copy link
Copy Markdown

Problem

The match_dates parameter in html(), full(), and basic() is only applied to the top-level _match_dates() call, but is not forwarded to the internal metrics() call. This means the metrics table always uses match_dates=True (the default), regardless of what the caller passes.

In html(), this causes a data inconsistency:

  • Charts correctly use match_dates=False → shows full benchmark cumulative return
  • Key Performance Metrics table silently defaults to match_dates=True → truncates benchmark data

Fix

Forward match_dates=match_dates to all metrics() call sites — 5 total across html(), full(), and basic():

Function Mode Fixed
html()
full() notebook
full() console
basic() notebook
basic() console

Related

This was discovered when passing match_dates=False to qs.reports.html() to preserve pre-computed benchmark data during a strategy warmup period. The charts showed the correct benchmark cumulative return, but the metrics table showed a truncated value.

The match_dates parameter in html(), full(), and basic() was only
applied to the _match_dates() call at the top level, but was not
forwarded to the internal metrics() call. This caused the metrics
table to always use match_dates=True (the default), regardless of
what the caller specified.

In html(), this made the Key Performance Metrics table use different
benchmark data than the charts when match_dates=False was passed.

Fix: pass match_dates=match_dates to all metrics() calls within
html(), full(), and basic() (5 call sites total).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant