Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
elif engine == 'echarts':
vol.bar(axes=ax2, color='r')
else:
pass
vma1 = MA(vol, vma1_n)
vma2 = MA(vol, vma2_n)
vma1.plot(axes=ax2, legend_on=True)
vma2.plot(axes=ax2, legend_on=True)
if query.kType == Query.WEEK and stock.market == 'SH' and stock.code=='000001':
CVAL(0.16e+009, total, color='b',linestyle='--')
#ax2.hlines(0.16e+009,0,len(kdata),color='b',linestyle='--')
ax_set_locator_formatter(ax1, kdata.getDatetimeList(), kdata.getQuery().kType)
adjust_axes_show([ax1, ax2])
return show_gcf()
ax2.bar(x2, y2, width=0.4, color='g', edgecolor='g')
elif engine == 'echarts':
vol.bar(axes=ax2, color='r', legend_on=True)
else:
pass
vma1 = MA(vol, vma1_n)
vma2 = MA(vol, vma2_n)
vma1.plot(axes=ax2, legend_on=True)
vma2.plot(axes=ax2, legend_on=True)
ax_draw_macd(ax3, kdata)
ax1.set_xlim((0, len(kdata)))
ax_set_locator_formatter(ax1, kdata.getDatetimeList(), kdata.getQuery().kType)
adjust_axes_show([ax1, ax2, ax3])
return show_gcf()
umean = mean(u)
umax = max(u)
lmean = mean(l)
lmin = min(l)
up = int(umax / umean)
lp = int(lmin / lmean)
for i in range(up):
CVAL(close, umean * (i + 1)).plot(axes=ax3, color='r', linestyle='--')
#ax3.hlines(umean * (i + 1),0,len(kdata),color='r',linestyle='--')
for i in range(lp):
CVAL(close, lmean * (i + 1)).plot(axes=ax3, color='g', linestyle='--')
#ax3.hlines(lmean * (i + 1),0,len(kdata),color='g',linestyle='--')
ax1.set_xlim((0, len(kdata)))
ax_set_locator_formatter(ax1, kdata.getDatetimeList(), kdata.getQuery().kType)
adjust_axes_show([ax1, ax2, ax3])
return show_gcf()
label = "ER(%s)" % cer[-1]
cer.plot(axes=ax2, color='b', marker='o', label=label,
legend_on=False, text_on=True)
total = len(kdata)
CVAL(0.8, total).plot(axes=ax2,color='r',linestyle='--')
CVAL(-0.6, total).plot(axes=ax2,color='r',linestyle='--')
CVAL(-0.8, total).plot(axes=ax2,color='r',linestyle='--')
CVAL(0, total).plot(axes=ax2,color='k',linestyle='-')
#ax2.hlines(0.8,0,len(kdata),color='r',linestyle='--')
#ax2.hlines(-0.6,0,len(kdata),color='r',linestyle='--')
#ax2.hlines(-0.8,0,len(kdata),color='r',linestyle='--')
#ax2.hlines(0,0,len(kdata))
ax1.set_xlim((0, len(kdata)))
ax_set_locator_formatter(ax1, kdata.getDatetimeList(), query.kType)
adjust_axes_show([ax1, ax2])
return show_gcf()
cer.plot(axes=ax3, color='b', marker='.', label=label,
legend_on=False, text_on=True)
CVAL(0.8, total).plot(axes=ax2,color='r',linestyle='--')
CVAL(-0.6, total).plot(axes=ax2,color='r',linestyle='--')
CVAL(-0.8, total).plot(axes=ax2,color='r',linestyle='--')
CVAL(0, total).plot(axes=ax2,color='k',linestyle='-')
#ax3.hlines(0.8,0,len(kdata),color='r',linestyle='--')
#ax3.hlines(-0.6,0,len(kdata),color='r',linestyle='--')
#ax3.hlines(-0.8,0,len(kdata),color='r',linestyle='--')
#ax3.hlines(0,0,len(kdata))
else:
ax_draw_macd(ax2, kdata)
#ax2.set_ylim(-1, 1)
ax1.set_xlim((0, len(kdata)))
ax_set_locator_formatter(ax1, kdata.getDatetimeList(), query.kType)
adjust_axes_show([ax1, ax2])
return show_gcf()
ax2.bar(x2, y2, width=0.4, color='g', edgecolor='g')
elif engine == 'echarts':
vol.bar(axes=ax2, color='r', legend_on=True)
else:
pass
vma1 = MA(vol, vma1_n)
vma2 = MA(vol, vma2_n)
vma1.plot(axes=ax2, legend_on=True)
vma2.plot(axes=ax2, legend_on=True)
ax_draw_macd(ax3, kdata)
ax1.set_xlim((0, len(kdata)))
ax_set_locator_formatter(ax1, kdata.getDatetimeList(), kdata.getQuery().kType)
adjust_axes_show([ax1, ax2, ax3])
return show_gcf()
umean = mean(u)
umax = max(u)
lmean = mean(l)
lmin = min(l)
up = int(umax / umean)
lp = int(lmin / lmean)
for i in range(up):
CVAL(umean * (i + 1), len(kdata)).plot(axes=ax3, color='r', linestyle='--')
#ax3.hlines(umean * (i + 1),0,len(kdata),color='r',linestyle='--')
for i in range(lp):
CVAL(lmean * (i + 1), len(kdata)).plot(axes=ax3, color='g', linestyle='--')
#ax3.hlines(lmean * (i + 1),0,len(kdata),color='g',linestyle='--')
ax1.set_xlim((0, len(kdata)))
ax_set_locator_formatter(ax1, kdata.getDatetimeList(), kdata.getQuery().kType)
adjust_axes_show([ax1, ax2, ax3])
return show_gcf()
elif engine == 'echarts':
vol.bar(axes=ax2, color='r')
else:
pass
vma1 = MA(vol, vma1_n)
vma2 = MA(vol, vma2_n)
vma1.plot(axes=ax2, legend_on=True)
vma2.plot(axes=ax2, legend_on=True)
if query.kType == Query.WEEK and stock.market == 'SH' and stock.code=='000001':
CVAL(0.16e+009, total, color='b',linestyle='--')
#ax2.hlines(0.16e+009,0,len(kdata),color='b',linestyle='--')
ax_set_locator_formatter(ax1, kdata.getDatetimeList(), kdata.getQuery().kType)
adjust_axes_show([ax1, ax2])
return show_gcf()