-1

Thank you in advance for any help!

I'm trying to backtest a very simple moving average cross over strategy in Python. I'm using the Jupyter notebook.

I've installed and imported backtrader and matplotlib. However, I'm unable to plot anything and I can't figure out this bug :/

I'm a fairly successful trader but am new to python. Thank you for your help!

First half of my code! Second half of my code!

TLS
  • 31
  • 4

1 Answers1

0

The issue is addressed in https://github.com/mementum/backtrader/pull/418 and this patch is the latest commit to master, but there hasn't been a release since 2019-05.

You can install the patched version like so:

pip install git+https://github.com/mementum/backtrader.git@0fa63ef4a35dc53cc7320813f8b15480c8f85517#egg=backtrader

You could alternatively specify the required commit in requirements.txt like so:

pip install -e git+https://github.com/mementum/backtrader.git@0fa63ef4a35dc53cc7320813f8b15480c8f85517#egg=backtrader
doomdaam
  • 691
  • 1
  • 6
  • 21