-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Expected Behavior
(Same as what's displayed in the readme of the backtesting repo)
Actual Behavior
BokehDeprecationWarning: Passing lists of formats for DatetimeTickFormatter scales was deprecated in Bokeh 3.0. Configure a single string format for each scale
/home/jenko/.local/lib/python3.10/site-packages/bokeh/models/formatters.py:399: UserWarning: DatetimeFormatter scales now only accept a single format. Using the first prodvided: '%d %b'
warnings.warn(f"DatetimeFormatter scales now only accept a single format. Using the first prodvided: {fmt[0]!r} ")
BokehDeprecationWarning: Passing lists of formats for DatetimeTickFormatter scales was deprecated in Bokeh 3.0. Configure a single string format for each scale
/home/jenko/.local/lib/python3.10/site-packages/bokeh/models/formatters.py:399: UserWarning: DatetimeFormatter scales now only accept a single format. Using the first prodvided: '%m/%Y'
warnings.warn(f"DatetimeFormatter scales now only accept a single format. Using the first prodvided: {fmt[0]!r} ")
Steps to Reproduce
- pip install backtesting
- copy code from repo readme to demo.py
- run code in python 3.10.6 on Ubuntu 20.04.1 LTS as "python demo.py"
from backtesting import Backtest, Strategy
from backtesting.lib import crossover
from backtesting.test import SMA, GOOG
class SmaCross(Strategy):
def init(self):
price = self.data.Close
self.ma1 = self.I(SMA, price, 10)
self.ma2 = self.I(SMA, price, 20)
def next(self):
if crossover(self.ma1, self.ma2):
self.buy()
elif crossover(self.ma2, self.ma1):
self.sell()
bt = Backtest(GOOG, SmaCross, commission=.002,
exclusive_orders=True)
stats = bt.run()
bt.plot()
Additional info
- Backtesting version: 0.?.?
pip freeze | grep -i backtesting
Backtesting==0.3.3
This error is triggered by the line
bt.plot()
if I comment it out, there are no errors.
ShubhamBhut and arturnawrot
Metadata
Metadata
Assignees
Labels
No labels