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)



  • 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



  • 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


Log in to reply
 

});