Closed
Description
Expected Behavior
Plot output to browser should look almost the same with or without bt.plot(show_legend=False)
.
When I run bt.plot()
my output looks as expected.
Actual Behavior
When run bt.plot(show_legend=False)
my output is slow to load and comes out distorted.
example picture here.
Steps to Reproduce
from backtesting import Backtest, Strategy
from backtesting.lib import crossover
from backtesting.test import SMA, GOOG
class SmaCross(Strategy):
n1 = 10
n2 = 20
def init(self):
close = self.data.Close
self.sma1 = self.I(SMA, close, self.n1)
self.sma2 = self.I(SMA, close, self.n2)
def next(self):
if crossover(self.sma1, self.sma2):
self.buy()
elif crossover(self.sma2, self.sma1):
self.sell()
bt = Backtest(GOOG, SmaCross,
cash=10000, commission=.002,
exclusive_orders=True)
output = bt.run()
bt.plot(show_legend=False)
Additional info
I am using backtesting version 0.3.0
bokeh is version 2.2.1
Browser is chrome