0
$\begingroup$
import yfinance as yf
data = yf.Ticker('CFLT').history(interval='1m', start='2021-07-09', end='2021-07-10')

Using the above python3 code, I can get the minutely data of a stock.

>>> data
                                Open       High        Low  ...  Volume  Dividends  Stock Splits
Datetime                                                    ...
2021-07-09 09:30:00-04:00  42.500000  42.830002  42.500000  ...    7214          0             0
2021-07-09 09:31:00-04:00  42.799999  43.000000  42.750000  ...     876          0             0
2021-07-09 09:32:00-04:00  43.209999  43.636002  43.000000  ...    1611          0             0
2021-07-09 09:35:00-04:00  42.682999  42.682999  42.682999  ...     297          0             0
2021-07-09 09:39:00-04:00  42.750000  42.750000  42.750000  ...     178          0             0
...                              ...        ...        ...  ...     ...        ...           ...
2021-07-09 15:55:00-04:00  45.849998  45.849998  45.745602  ...    2900          0             0
2021-07-09 15:56:00-04:00  45.590000  45.590000  45.520000  ...     931          0             0
2021-07-09 15:57:00-04:00  45.490002  45.790001  45.490002  ...     390          0             0
2021-07-09 15:58:00-04:00  45.500000  45.849998  45.445099  ...    1885          0             0
2021-07-09 15:59:00-04:00  45.849899  45.849899  45.849899  ...     100          0             0

As can be seen, there is no data for the minute of 16:00:00.

However, according to https://www.nasdaq.com/market-activity/stocks/cflt/latest-real-time-trades, there are the following transations. So there should be data for the minute of 16:00:00.

NLS Time (ET)   NLS Price   NLS Share Volume
16:00:03    $ 45.81 515
16:00:03    $ 45.81 1,000
16:00:03    $ 45.81 78
16:00:03    $ 45.81 660
16:00:03    $ 45.81 5,000
16:00:03    $ 45.81 880
16:00:03    $ 45.81 350

For the minute of 15:58:00, there are the following transactions.

15:58:34    $ 45.85 200
15:58:32    $ 45.8489   462
15:58:22    $ 45.68 100
15:58:22    $ 45.50 237
15:58:22    $ 45.50 237
15:58:22    $ 45.48 100

The sum of the volume is 1336, instead of 1885 as shown in the yfinance results. Upto now, it seems that the yfinance results are not trustworthy, they are different from the results on nasdaq.com website. (I also checked thinkorswim, the volume for 15:58 is 1,644, which also differ from yfinance and nasdaq website data.) Which one should be trusted?

>>> 200+462+100+237+237+100
1336

However, the sum of the minutely volumes of yfinance is 722106, which is very similar to the daily volume of 730,971 shown on the nasdaq webpage below. The difference is not that much.

>>> data[['Volume']].sum()
Volume    722106
dtype: int64

https://www.nasdaq.com/market-activity/stocks/cflt/historical

Date    Close/Last  Volume  Open    High    Low
07/09/2021  $45.81  730,971 $42.5   $46.27  $42.5

https://www.nasdaq.com/market-activity/stocks/cflt/latest-real-time-trades

I then summed all the volumes for 9:30-9:59, 10:00-10:20,...,15:30-15:50,16:00 on the above page, and end end up with just 481814. This is too different from the official daily volume 730971.

Does anybody know how to interpret these inconsistencies? How to summarize minutely data, so that it will be the same as the daily volume? How to summarize minutely data from each individual transaction?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.