For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
How to correctly parse Time field in GenericCSVData?
-
Here's my csv data looks like:
2022/11/15,0905,1411,1418,1407,1417,33899,749118,0 2022/11/15,0910,1417,1419,1415,1418,23688,753590,0 2022/11/15,0915,1418,1419,1410,1410,20393,752823,0
the 2nd field indicates the time , I try to use GenericCSVData to parse the date and time
data = btfeeds.GenericCSVData( headers=False, dataname=file, fromdate=datetime.datetime(2000, 11, 15), todate=datetime.datetime(2022, 11, 16), nullvalue=0.0, dtformat=('%Y/%m/%d'), tmformat=('%H%M'), datetime=0, time=1, open=2, high=3, low=4, close=5, volume=6, openinterest=7 )
but when I try to use
self.datas[0].datetime.time(0)
to access time field in next() method, it always gives me 23:59:59.999989
Is there anything I understand incorrectly?
Any comments would be appreciatedThanks
-
@pan-harry Have to tried to specify the timeframe of your csv data ?
Like adding :
timeframe=bt.TimeFrame.Minutes, compression=5,