简体   繁体   中英

how to import forex data and read it using yfinance and pandas data reader?

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)

it worked in this way guys

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM