Which file?
-
As many before, I'm looking to change the chart style of the main plot chart to bar type.
I changed several other plot params in /backtrader/observers/, but cannot for the life of my find where to alter the parameters for that main chart.Thank you for pointing me in the right direction...
#2:
Is bokeh still a thing?
I import it, follow instructions, yet getting errors.
Code:b = Bokeh(style='bar', plot_mode='single') cerebro.plot(b)
-
@hanaan Which errors ?
-
Finished with error: 'LinesOperation' object has no attribute 'size' Traceback (most recent call last): File "/Users/hanaan/PycharmProjects/BotConda/main.py", line 132, in <module> File "/Users/hanaan/PycharmProjects/BotConda/main.py", line 114, in main cerebro.plot(b) File "/Users/hanaan/opt/anaconda3/envs/BotConda/lib/python3.9/site-packages/backtrader/cerebro.py", line 989, in plot rfig = plotter.plot(strat, figid=si * 100, File "/Users/hanaan/opt/anaconda3/envs/BotConda/lib/python3.9/site-packages/backtrader_plotting/bokeh/bokeh.py", line 511, in plot df: pd.DataFrame = self.build_strategy_data(obj, start, end) File "/Users/hanaan/opt/anaconda3/envs/BotConda/lib/python3.9/site-packages/backtrader_plotting/bokeh/bokeh.py", line 473, in build_strategy_data for lineidx in range(obj.size()): AttributeError: 'LinesOperation' object has no attribute 'size'
-
@hanaan Hard to answer without the full code but it do not, at first sight, seems to me to be related to backtrader_plotting. I ran the example code from backtrader_plotting github without error. I guess you have tested your code with other plotting lib, including the one coming with backtrader ? If not, this may be a first step. If you did so and that this error appear only with backtrader_plotting, maybe you can ask @vbs or get some help on the topic he created :
https://community.backtrader.com/topic/813/bokeh-integration-interactive-webbrowser-plotting?page=1