kernc / backtesting.py

:mag_right: :chart_with_upwards_trend: :snake: :moneybag: Backtest trading strategies in Python.
https://kernc.github.io/backtesting.py/
GNU Affero General Public License v3.0
5.39k stars 1.05k forks source link

Update lib.py to fix #901 #1037

Open siufai6 opened 1 year ago

siufai6 commented 1 year ago

Fixes https://github.com/kernc/backtesting.py/issues/901

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.