You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
frombacktesting.libimportplot_heatmaps
...
stats, heatmap=bt.optimize(a_test_param=range(5), maximize='Equity Final [$]', return_heatmap=True)
plot_heatmaps(heatmap, agg='mean')
The error is raised when plot_heatmaps() run.
I think, the reason is that for a graph with two axes (X, Y) need at least 2 optimized variables. Therefore, this method does not accept the heatmap that is derived from bt.optimize() that was run with only one parameter to be optimized.
Additional info
Backtesting version: 0.3.3
The text was updated successfully, but these errors were encountered:
Heatmap plots requires at least two parameters (variables) in the heatmap Series. Add an assert before calling _plot_heatmap to guard against the case of having only 1 variable.
siufai6
added a commit
to siufai6/backtesting.py
that referenced
this issue
Aug 4, 2023
Expected Behavior
Fix the mistake or make it a normal explanation.
Actual Behavior
There
dfs
specified in the error is an empty [].Steps to Reproduce
The error is raised when
plot_heatmaps()
run.I think, the reason is that for a graph with two axes (X, Y) need at least 2 optimized variables. Therefore, this method does not accept the
heatmap
that is derived frombt.optimize()
that was run with only one parameter to be optimized.Additional info
The text was updated successfully, but these errors were encountered: