Backtrader Community

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. Micahel Wei
    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 0
    • Posts 1
    • Best 0
    • Controversial 0
    • Groups 0

    Micahel Wei

    @Micahel Wei

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

    Micahel Wei Unfollow Follow

    Latest posts made by Micahel Wei

    • RE: Unable to get indicators to work

      @Tomas
      I am also new to Backtrader and I got the same issue.

      I tried to check the code and did the following changes to work:

      Add a MovingAverageSimple indicator

          self.sma = bt.indicators.SimpleMovingAverage(self.datas[0].close, period = self.params.myperiod)
      

      or
      self.sma = bt.indicators.SimpleMovingAverage(self.dataclose, period = self.params.myperiod)

      Good luck!

      posted in General Code/Help
      Micahel Wei
      Micahel Wei