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/

    Python breaking. No idea why

    General Code/Help
    1
    2
    943
    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.
    • T
      Taewoo Kim last edited by Taewoo Kim

      Sorry for complete noob'ness

      my backtests were so slow, so I was looking at optimization strategies.. I wanted to use pypy - to check the version, i ran "python3 -v", instead of "python3 -V".... i'm sure this isn't the reason, but ever since then, I keep getting this error

      Traceback (most recent call last):
        File "fx_det_SR.py", line 686, in <module>
          thestrats = cerebro.run()
                      -> <backtrader.cerebro.Cerebro object at 0x0000009591CD64E0>
        File "C:\Python36\lib\site-packages\backtrader\cerebro.py", line 873, in run
          runstrat = self.runstrategies(iterstrat)
                     |                  -> ((<class '__main__.TKdeter'>, (), {'timeframes': [{'timeframe': '24H', 'num_bars_in_sr': 10, 'vol_significance': 0.5}, {'timef...
                     -> <backtrader.cerebro.Cerebro object at 0x0000009591CD64E0>
        File "C:\Python36\lib\site-packages\backtrader\cerebro.py", line 988, in runstrategies
          strat._start()
          -> <__main__.TKdeter object at 0x0000009591CFB400>
        File "C:\Python36\lib\site-packages\backtrader\strategy.py", line 346, in _start
          analyzer._start()
          -> <backtrader.analyzers.drawdown.TimeDrawDown object at 0x0000009591D51550>
        File "C:\Python36\lib\site-packages\backtrader\analyzer.py", line 302, in _start
          self.dtcmp, self.dtkey = self._get_dt_cmpkey(datetime.datetime.min)
          |           |            |                   -> <module 'datetime' from 'C:\\Python36\\lib\\datetime.py'>
          |           |            -> <backtrader.analyzers.drawdown.TimeDrawDown object at 0x0000009591D51550>
          |           -> <backtrader.analyzers.drawdown.TimeDrawDown object at 0x0000009591D51550>
          -> <backtrader.analyzers.drawdown.TimeDrawDown object at 0x0000009591D51550>
        File "C:\Python36\lib\site-packages\backtrader\analyzer.py", line 375, in _get_dt_cmpkey
          dtcmp, dtkey = self._get_subday_cmpkey(dt)
                         |                       -> datetime.datetime(1, 1, 1, 0, 0)
                         -> <backtrader.analyzers.drawdown.TimeDrawDown object at 0x0000009591D51550>
        File "C:\Python36\lib\site-packages\backtrader\analyzer.py", line 429, in _get_subday_cmpkey
          dtcmp -= tadjust
          |        -> datetime.timedelta(0, 60)
          -> datetime.datetime(1, 1, 1, 0, 0)
      OverflowError: date value out of range
      

      I've been wrestling this thing for last 4 hours with no luck. I haven't updated any modules, installed any thing, nada.

      ANyone have any suggestions? FYI i ran this on same dataset with same parameters that was working last night. It just "broke".

      T 1 Reply Last reply Reply Quote 0
      • T
        Taewoo Kim @Taewoo Kim last edited by

        never mind.. the problem disappeared randomly ..

        odd

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