Dear Alpaca team,
Thanks for providing such a very good API together with the python bindings.
I’m trying to understand the meaning of the snapshot daily bars. For instance:
>>> print(api.get_bars('AAPL', TimeFrame.Day, start='2022-08-12', end='2022-08-15'))
[Bar({ 'c': 172.1,
'h': 172.17,
'l': 169.4,
'n': 557290,
'o': 169.87,
't': '2022-08-12T04:00:00Z',
'v': 67989796,
'vw': 171.076181}), Bar({ 'c': 173.19,
'h': 173.39,
'l': 171.345,
'n': 501625,
'o': 171.5,
't': '2022-08-15T04:00:00Z',
'v': 54091694,
'vw': 172.625371})]
>>> sn = api.get_snapshot('AAPL')
>>> print(sn.prev_daily_bar)
BarV2({ 'c': 172.01,
'h': 172.01,
'l': 169.42,
'n': 12362,
'o': 169.94,
't': '2022-08-12T04:00:00Z',
'v': 1208489,
'vw': 170.906696})
>>> print(sn.daily_bar)
BarV2({ 'c': 173.19,
'h': 173.385,
'l': 171.35,
'n': 8558,
'o': 171.52,
't': '2022-08-15T04:00:00Z',
'v': 786184,
'vw': 172.62003})
The snapshot daily bar volume is orders of magnitude different from the obtained volume of the get_bars function (here the snapshot is obtained when the market is closed and uses IEX). Does it mean that the daily snapshot bar is not based on a day timeframe? I will have expected the snapshot daily bar to be a cumulative of the minute bars of the current market clock and therefore at the end of the day to match the daily bar obtained with get_bars. I try to use the snapshot daily bar to compute the relative volume live and therefore I expect a minute-based cumulative volume over the market day.
Thanks!