Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yfinance download for tickers with sunday working day. #1936

Closed
BottleNeck2021 opened this issue May 16, 2024 · 2 comments
Closed

yfinance download for tickers with sunday working day. #1936

BottleNeck2021 opened this issue May 16, 2024 · 2 comments

Comments

@BottleNeck2021
Copy link

BottleNeck2021 commented May 16, 2024

Describe bug

Hello,

steps taken are as follows:
yf.download("NBK.KW")
resulting output
image

we get only values for
Monday
Tuesday
Wednesday
Thursday

Please note GCC markets have their weekends as Friday and Saturday.

So the first working day is Sunday.

Exception: UAE/Dubai has Saturday/Sunday as weekend.

Simple code that reproduces your problem

yfinance.download("NBK.KW")

Debug log

DEBUG Entering download()
DEBUG Disabling multithreading because DEBUG logging enabled
DEBUG Entering history()
DEBUG Entering history()
DEBUG NBK.KW: Yahoo GET parameters: {'period1': '1925-06-10 03:07:00+03:07', 'period2': '2024-05-16 03:36:03+03:00', 'interval': '1d', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG Entering get()
DEBUG url=https://query2.finance.yahoo.com/v8/finance/chart/NBK.KW
DEBUG params={'period1': -1406246400, 'period2': 1715819763, 'interval': '1d', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG Entering _get_cookie_and_crumb()
DEBUG cookie_mode = 'basic'
DEBUG Entering _get_cookie_and_crumb_basic()
DEBUG loaded persistent cookie
DEBUG reusing cookie
DEBUG crumb = 'iI3kLNAmXIK'
DEBUG Exiting _get_cookie_and_crumb_basic()
DEBUG Exiting _get_cookie_and_crumb()
DEBUG response code=200
DEBUG Exiting get()
DEBUG NBK.KW: yfinance received OHLC data: 2000-01-03 06:00:00 -> 2024-05-15 06:00:00
DEBUG NBK.KW: OHLC after cleaning: 2000-01-03 09:00:00+03:00 -> 2024-05-15 09:00:00+03:00
DEBUG NBK.KW: OHLC after combining events: 2000-01-03 00:00:00+03:00 -> 2024-05-15 00:00:00+03:00
DEBUG NBK.KW: yfinance returning OHLC: 2000-01-03 00:00:00+03:00 -> 2024-05-15 00:00:00+03:00
DEBUG Exiting history()
DEBUG Exiting history()
DEBUG Exiting download()
DEBUG get_raw_json(): https://query2.finance.yahoo.com/v10/finance/quoteSummary/NBK.KW
DEBUG Entering get()
DEBUG url=https://query2.finance.yahoo.com/v10/finance/quoteSummary/NBK.KW
DEBUG params={'modules': 'financialData,quoteType,defaultKeyStatistics,assetProfile,summaryDetail', 'corsDomain': 'finance.yahoo.com', 'formatted': 'false', 'symbol': 'NBK.KW'}
DEBUG Entering _get_cookie_and_crumb()
DEBUG cookie_mode = 'basic'
DEBUG Entering _get_cookie_and_crumb_basic()
DEBUG reusing cookie
DEBUG reusing crumb
DEBUG Exiting _get_cookie_and_crumb_basic()
DEBUG Exiting _get_cookie_and_crumb()
DEBUG response code=200
DEBUG Exiting get()
DEBUG Entering get()
DEBUG url=https://query1.finance.yahoo.com/ws/fundamentals-timeseries/v1/finance/timeseries/NBK.KW?symbol=NBK.KW&type=trailingPegRatio&period1=1700092800&period2=1715904000
DEBUG params=None
DEBUG Entering _get_cookie_and_crumb()
DEBUG cookie_mode = 'basic'
DEBUG Entering _get_cookie_and_crumb_basic()
DEBUG reusing cookie
DEBUG reusing crumb
DEBUG Exiting _get_cookie_and_crumb_basic()
DEBUG Exiting _get_cookie_and_crumb()
DEBUG response code=200
DEBUG Exiting get()

Bad data proof

image

yfinance version

0.2.38

Python version

3.12

Operating system

Windows 10 Home

@ValueRaider
Copy link
Collaborator

If Yahoo doesn't have Sundays, not sure what yfinance can do.

@BottleNeck2021
Copy link
Author

Dear @ValueRaider,
Got it ...

I checked most recent prices and found that at some point Yahoo fixed the problem.

Thank you !!

Vin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants