Re: [Issue with extending a data feed](/topic/2298/issue-with-extending-a-data-feed)
sirbradflies last edited by
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?
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.