Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add "Parameters Used" section in html report, user can store notes or…
… parameters for further reference.
  • Loading branch information
none2003 committed Aug 24, 2025
commit 03f64d15a6824f2b457e0797a090c73da0b3c635
5 changes: 5 additions & 0 deletions quantstats/report.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ <h3>Key Performance Metrics</h3>
<h3>Worst 10 Drawdowns</h3>
{{dd_info}}
</div>

<div id="param">
<h3>Parameters Used</h3>
{{parameters_info}}
</div>
</div>

</div>
Expand Down
7 changes: 7 additions & 0 deletions quantstats/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def html(
figfmt="svg",
template_path=None,
match_dates=True,
parameters: dict = None,
**kwargs,
):
"""
Expand Down Expand Up @@ -158,6 +159,8 @@ def html(
Path to custom HTML template file. Uses default if None
match_dates : bool, default True
Whether to align returns and benchmark start dates
parameters : dict, optional
Strategy parameters
**kwargs
Additional keyword arguments for customization:
- strategy_title: Custom name for the strategy
Expand Down Expand Up @@ -376,6 +379,10 @@ def html(
)
tpl = tpl.replace("{{dd_info}}", dd_html_table)

if parameters:
parameters_info = _pd.DataFrame(list(parameters.items()), columns=['Parameter', 'Value'])
tpl = tpl.replace("{{parameters_info}}", _html_table(parameters_info, False))

# Get active returns setting for plots
active = kwargs.get("active_returns", False)

Expand Down