I've been playing around with this for a while, because ideally the plot would be fullscreen.
\nThis works for me, but the result (the panes not retaining designated aspect) is an issue I didn't find how to overcome.
bt = Backtest(...)\nfig = bt.plot(open_browser=False)\nfig.sizing_mode = 'stretch_both'\nfrom bokeh.io import show\nshow(fig)
If anybody finds a way to make them look pretty, please open a PR.
","upvoteCount":1,"url":"https://github.com/kernc/backtesting.py/discussions/1199#discussioncomment-12106044"}}}-
Hi guys, is there a way to override 'plot' method to make the scalable height of the chart or at least to set some height? self.sma2[-1]:
self.buy()
elif self.sma1[-1] < self.sma2[-1]:
self.sell()
# Run the backtest with the customized plot
bt = CustomBacktest(GOOG, SmaCross, cash=10_000, commission=0.002)
stats = bt.run()
bt.plot()">
|
Beta Was this translation helpful? Give feedback.
-
Referring to the documentation of Backtesting.py, it states that 'The height is currently non-adjustable.' Therefore, you likely won't be able to achieve your desired outcome using the built-in bt.plot(). Alternatively, you might consider exporting the necessary data to Excel to create the chart. |
Beta Was this translation helpful? Give feedback.
-
I've been playing around with this for a while, because ideally the plot would be fullscreen. bt = Backtest(...)
fig = bt.plot(open_browser=False)
fig.sizing_mode = 'stretch_both'
from bokeh.io import show
show(fig) If anybody finds a way to make them look pretty, please open a PR. |
Beta Was this translation helpful? Give feedback.
I've been playing around with this for a while, because ideally the plot would be fullscreen.
This works for me, but the result (the panes not retaining designated aspect) is an issue I didn't find how to overcome.
If anybody finds a way to make them look pretty, please open a PR.