Last hour of trade is missing in Saudi stock market
I'm using the yfinance library to retrieve historical data for the Saudi stock market, but I've noticed that the last hour of trade is missing from the data. Specifically, the data ends at 14:00:00+03:00 , even though the market is open until 15:20:00+03:00 , so we must have a row of data for 15:00:00+03:00
To reproduce the issue, I'm using the following code to retrieve data for ARAMCO (2222) :
import yfinance as yf
aramco = yf.download('2222.SR' , period='1mo' , interval='1h')
aramco.head(10).round(2)And the result was:
| Datetime | Open | High | Low | Close | Adj Close | Volume |
|---|---|---|---|---|---|---|
| 2023-06-07 10:00:00+03:00 | 32.5 | 32.5 | 32.35 | 32.45 | 32.45 | 562639 |
| 2023-06-07 11:00:00+03:00 | 32.45 | 32.5 | 32.4 | 32.45 | 32.45 | 360020 |
| 2023-06-07 12:00:00+03:00 | 32.45 | 32.5 | 32.35 | 32.4 | 32.4 | 392409 |
| 2023-06-07 13:00:00+03:00 | 32.4 | 32.45 | 32.35 | 32.4 | 32.4 | 396132 |
| 2023-06-07 14:00:00+03:00 | 32.4 | 32.45 | 32.3 | 32.4 | 32.4 | 1205491 |
| 2023-06-08 10:00:00+03:00 | 32.3 | 32.4 | 32.25 | 32.35 | 32.35 | 620175 |
| 2023-06-08 11:00:00+03:00 | 32.3 | 32.4 | 32.3 | 32.35 | 32.35 | 941143 |
| 2023-06-08 12:00:00+03:00 | 32.4 | 32.4 | 32.3 | 32.35 | 32.35 | 400662 |
| 2023-06-08 13:00:00+03:00 | 32.4 | 32.45 | 32.3 | 32.35 | 32.35 | 514886 |
| 2023-06-08 14:00:00+03:00 | 32.4 | 32.5 | 32.4 | 32.45 | 32.45 | 496968 |
Furthermore, I compared the total volume from yfinance with the official data from Tadawul and found that there is a discrepancy. So if we sum up all the hours' volume, the official data shows a higher total volume for the day than the yfinance data.
I would appreciate any assistance in resolving this issue.
Thank you!
Source: ranaroussi/yfinance