如何标注K线顺序? 条件是:1 从13根最低收盘价标注为红色1,随后的阳K线收盘价大于上一个标注阳K线的收盘价的阳K线为2,依次类推; 2 从13根最高收盘价标注为绿色1,随后的阴K线收盘价小于上一个标注阴K线的收盘价的阴K线为2,依次类推; |
ll:=valuewhen(barpos=13,llv(c,13));
variable:n=0;
variable:cc=0;
if barpos=13 then begin
n:=1;
cc:=ll;
end
if barpos>13 and isup and c>cc then begin
n:=n+1;
cc:=c;
end
nn:n;
drawtext(barpos=13,close,numtostr(1,0)),colorwhite;
drawtext(n<>ref(n,1),close,numtostr(n,0)),colorwhite;
hh:=valuewhen(barpos=13,hhv(c,13));
variable:n2=0;
variable:cc2=0;
if barpos=13 then begin
cc2:=hh;
n2:=1;
end
if barpos>13 and isdown and c<cc2 then begin
n2:=n2+1;
cc2:=c;
end
drawtext(barpos=13,l,numtostr(1,0)),colorred;
drawtext(n2<>ref(n2,1),l,numtostr(n2,0)),colorred;
为什么不显示 |