Backtrader Community

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. ccjasia
    3. Posts
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
    C
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 4
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by ccjasia

    • RE: Anaconda Python and Backtrader

      Hi Administrator,

      Thanks for your reply.
      As I'm new to Python and Backtrader, what I would like to do is to focus on backtesting instead of setting up infrastructure. The previous issue is resovled by install the Ipy.

      My Target

      1. Learn Python so I can make use of Python to code my strategy
      2. Make use of BackTrader as my platform for backtesting

      Now, I've coded as simple strategy and run using "btrun", while it shows following errors. Appreciate if you can shed some light on this issue. In case btrun is not the appropriate tool to run the strategy, please advise which tool should be used instead. Thanks a lot !

      P.S. I install python via Anaconda

      g:\cd\Invest\Learn\TTCF\homework\TradingStrategy\Backtest\BackTrader\9HLCvs9O>btrun --data HSIhistdataTest.csv --strategy MyModuleORG.py
      Traceback (most recent call last):
      File "c:\users\charl\anaconda3\lib\runpy.py", line 184, in _run_module_as_main
      "main", mod_spec)
      File "c:\users\charl\anaconda3\lib\runpy.py", line 85, in run_code
      exec(code, run_globals)
      File "C:\Users\charl\Anaconda3\Scripts\btrun.exe_main
      .py", line 9, in <module>
      File "c:\users\charl\anaconda3\lib\site-packages\backtrader\btrun\btrun.py", line 119, in btrun
      runsts = cerebro.run()
      File "c:\users\charl\anaconda3\lib\site-packages\backtrader\cerebro.py", line 809, in run
      runstrat = self.runstrategies(iterstrat)
      File "c:\users\charl\anaconda3\lib\site-packages\backtrader\cerebro.py", line 872, in runstrategies
      data.preload()
      File "c:\users\charl\anaconda3\lib\site-packages\backtrader\feed.py", line 616, in preload
      while self.load():
      File "c:\users\charl\anaconda3\lib\site-packages\backtrader\feed.py", line 411, in load
      _loadret = self._load()
      File "c:\users\charl\anaconda3\lib\site-packages\backtrader\feed.py", line 638, in _load
      return self._loadline(linetokens)
      File "c:\users\charl\anaconda3\lib\site-packages\backtrader\feeds\btcsv.py", line 44, in _loadline
      y = int(dttxt[0:4])
      ValueError: invalid literal for int() with base 10: '14/0'

      posted in General Code/Help
      C
      ccjasia
    • RE: Anaconda Python and Backtrader

      OK. Thanks.
      I works now.

      Appreciate if more information can be put to the documentation so a newbie can understand more regarding the installation requirement, especially the one with no experience in python.

      posted in General Code/Help
      C
      ccjasia
    • RE: Anaconda Python and Backtrader

      Hi, I just key in "btrun" under windows command prompt and the error mentioned appears. I also try "btrun --help" but still same situation

      posted in General Code/Help
      C
      ccjasia
    • Anaconda Python and Backtrader

      Dear Sir / Madam,

      I'm new to Python and Backtrader. I just installed Python by installing the anaconda.

      When I try to run "btrun" of backtrader, following message show up, appreciate if you can advise if anything wrong with my installation.

      Traceback (most recent call last):
      File "c:\users\charl\anaconda3\lib\runpy.py", line 184, in run_module_as_main
      "main", mod_spec)
      File "c:\users\charl\anaconda3\lib\runpy.py", line 85, in run_code
      exec(code, run_globals)
      File "C:\Users\charl\Anaconda3\Scripts\btrun.exe_main
      .py", line 5, in <module>
      File "c:\users\charl\anaconda3\lib\site-packages\backtrader\btrun_init
      .py", line 24, in <module>
      from .btrun import btrun
      File "c:\users\charl\anaconda3\lib\site-packages\backtrader\btrun\btrun.py", line 41, in <module>
      ibdata=bt.feeds.IBData,
      AttributeError: module 'backtrader.feeds' has no attribute 'IBData'

      posted in General Code/Help
      C
      ccjasia
    • 1 / 1