Python breaking. No idea why



  • 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".



  • never mind.. the problem disappeared randomly ..

    odd


Log in to reply
 

Looks like your connection to Backtrader Community was lost, please wait while we try to reconnect.