无法从quotes_historical_yahoo_ochl

时间:2017-10-13 13:43:24

标签: python matplotlib finance

我正在尝试绘制k行股票。

import matplotlib.finance as mpf
import matplotlib.pyplot as plt

start_date = (2006, 10, 1)
end_date = (2017, 10, 1)

quotes = mpf.quotes_historical_yahoo_ochl('AAPL',start_date, end_date)
fig, ax=plt.subplots(figsize=(8,5))
fig.subplots_adjust(bottom=0.2)
mpf.candlestick_ochl(ax,quotes,width=0.6,colorup='r',colordown='g')
plt.grid(True)
ax.xaxis_date()
ax.autoscale_view()
plt.setp(plt.gca().get_xticklabels(),rotation=30)
plt.show()

总是返回错误,如

TypeError: 'NoneType' object is not iterable

我试过打印报价。它将返回None。

0 个答案:

没有答案