我在运行我的代码时收到此错误。主要问题是 hplot 没有正确导入。
File "MACD.py", line 10, in <module>
from bokeh.plotting import figure, show, output_file, hplot
ImportError: cannot import name hplot
这是我的代码:
macds = macd, macdsignal, macdhist = MACD(hloc, fastperiod=12, slowperiod=26, signalperiod=9)
macdhist_f=[]
iter=0
for x in np.nditer(macdhist):
iter+=1
macdhist_f.append([iter,float(x)])
print(type(x))
print macdhist_f
macdhist_df = pd.DataFrame(macdhist_f)
defaults.width = 450
defaults.height = 350
hist = Histogram(macdhist_df, values='macd hist', bins=50,
title="MACD Histogram")
show(hplot(hist))
coin = "DASH_"
output_file(coin + "html", title="macd")