Hi I am looking at algo that uses fetch_csv to retrieve data from quandl. The problem is that the data is often 1 day or more late. So the I will pretty much always get the NaN during live trading I think it's because it can't find today's date row. Is there a way to just pick the first row's data, no matter how old it is?
fetch_csv('https://www.quandl.com/api/v1/datasets/CHRIS/CBOE_VX1.csv',
date_column='Trade Date',
date_format='%Y-%m-%d',
symbol='v1',
post_func=rename_col1)
def rename_col1(df):
df = df.rename(columns={'Close': 'price','Trade Date': 'Date'})
df = df.fillna(method='ffill')
df = df[['price', 'Settle','sid']]
# Shifting data by one day to avoid forward-looking bias
return df.shift(1)