Backtrader Community

    • 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/

    Exception in lineseries

    General Discussion
    4
    2
    1038
    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.
    • R
      rastegarr last edited by backtrader

      I'm testing a modified version of the ibtest.py with about 50 symbols. When it finally get connected and symbols go live I get an exception in lineseries.py that I'm not able to resolve:

      ValueError:  __len__() should return >= 0
      

      it breaks here:

       def __len__(self):
            Proxy line operation
              '''
              return len(self.lines[0])
      

      I have not modified any files or modules except the ibtest.py. The modification of ibtest.py is straightforward and I am able to get live data for even 20 symbols with no problem. The exception happens when I am working with higher number of symbols. I can provide the code if you're interested.

      I run the program with these arguments:

        --port 4001 --no-backfill_start --resample --timeframe Minutes --compression 1 --clientId 1111
      

      and I connect to IB Gateway in Windows and program is running in Debug Mode python 3.

      1 Reply Last reply Reply Quote 0
      • B
        backtrader administrators last edited by

        A full exception trace would be a lot more useful than the selected final line, which only says that something hasn't got a length.

        The full trace will give hints as to where the error was triggered and not where the error finally happened.

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