Hey guys, my Issue is that I want to read a custom csv file and add the data but something goes wrong and no data is actually added I guess, resulting in the error
AttributeError: 'Plot_OldSync' object has no attribute 'mpyplot'
My Code for the custom data is the following:
datapath = os.path.join(modpath, 'datas\\Coinbase_BTCUSD_1h.csv')
datef = '%Y-%m-%d %I-%p'
data = bt.feeds.GenericCSVData(
dataname=datapath,
fromdate=datetime.datetime(2017, 7, 1, 11),
todate=datetime.datetime(2020, 8, 14, 22),
dtformat=datef,
reverse=True,
# specifying columns
datetime=0,
open=2,
high=3,
low=4,
close=5,
volume=7,
openinterest=-1
)
The CSV file I am trying to read has the following format:
Date,Symbol,Open,High,Low,Close,Volume BTC,Volume USD
2020-08-14 10-PM,BTCUSD,11777.33,11797.52,11734.83,11797.52,298.79,3514421.22
2020-08-14 09-PM,BTCUSD,11774.77,11794.63,11714.1,11777.33,674.78,7933568.87
2020-08-14 08-PM,BTCUSD,11815.28,11838.65,11751.54,11774.77,719.56,8482977.35
If I try to convert the the time string manually using
test = datetime.datetime.strptime('2020-08-14 10-PM', '%Y-%m-%d %I-%p')
print(test)
I get the time I would expect.
Any help would be really appreciated, also do you have some tips for debugging? How can I read out the values of the data while debugging (I am using PyCharm), it just seems like it is an infinitely recursive list, I just want to access the data that has been read so I can confirm what the mistake is in the future.
Thank you all in advance :)