可以 你可以使用stickline这个函数来绘制,具体我给你个例子:
编写要点:首先调用1A0001的各项数据:
a1:“1a0001$close”;
a2:“1a0001$open”;
a3:“1a0001$high”;
a4:“1a0001$low”;
我们将会使用到新的函数STICKLINE,先绘制阳线,也即当收盘大于开盘的K线,从上到下分为3部分编写,第一部分为上阴线,第二部分为实体,第三部分为下阴线,请注意该函数的各个参数的使用
aa:stickline(a1>a2,a1,a2,8,1),colored;
ab:stickline(a1>a2,a3,max(a1,a2),0,1),colored;
ac:stickline(a1>a2,min(a1,a2),a4,0,1),colored;
同样的方法,绘制阴线:
ad:stickline(a1<a2,a1,a2,8,0),colorblue;
ae:stickline(a1<a2,a3,max(a1,a2),0,1),colorblue;
af:stickline(a1<a2,min(a1,a2),a4,0,1),colorblue;
公式最后编辑汇总如下:
a1:“1a0001$close”;
a2:“1a0001$open”;
a3:“1a0001$high”;
a4:“1a0001$low”;
aa:stickline(a1>a2,a1,a2,8,1),colored;
ab:stickline(a1>a2,a3,max(a1,a2),0,1),colored;
ac:stickline(a1>a2,min(a1,a2),a4,0,1),colored;
ad:stickline(a1<a2,a1,a2,8,0),colorblue;
ae:stickline(a1<a2,a3,max(a1,a2),0,1),colorblue;
af:stickline(a1<a2,min(a1,a2),a4,0,1),colorblue;
呵呵 原理是一样的嘛 你在收盘价基础上+50不就是你想要的结果么
绘制方法有了,参数你需要自己来调整
A1 A2这种划线的位置你可以自己按照自己的思路来设置嘛
日后的版本会增加模拟k线功能
完整代码如下:
if barpos<datacount-4 then begin
a1:=c[barpos+5];
a2:=o[barpos+5];
a3:=h[barpos+5];
a4:=l[barpos+5];
end
if barpos>=datacount-4 then begin
a1:=c[datacount]+50*(barpos-datacount+4);
a2:=o[datacount]+50*(barpos-datacount+4);
a3:=h[datacount]+50*(barpos-datacount+4);
a4:=l[datacount]+50*(barpos-datacount+4);
end
aa:stickline(a1>a2,a1,a2,8,1),colored;
ab:stickline(a1>a2,a3,max(a1,a2),0,1),colored;
ac:stickline(a1>a2,min(a1,a2),a4,0,1),colored;
ad:stickline(a1<a2,a1,a2,8,0),colorblue;
ae:stickline(a1<a2,a3,max(a1,a2),0,1),colorblue;
af:stickline(a1<a2,min(a1,a2),a4,0,1),colorblue;