Navigation

    Backtrader Community

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

    zmwang

    @zmwang

    0
    Reputation
    270
    Profile views
    9
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    zmwang Unfollow Follow

    Latest posts made by zmwang

    • RE: Is it possible to plot two data with different kinds of style?

      which means we cannot do that?

      posted in General Discussion
      Z
      zmwang
    • Is it possible to plot two data with different kinds of style?

      Here I have only the tick data of one stock. And I want to use the resample in backtrader as an indicator to see where to create an order on tick data. I accomplished it. But when I want to plot the figure, I want the tick data to be 'line' style and resampled data 'bar' or 'candlestick' style. Can it be done in backtrader?

      posted in General Discussion
      Z
      zmwang
    • RE: AttributeError: module 'backtrader.talib' has no attribute 'SMA'

      Thank you for point out the problem.

      posted in General Code/Help
      Z
      zmwang
    • RE: AttributeError: module 'backtrader.talib' has no attribute 'SMA'

      when I write a script which is named test.py

      import backtrader as bt
      print('SMA:', bt.talib.MA_Type.SMA)
      print('T3:', bt.talib.MA_Type.T3)

      and in command line, I use python3 test.py, it shows me the error.

      Traceback (most recent call last):
      File "test.py", line 2, in <module>
      print('SMA:', bt.talib.MA_Type.SMA)
      AttributeError: module 'backtrader.talib' has no attribute 'MA_Type'

      and I use locate ta-lib to see whether TA-Lib is installed, it shows

      /usr/local/bin/ta-lib-config
      /usr/local/include/ta-lib
      /usr/local/include/ta-lib/ta_abstract.h
      /usr/local/include/ta-lib/ta_common.h
      /usr/local/include/ta-lib/ta_defs.h
      /usr/local/include/ta-lib/ta_func.h
      /usr/local/include/ta-lib/ta_libc.h

      so I think TA-Lib is installed on my ubuntu. And I use sudo pip3 install TA-Lib, it shows

      Requirement already satisfied: TA-Lib in /usr/local/lib/python3.6/dist-packages
      Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from TA-Lib)

      however, the example can not be executed correctly. Why?

      posted in General Code/Help
      Z
      zmwang
    • RE: AttributeError: module 'backtrader.talib' has no attribute 'SMA'

      I‘m using Ubuntu 18.04, and download the source files from sourceforge. Next I cd into the directory and follow the instructions below.

      ./configure
      sudo make
      sudo make install

      and then I use command sudo pip3 install ta-lib

      posted in General Code/Help
      Z
      zmwang
    • RE: AttributeError: module 'backtrader.talib' has no attribute 'SMA'

      after installation of TA-Lib, I still have the problem.

      posted in General Code/Help
      Z
      zmwang
    • AttributeError: module 'backtrader.talib' has no attribute 'SMA'

      I'm trying to execute the examples on https://www.backtrader.com/blog/posts/2016-07-26-talib-integration/talib-integration.html, however I got this problem.

      AttributeError Traceback (most recent call last)
      <ipython-input-4-f67b7df8a734> in <module>()
      1 import backtrader as bt
      ----> 2 print(bt.talib.SMA.__doc__)
      AttributeError: module 'backtrader.talib' has no attribute 'SMA'

      posted in General Code/Help
      Z
      zmwang
    • RE: Is backtrader possible to backtest for HFT?

      Thank you for reply! I notice that there have been some discussion on the "Escape from OHLC Land", and we can build our own class that store the data we want. But when building strategy using buy, the error

      'Lines_LineSeries_DataSeries_OHLC_OHLCDateTime_Abst' object has no attribute 'close'

      shows up, and I notice that buy(data=None, size=None, price=None, plimit=None, exectype=None, valid=None, tradeid=0, oco=None, trailamount=None, trailpercent=None, parent=None, transmit=True, **kwargs), but when I set buy(price = self.data.BP1[0]), where BP1 is the data I specified in my own data feed, it also gives me the same error. So how to deal with such problem?

      posted in General Code/Help
      Z
      zmwang
    • Is backtrader possible to backtest for HFT?

      Newbie here, and fortunately found backtrader. My question is whether backtrader can be used directly in HFT or need to be edit to suit the HFT?

      posted in General Code/Help
      Z
      zmwang