This is my code
def rename_col0(df0):
df0 = df0.rename(columns={'Close': 'price'})
df0 = df0.fillna(method='ffill')
df0 = df0[['price', 'Adjusted Close','sid']]
# Do not shift as this will be used live
return df0.shift(0)
fetch_csv('https://www.quandl.com/api/v3/datasets/YAHOO/INDEX_VIX.csv',
date_column='Date',
date_format='%Y-%m-%d',
symbol='v',
post_func=rename_col0)
log.info("Vix %.2f" %data.current('v','Adjusted Close'))
This is giving the error
2016-05-03 08:31 my_rebalance:95 INFO Vix nan
It works fine in backtesting (where I shift by 1 to avoid look ahead bias)
Help! Please!!