def statistic_process(event):
print(event.widget.get())
statistic = event.widget.get()
upperband, middleband, lowerband = ta.BBANDS(close, timeperiod=5, nbdevup=2, nbdevdn=2, matype=0)
fig, axes = plt.subplots(2, 1, sharex=True)
ax1, ax2 = axes[0], axes[1]
axes[0].plot(close, 'rd-', markersize=3)
axes[0].plot(upperband, 'y-')
axes[0].plot(middleband, 'b-')
axes[0].plot(lowerband, 'y-')
axes[0].set_title(statistic, fontproperties="SimHei")
if statistic == '????':
real = ta.LINEARREG(close, timeperiod=14)
axes[1].plot(real, 'r-')
elif statistic == '??????':
real = ta.LINEARREG_ANGLE(close, timeperiod=14)
axes[1].plot(real, 'r-')
elif statistic == '??????':
real = ta.LINEARREG_INTERCEPT(close, timeperiod=14)
axes[1].plot(real, 'r-')
elif statistic == '??????':
real = ta.LINEARREG_SLOPE(close, timeperiod=14)
axes[1].plot(real, 'r-')
elif statistic == '???':
real = ta.STDDEV(close, timeperiod=5, nbdev=1)
axes[1].plot(real, 'r-')
elif statistic == '??????':
real = ta.TSF(close, timeperiod=14)
axes[1].plot(real, 'r-')
elif statistic == '??':
real = ta.VAR(close, timeperiod=5, nbdev=1)
axes[1].plot(real, 'r-')
plt.show()
# ????
评论列表
文章目录