gpt4 book ai didi

python - 如何导入外汇数据并使用 yfinance 和 pandas 数据阅读器读取它?

转载 作者:行者123 更新时间:2023-12-03 08:05:35 31 4
gpt4 key购买 nike

hello guys, hope you're doing well.i used a code that plots renko and counts the bars by importing the data of stocks from yahoo finance and it worked great, but i want to use forex data from yahoo finance in the code but it is not working.

Stocklist=['AAPL']
start='2016-1-1'
for stock in StockList:
data[stock]=pdr.get_data_yahoo(stock, start)

that's how i get stocks data and use it, but its not working for forex, for example EURUSD=X

最佳答案

start_date = dt.datetime.today()- dt.timedelta(4000) 
end_date = dt.datetime.today()
stock ="USDJPY=X"
data = yf.download(stock, start_date, end_date)

伙计们,它就是这样工作的

关于python - 如何导入外汇数据并使用 yfinance 和 pandas 数据阅读器读取它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72473338/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com