Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. chandler song
    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 2
    • Best 0
    • Groups 0

    chandler song

    @chandler song

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

    chandler song Unfollow Follow

    Latest posts made by chandler song

    • RE: how efficient to compare one Indicator base on multi datafeed

      add more comment to make my question clear.

      what I want to do is compare multi Indicator to get max one

      self.one_pct = bt.indicators.RateOfChange(self.datas[0].close, period=1)
      self.two_pct = bt.indicators.RateOfChange(self.datas[1].close, period=1)
      self.three_pct = bt.indicators.RateOfChange(self.datas[2].close, period=1)
      .....
      self.n_pct = bt.indicators.RateOfChange(self.datas[n-1].close, period=1)
      

      what I want to do is find the max one and buy like below

      max_stock=findMaxpct()
      self.buy(data=max_stock)
      

      how to implement the find_max_pct efficient?

      posted in General Code/Help
      chandler song
      chandler song
    • how efficient to compare one Indicator base on multi datafeed

      if I have 2 data feeds, google and facebook.

      self.google_pct = bt.indicators.RateOfChange(self.datas[0].close, period=1)
      self.facebook_pct = bt.indicators.RateOfChange(self.datas[1].close, period=1)
      

      what I want to do is to buy which has bigger pct. like below

       if self.google_pct[0] > self.facebook_pct[0]:
          buy google
      else:
         buy facebook
      

      if there are n data feeds, what's the efficient way to find the data feed with max pct?

      posted in General Code/Help
      chandler song
      chandler song