Skip to content

Commit

Permalink
Merge pull request ranaroussi#166 from yarimiz/include-benchmark-name…
Browse files Browse the repository at this point in the history
…-in-html

adding benchmark name to html report
  • Loading branch information
ranaroussi authored Apr 23, 2022
2 parents b62499a + de61104 commit 5724071
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions quantstats/report.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<div class="container">

<h1>{{title}} <dt>{{date_range}}</dt></h1>
<h4>{{benchmark_title}}</h4>
<h4>Generated by <a href="http://quantstats.io" target="quantstats">QuantStats</a> (v. {{v}})</h4>
<hr>

Expand Down
1 change: 1 addition & 0 deletions quantstats/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def html(returns, benchmark=None, rf=0., grayscale=False,
# prepare timeseries
returns = _utils._prepare_returns(returns)
if benchmark is not None:
tpl = tpl.replace('{{benchmark_title}}', f"Benchmark is {benchmark}")
benchmark = _utils._prepare_benchmark(benchmark, returns.index, rf)
if match_dates is True:
returns, benchmark = _match_dates(returns, benchmark)
Expand Down

0 comments on commit 5724071

Please sign in to comment.