Interactive Brokers API delivers for this request:
spzValue = ib.reqHistoricalData(spx, endDateTime='', durationStr='7200 S', barSizeSetting='1 hour', whatToShow='TRADES', useRTH =False)
the following output for the variable "spxValue":
[BarData(date=datetime.datetime(2019, 7, 19, 20, 0), open=200.59, high=200.7, low=199.69, close=199.76, volume=97, average=200.045, barCount=87), BarData(date=datetime.datetime(2019, 7, 19, 21, 0), open=199.66, high=199.67, low=198.19, close=198.21, volume=369, average=198.969, barCount=322)]
Somehow I am not succeeding in getting the elements out of this list nor in converting it into a DataFrame via:
df = util.df(spzValue)
Does anyone have any suggestions how I can select specific elements out of the list "BarData"? For example I would like to have the "close" value 199.76 for the first bar.
Thanks in advance.