这个指标,想做成不破前低的预警!
a:zig(4,10);
tj:=a>ref(a,1) and a>refx(a,1);
tj1:=a<ref(a,1) and a<refx(a,1);
s:=if(tj or tj1,a,0);
DRAWNUMBER(tj,a*(1+n1/1000),s,2)COLORMAGENTA,align0;
DRAWNUMBER(tj1,a/(1+n1/1000),s,2)COLORGREEN,align0;
正确答案:
{方式一}
a:zig(4,10);
tj:=a>ref(a,1) and a>refx(a,1);
tj1:=a<ref(a,1) and a<refx(a,1);
s:=if(tj or tj1,a,0);
DRAWNUMBER(tj,ref(a,barslast(tj1)),s,2)COLORMAGENTA,align0;
DRAWNUMBER(tj1,ref(a,barslast(tj)),s,2)COLORGREEN,align0;
{方式二}
a:zig(4,10);
tj:=a>ref(a,1) and a>refx(a,1);
tj1:=a<ref(a,1) and a<refx(a,1);
s:=if(tj or tj1,a,0);
b1:ref(a,barslast(tj1));
b2:ref(a,barslast(tj));
DRAWNUMBER(tj,b2,s,2)COLORMAGENTA;
DRAWNUMBER(tj1,b1,s,2)COLORGREEN;
|