后台指标计算返回数据格式说明9 - PARTLINE格式
PARTLINE用法:PARTLINE(PRICE,COND1,COLOR1,COND2,COLOR2…),
绘制PRICE线,当COND1条件满足时,用COLOR1颜色,当COND2条件满足时,用COLOR2颜色,否则不绘制,从COLOR1之后的参数均可以省略,最多可以有10组条件
例如:PARTLINE(CLOSE,CLOSE>OPEN,RGB(255,0,0),CLOSE<OPEN,RGB(0,255,0),1,RGB(0,0,255))
表示画收盘价线,阳线时用红色,阴线时用绿色,平盘用蓝色.注意最后一个条件为1,表示前面都不满足时必然满足这个条件
基础的属性这里就不说了,具体看后台指标计算返回数据格式说明1 - 基础数据格式
DrawType
“PARTLINE” 固定
Type
1 固定 代表绘图函数数据类型
Draw
绘图函数输出数据
Price
输出Y轴值,数值类型数组
Color
线段颜色 字符串数组, 如果是null 当前这个点不用画
样例指标脚本
PARTLINE(CLOSE,CLOSE>OPEN,RGB(255,0,0),CLOSE<OPEN,RGB(0,255,0),1,RGB(0,0,255));
json返回数据
{
"Period": 0,
"Right": 0,
"Symbol": "600000.sh",
"Date": [
20201028,
20201029,
20201030,
20201102,
20201103,
20201104,
20201105,
20201106,
20201109,
20201110,
20201111,
20201112,
20201113,
20201116,
20201117,
20201118,
20201119,
20201120,
20201123,
20201124
],
"OutVar": [
{
"Name": "__temp_1__",
"DrawType": "PARTLINE",
"Draw": {
"Price": [
9.4,
9.37,
9.26,
9.25,
9.3,
9.34,
9.36,
9.39,
9.43,
9.46,
9.56,
9.43,
9.36,
9.45,
9.53,
9.7,
9.74,
9.67,
9.9,
9.85
],
"Color": [
"RGB(0,255,0)",
"RGB(255,0,0)",
"RGB(0,255,0)",
"RGB(0,255,0)",
"RGB(0,255,0)",
"RGB(0,255,0)",
"RGB(0,255,0)",
"RGB(255,0,0)",
"RGB(255,0,0)",
"RGB(0,255,0)",
"RGB(255,0,0)",
"RGB(0,255,0)",
"RGB(0,255,0)",
"RGB(255,0,0)",
"RGB(255,0,0)",
"RGB(255,0,0)",
"RGB(255,0,0)",
"RGB(0,255,0)",
"RGB(255,0,0)",
"RGB(0,255,0)"
]
},
"Type": 1,
"Attribute": [
"NONE_OUT_NAME"
]
}
]
}
QQ群: 950092318
如果还有问题可以加交流QQ群: 950092318
HQChart代码地址地址:github.com/jones2000/HQChart
个人爱好(模型/摄影)地出 飞毛腿,鲨鱼精
地出 飞毛腿,五面怪
地出 飞毛腿,游民