Skip to content

Commit 0853e96

Browse files
committed
DOC: Link plot-heatmaps in the tutorial
1 parent 9286232 commit 0853e96

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

backtesting/lib.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,15 @@ def plot_heatmaps(heatmap: pd.Series,
123123
open_browser: bool = True):
124124
"""
125125
Plots a grid of heatmaps, one for every pair of parameters in `heatmap`.
126+
See example in [the tutorial].
127+
128+
[the tutorial]: https://kernc.github.io/backtesting.py/doc/examples/Parameter%20Heatmap%20&%20Optimization.html#plot-heatmap # noqa: E501
126129
127130
`heatmap` is a Series as returned by
128131
`backtesting.backtesting.Backtest.optimize` when its parameter
129132
`return_heatmap=True`.
130133
131-
When projecting the n-dimensional heatmap onto 2D, the values are
134+
When projecting the n-dimensional (n > 2) heatmap onto 2D, the values are
132135
aggregated by 'max' function by default. This can be tweaked
133136
with `agg` parameter, which accepts any argument pandas knows
134137
how to aggregate by.
@@ -491,7 +494,7 @@ def next(self):
491494

492495
class FractionalBacktest(Backtest):
493496
"""
494-
A `backtesting.Backtest` that supports fractional share trading
497+
A `backtesting.backtesting.Backtest` that supports fractional share trading
495498
by simple composition. It applies roughly the transformation:
496499
497500
df = (df / satoshi).assign(Volume=df.Volume * satoshi)

doc/examples/Parameter Heatmap & Optimization.ipynb

+3-1
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,9 @@
846846
"Since our strategy contains several parameters, we might be interested in other relationships between their values.\n",
847847
"We can use\n",
848848
"[`backtesting.lib.plot_heatmaps()`](https://kernc.github.io/backtesting.py/doc/backtesting/lib.html#backtesting.lib.plot_heatmaps)\n",
849-
"function to plot interactive heatmaps of all parameter combinations simultaneously."
849+
"function to plot interactive heatmaps of all parameter combinations simultaneously.\n",
850+
"\n",
851+
"<a id=plot-heatmaps></a>"
850852
]
851853
},
852854
{

doc/examples/Parameter Heatmap & Optimization.py

+2
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ def next(self):
160160
# We can use
161161
# [`backtesting.lib.plot_heatmaps()`](https://kernc.github.io/backtesting.py/doc/backtesting/lib.html#backtesting.lib.plot_heatmaps)
162162
# function to plot interactive heatmaps of all parameter combinations simultaneously.
163+
#
164+
# <a id=plot-heatmaps></a>
163165

164166
# +
165167
from backtesting.lib import plot_heatmaps

0 commit comments

Comments
 (0)