Backtrader Community

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

    Controversial posts made by nimrare

    • RE: next() called multiple times with resampled data feeds

      UPDATE: I found out that this does not seem to be happening if I use the original data feed and only one resampled data feed like so:

      # convert the dataframe to a data feed, the timeframe of the original data feed must be set
      data = bt.feeds.PandasData(dataname=dataframe, timeframe=bt.TimeFrame.Minutes, compression=1, fromdate=fromdate, todate=todate, plot=True)
      
      # add the original data feed to cerebro
      cerebro.adddata(data)
      
      # add upsampled data feeds
      cerebro.resampledata(data, timeframe=bt.TimeFrame.Days, compression=1)
      

      If I run this, I don't get the duplicated timestamps as shown above. However, another thing that I noticed is that the close of a resampled bar will only be available during the next bar of the fast data feed (in the case above the minute data feed). Is this expected behavior?

      posted in General Discussion
      N
      nimrare
    • 1 / 1