Backtrader Community

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

    guslijif

    @guslijif

    0
    Reputation
    1
    Profile views
    4
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    guslijif Unfollow Follow

    Latest posts made by guslijif

    • RE: problem newly happened

      @backtrader res is a lib that I used to get the stock data frame by entering the stock code,I followed the documentation but still got the same error :

      This is the code I have changed:
      17965b0e-9e0f-452d-afc6-19679633a587-image.png
      This is the dataframe that I feed in:
      c5528f5e-8582-468d-970d-b3dc2d56abee-image.png
      This is the output:
      fb996702-54aa-4516-99dd-19ffc1418470-image.png

      This problem is actually very weird because the strategy works properly before 2022-11-01. but after that day, it suddenly crashed. and this problem happens in some code stocks(actually happens in ETF 510760), for others, it works fine.

      posted in General Code/Help
      guslijif
      guslijif
    • RE: problem newly happened

      @backtrader Here I use getETFdata method which will return a dataframe that I provide picture above.
      this pic show how I feed the data:
      8af3942c-37c6-452e-8299-a9813a9bccb7-image.png

      posted in General Code/Help
      guslijif
      guslijif
    • RE: problem newly happened

      @backtrader 08c530e3-4a58-46b3-90d9-deb23563242b-image.png

      this is the data and data types that I feed in

      posted in General Code/Help
      guslijif
      guslijif
    • problem newly happened

      This problem never happened before:
      not sure where goes wrong or maybe something wrong with the data feed?

      Traceback (most recent call last):
      File "/newVolume/DataAnalysis/backEnd/backTest.PY", line 85, in <module>
      cerebro.run()
      File "/home/li/.local/lib/python3.8/site-packages/backtrader/cerebro.py", line 1132, in run
      runstrat = self.runstrategies(iterstrat)
      File "/home/li/.local/lib/python3.8/site-packages/backtrader/cerebro.py", line 1298, in runstrategies
      self._runonce(runstrats)
      File "/home/li/.local/lib/python3.8/site-packages/backtrader/cerebro.py", line 1693, in _runonce
      self._brokernotify()
      File "/home/li/.local/lib/python3.8/site-packages/backtrader/cerebro.py", line 1365, in _brokernotify
      self._broker.next()
      File "/home/li/.local/lib/python3.8/site-packages/backtrader/brokers/bbroker.py", line 1233, in next
      self._get_value() # update value
      File "/home/li/.local/lib/python3.8/site-packages/backtrader/brokers/bbroker.py", line 433, in _get_value
      comminfo = self.getcommissioninfo(data)
      File "/home/li/.local/lib/python3.8/site-packages/backtrader/broker.py", line 80, in getcommissioninfo
      if data._name in self.comminfo:
      AttributeError: 'int' object has no attribute '_name'

      posted in General Code/Help
      guslijif
      guslijif