Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fastquant fails to render backtest() result in Jupyter Notebook #382

Open
miohtama opened this issue Jul 22, 2021 · 0 comments
Open

fastquant fails to render backtest() result in Jupyter Notebook #382

miohtama opened this issue Jul 22, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@miohtama
Copy link

miohtama commented Jul 22, 2021

Problem description

fastquant fails to render backtest() result chart

Example

Running Lesson 2 Notebook on Google Colab here:

https://colab.research.google.com/github/enzoampil/fastquant-blog/blob/master/_notebooks/2020-03-09-lesson2-backtest-your-trading-strategy.ipynb

Expected behavior

I get a diagram for backtest function call result

image

Actual behavior

There is no diagram

image

Sometimes diagram may appear if I run the cell again. Sometimes not. Diagrams are definitely not rendered on Run all cells. The size of the diagram seems to be completely random. Most of the time it does not work.

image

image

It seems that render success only around 1/4 of time.

Environment

I tested 2x2 different Jupyter Notebook environments

  • Both Firefox and Chrome web browsers

  • Google Colab and locally running Jupyter Server on macOS

  • Making sure "Trusted Notebook" is on (see in the screenshots above)

Other

Other plots are rendered without problem, e.g. ones at the start of the notebook

image

This seems to be an underlying matplotlib library issue and affects vanilla Backtrader too. I spend some hours trying to figure out what is causing this and if it could be worked around by, for example, by forcing diagrams to be inline static PNg images. There is something in the Backtrader diagram, especially the backtest result, which causes Jupyter Notebook to choke.

I did not find any solution.

@miohtama miohtama added the bug Something isn't working label Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant