Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    Re: [Issue with extending a data feed](/topic/2298/issue-with-extending-a-data-feed)

    General Code/Help
    2
    2
    87
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • sirbradflies
      sirbradflies last edited by

      Re: Issue with extending a data feed

      As I was tinkering with my code I realized that if I use cerebro.adddata(datafeed) insead of cerebro.resampledata(datafeed, timeframe=bt.TimeFrame.Days) the issue with the 'nan' value is solved! Any idea on why the resampledata may not work with custom fields?

      Thanks again

      1 Reply Last reply Reply Quote 0
      • vladisld
        vladisld last edited by

        AFAIU, upon resampling new bars are built aggregating the information from the originals bars of the feed with a smaller timeframe. Those new bars have no knowledge about the non-standard attributes of the originals bars ( only datetime, high, low, open, close, volume and openinterest fields are processed), nor they know anything about how to aggregate such fields. This may explain the behavior you saw.

        Thanks
        Vlad

        1 Reply Last reply Reply Quote 1
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors