【发布时间】:2019-11-09 04:08:41
【问题描述】:
当我使用任何不是外汇对的代码时,它都有效。但是对于 fx 代码,它不会。我最终得到一个错误。
from yahoo_fin.stock_info import get_live_price
get_live_price('EURUSD=X')
下面是我遇到的错误。
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-15-a1b6fb5ddbd7> in <module>
4
5 #Stock = input('Stock:')
----> 6 get_live_price('EURUSD=X')
7 #stockprice = get_live_price(str(Stock))
8
//anaconda3/lib/python3.7/site-packages/yahoo_fin/stock_info.py in get_live_price(ticker)
336 '''
337
--> 338 df = get_data(ticker, end_date = pd.Timestamp.today() + pd.DateOffset(10))
339
340
//anaconda3/lib/python3.7/site-packages/yahoo_fin/stock_info.py in get_data(ticker, start_date, end_date, index_as_date)
58 html = html.decode()
59
---> 60 start = html.index('"HistoricalPriceStore"')
61 end = html.index("firstTradeDate")
62
ValueError: substring not found
有什么想法吗?这显然与股票行情有关。当我使用“nflx”或“aapl”时,它就像一个魅力。似乎是外汇交易行为不端?
【问题讨论】:
标签: python finance yahoo yahoo-finance stock