Got nan value when resampling my own lines in data
-
Hi all,
I met some problem when resampling my own datafeeds. Besides the default lines OHLC , vol and oi, I added some other lines into data such as PE and Volatility. when I resample it, it's ok for the OHLC, vol,and oi, but my own lines are all nan value. Is there any other params I need to set in the cerebro.resampledata(data, kwargs**)?
-
@alicc BTW, what I need is just keep the last value of my own lines, Thanks
-
The resampler doesn't know anything about your extra lines and that's why the values aren't carried forward.
-
@backtrader is there any to do with it, e.g to keep the last value of the timeframe?
-
@backtrader I fo the update func in_Bar class and I'm planing to rewrite the update func. But how can I get all lines of a GenericCSVData object, thanks!!!
-
Why don't you consider putting the extra values in an indicator and work straightforward with them?
-
@backtrader Because I have computed many statistics, I thought it cannot be uploaded to indicators; BTW can I just upload the statistic already calculated to indicators?
-
@backtrader I think it's more convenient for me to put the lines into data, because what I am testing is option. I have several option hot contracts of current month and next month with different strikes from 2015-2019 in 1 minute freq. It's time consuming to compute greeks and iv every minute when testing, especially when I need to test different strategy parameters. And there are other statistics like strike price and put/call type. So I first compute all the statistics. Anyway, Can I directly put the statistics already computed into indicators. If not , how could I resample these statistic, just keep the last one . the followings are my lines, thanks