将多条垂直线和散点图添加到袖扣量化器烛光图中



我正在尝试使用袖扣量子图向蜡烛图添加更多元素。我需要两个项目的指导。

  1. 一次添加多条不同颜色的水平线。我可以添加多行预定义颜色或单行自定义颜色,但无法添加多行自定义颜色
qf=cf.QuantFig(data,title='Apple Quant Figure',legend='top',name='GS')
qf.add_shapes(hline =[225,275]) # plots same red color lines at to locations 
qf.add_shapes(hline = dict(y=250,color='blue',width=3, dash='dashdot')) #plots single custom line at the location
qf.add_shapes(hline = [dict(y=300,color='blue',width=3, dash='dashdot'),
dict(y=250,color='blue',width=3, dash='dashdot')]) #does not work
qf.add_shapes(hline = dict(y=[200,300],color='blue',width=3, dash='dashdot')) #does not work

尝试添加多个自定义类型(颜色和线条样式(的线条不起作用在此处输入图像描述

  1. 如何在烛光图上添加散点图。我正试图用袖扣画出这样的东西:在此处输入图像描述

这对我来说很有效,画2条水平线和2条垂直线来得到一个矩形:

qf.add_shapes(hline=[{'x0': '2021-02-17 00:00:00', 'x1': '2021-02-27 00:00:00', 'y': 40000, 'color': 'orange'}])
qf.add_shapes(hline=[{'x0': '2021-02-17 00:00:00', 'x1': '2021-02-27 00:00:00', 'y': 41000, 'color': 'blue'}])
qf.add_shapes(vline=[{'x': '2021-02-17 00:00:00', 'y0': 40000, 'y1': 41000, 'color': 'orange'}])
qf.add_shapes(vline=[{'x': '2021-02-27 00:00:00', 'y0': 40000, 'y1': 41000, 'color': 'blue'}])

最新更新