英文:
Can not download 6 months TSLA with interval of 1 minute in yfinance
问题
以下是已经翻译好的部分:
symbol_history = yf.Ticker('TSLA').history(period='1d', interval='1m') # OK
symbol_history = yf.Ticker('TSLA').history(period='max', interval='1m') # OK with 6 days period
symbol_history = yf.Ticker('TSLA').history(period='6mo', interval='1m') # Not OK. Empty Dataframe
Is there any limitation of pair of periods and intervals?
How to get these data?
英文:
I want to download 6 month data of TSLA with resolution of 1 minute, but the code returned an empty dataframe.
symbol_history = yf.Ticker('TSLA').history(period='1d', interval='1m') # OK
symbol_history = yf.Ticker('TSLA').history(period='max', interval='1m') # OK with 6 days period
symbol_history = yf.Ticker('TSLA').history(period='6mo', interval='1m') # Not OK. Empty Dataframe
Is there any limitation of pair of periods and intervals?
How to get these data?
答案1
得分: 1
根据 yfinance 的Wiki:
> 一天内的数据不能超过过去60天
> * 1分钟 - 最多获取最近30天内的7天数据
> * 高达90分钟 - 最多获取60天的数据
> * 60分钟,1小时 - 最多获取730天的数据(是的,1小时在技术上小于90分钟,但这是雅虎的做法)
英文:
According to the yfinance Wiki
> Intraday data cannot extend last 60 days
> * 1m - max 7 days within last 30 days
> * up to 90m - max 60 days
> * 60m, 1h - max 730 days (yes 1h is technically < 90m but this what Yahoo does)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论