You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if bi:
# bi原先的代码保留不变,只在后面追加画中枢的代码
if zs:
zs_data = []
for i in zs:
zs_data.append(opts.MarkAreaItem(x=(i['sdt'], i['edt']),y=(i['zd'],i['zg'])))
chart_bi.set_series_opts(markarea_opts=opts.MarkAreaOpts(
data=zs_data
))
在调用kline_pro之前准备好zs数据:
if len(self.zs_list) > 0:
zs = [{'sdt': x.bis[0].sdt, 'edt': x.bis[-1].edt, 'zd': x.zd, 'zg': x.zg} for x in self.zs_list]
else:
zs = None
chart = kline_pro(kline, bi=bi, zs=zs, fx=fx, width=width, height=height, bs=bs,
title="{}-{}".format(self.symbol, self.freq.value))
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
看到图形中没有中枢的显示,代码中有一个箱形的实现,不过那个与中枢的表达有一点距离,可以这样实现:
在函数kline_pro增加参数 zs: List[dict] = None
然后在if bi:的最后部分,增加代码:
在调用kline_pro之前准备好zs数据:
self.zs_list则是在CZSC类初始化时完成赋值:
Beta Was this translation helpful? Give feedback.
All reactions