无法在yfinance中以1分钟的间隔下载6个月的TSLA数据。

huangapple go评论66阅读模式
英文:

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)

huangapple
  • 本文由 发表于 2023年7月3日 23:05:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/76605981.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定