Error loading daily data when using todate
I'm trying to load daily data from .csv files, but
bt does not load any data from .csv file when using 'todate' parameter.
Using this command :
data = bt.feeds.GenericCSVData(dataname=dataname, seperatotr=',', dtformat='%Y-%m-%d', datetime=0, open=1, high=2, low=3, close=4, volume=5, openinterest=-1, adjclose=-1, reverse=True, timeframe=bt.TimeFrame.Days, compression=1, fromdate=datetime.datetime(2015, 1, 1), todate=datetime.datetime(2016, 1, 1) )
on this data :
removing the 'todate' parameter and bt is OK, but with the parameter bt loads no values for any .csv file
any idea how to fix this ?
@trade-prophet probably it happens cause your data is reversed in the .csv. but it is just a guess.
You are absolutely right, I see my mistake, GenericCSVData does not support reverse parameter.
Is there a way to reverse data in CSV file?
@trade-prophet it is a lot of different ways depending on your needs and situation. Couple examples: read into Excel, sort as required, save as .csv. Using pandas read as data frame, sort as required, save as .csv. Open in the text editor, copy - paste in necessary order, save.