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

Limited period auto adjust with "max" period value #1916

Open
LoGo124 opened this issue Apr 24, 2024 · 1 comment
Open

Limited period auto adjust with "max" period value #1916

LoGo124 opened this issue Apr 24, 2024 · 1 comment

Comments

@LoGo124
Copy link

LoGo124 commented Apr 24, 2024

Describe bug

In some cases you're interested to download all data u can download in a specific interval.
I suppose the correct method, is use the "max" period option, but it only works with "1m" value as interval.

Simple code that reproduces your problem

import yfinance as yf

ticker = yf.Ticker("BTC-USD")

print(ticker.history(interval = "1m", period = "max"))
print(ticker.history(interval = "1h", period = "max"))

Debug log

                                   Open          High           Low         Close    Volume  Dividends  Stock Splits
Datetime                                                                                                            
2024-04-17 11:16:00+00:00  63106.847656  63106.847656  63106.847656  63106.847656         0        0.0           0.0
2024-04-17 11:17:00+00:00  63181.269531  63181.269531  63181.269531  63181.269531         0        0.0           0.0
2024-04-17 11:18:00+00:00  63179.203125  63179.203125  63179.203125  63179.203125   1630208        0.0           0.0
2024-04-17 11:19:00+00:00  63152.871094  63152.871094  63152.871094  63152.871094   4526080        0.0           0.0
2024-04-17 11:20:00+00:00  63122.992188  63122.992188  63122.992188  63122.992188   8736768        0.0           0.0
...                                 ...           ...           ...           ...       ...        ...           ...
2024-04-24 11:08:00+00:00  66438.062500  66438.062500  66438.062500  66438.062500         0        0.0           0.0
2024-04-24 11:09:00+00:00  66430.968750  66430.968750  66430.968750  66430.968750  61263872        0.0           0.0
2024-04-24 11:10:00+00:00  66431.734375  66431.734375  66431.734375  66431.734375         0        0.0           0.0
2024-04-24 11:11:00+00:00  66432.492188  66432.492188  66432.492188  66432.492188         0        0.0           0.0
2024-04-24 11:12:00+00:00  66437.500000  66437.500000  66437.500000  66437.500000         0        0.0           0.0

[8740 rows x 7 columns]
BTC-USD: 1h data not available for startTime=1410912000 and endTime=1713957318. The requested range must be within the last 730 days.
Empty DataFrame
Columns: [Open, High, Low, Close, Adj Close, Volume]
Index: []

yfinance version

0.2.38

Python version

3.10.12

Operating system

Pop!_OS 22.04 LTS

@Terry-50000
Copy link

How can i get 5m interval data of over 60 days?

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