fix: forward match_dates to metrics() in html/full/basic - #536
Open
kelvingao wants to merge 1 commit into
Open
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
match_datesparameter inhtml(),full(), andbasic()is only applied to the top-level_match_dates()call, but is not forwarded to the internalmetrics()call. This means the metrics table always usesmatch_dates=True(the default), regardless of what the caller passes.In
html(), this causes a data inconsistency:match_dates=False→ shows full benchmark cumulative returnmatch_dates=True→ truncates benchmark dataFix
Forward
match_dates=match_datesto allmetrics()call sites — 5 total acrosshtml(),full(), andbasic():html()full()full()basic()basic()Related
This was discovered when passing
match_dates=Falsetoqs.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.