Newbie to backtrader - CSV Data feed
Quy Bao Le last edited by
I tried to feed data from CSV but it didn't work
My CSV data is as below
My code is
import backtrader.feeds as btfeeds
params = (
('fromdate', datetime.datetime(2017, 12, 1)),
('todate', datetime.datetime(2017, 12, 31)),
data = MyOHLC(dataname='E:\Data\HPG.csv')
The result is always None.
Somebody please help.
Thanks a lot
Paska Houso last edited by
To start with ... that won't for sure match the (not fully displayed) column for datetime which has this format:
%Y%m%dand possibly more content after that.
To continue with:
An Excel table is not CSV. Your intention is clear, but it would be better if you showed the actual CSV data (a couple of lines suffice)
You can read the remark at the top ... and format your code easily (that will make it easier for others to read and help)
A complete sample (as small as possible) is always a lot more helpful than out of context snippets.