TypeError and Warnings with Bokeh 2.3.3 in Backtesting.py Plotting #1071
Unanswered
djodjobadi
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am encountering an issue while using backtesting.py for my trading strategy backtesting, specifically when attempting to plot the results of an optimization. I am receiving a TypeError along with several warnings related to Bokeh's DatetimeTickFormatter and toolbar properties. Below are the details of the issue:
Environment:
Code Snippet:
from backtesting import Strategy, Backtest
from backtesting.lib import resample_apply
class System(Strategy):
d_rsi = 30 # Daily RSI lookback periods
w_rsi = 30 # Weekly
level = 70
from backtesting import Strategy, Backtest
from backtesting.lib import resample_apply
class System(Strategy):
d_rsi = 30 # Daily RSI lookback periods
w_rsi = 30 # Weekly
level = 70
from backtesting.test import GOOG
backtest = Backtest(GOOG, System, commission=.002)
backtest.run()
backtest.optimize(d_rsi=range(10, 35, 5),
w_rsi=range(10, 35, 5),
level=range(30, 80, 10))
backtest.plot()
Error Message:
BokehDeprecationWarning: Passing lists of formats for DatetimeTickFormatter scales was deprecated in Bokeh 3.0. Configure a single string format for each scale ... UserWarning: DatetimeFormatter scales now only accept a single format. Using the first provided: '%d %b' ... UserWarning: found multiple competing values for 'toolbar.active_drag' property; using the latest value ... TypeError: bokeh.models.tools.Toolbar() got multiple values for keyword argument 'logo'
When I attempt to plot the results of a backtest optimization using the above code snippet, I encounter the aforementioned warnings and error. The warnings seem to suggest that there are deprecated usages of DatetimeTickFormatter and conflicting toolbar property values in the underlying _plotting.py of backtesting.py. The TypeError appears to be related to the 'logo' keyword argument in Bokeh's Toolbar model.
I have tried using different versions of Bokeh and backtesting.py to see if the issue persists across versions.
I have searched through existing issues in this repository and relevant forums but have not found a solution that addresses this problem.
I would greatly appreciate any guidance on how to resolve this issue, and I am happy to provide any additional information if needed. Thank you in advance for your time and assistance!
Beta Was this translation helpful? Give feedback.
All reactions