Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    Which file?

    General Discussion
    2
    4
    107
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      hanaan last edited by

      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)
      
      E 1 Reply Last reply Reply Quote 0
      • E
        EMR @hanaan last edited by

        @hanaan Which errors ?

        H 1 Reply Last reply Reply Quote 0
        • H
          hanaan @EMR last edited by

          @emr

          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'
          
          1 Reply Last reply Reply Quote 0
          • E
            EMR last edited by

            @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

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors