缺口百分比主图指标公式介绍
缺口百分比主图指标公式
INPUT:N(15,5,30);
{高低标注}
ddd:=ZIG(4,n );
DRAWTEXT(h=ddd ,h*1.02 ,'高='+ddd),ColorD3A9FF;
DRAWTEXT(l=ddd ,l ,'低='+ddd);
{缺口}
stickline(L>REF(H,1),L,REF(H,1),50,1001),color0000FF;
stickline(REF(L,1)>H,ref(L,1),H,50,1001),color00FF00;
{百分指标}
a1:=hhvall(h);
a2:=llvall(l);
x50:=(a1+a2)/2;
x191:=a2+(a1-a2)*0.191;
x382:=a2+(a1-a2)*0.382;
x618:=a2+(a1-a2)*0.618;
x809:=a2+(a1-a2)*0.809;
x125:=a2+(a1-a2)*0.125;
x25:=a2+(a1-a2)*0.25;
x333:=a2+(a1-a2)*0.333;
X50:=a2+(a1-a2)*0.50;
x375:=a2+(a1-a2)*0.375;
x625:=a2+(a1-a2)*0.625;
x667:a2+(a1-a2)*0.667;
x75:=a2+(a1-a2)*0.75;
x875:=a2+(a1-a2)*0.875;
bb125:x125,LINETHICK1;
bb25:x25,LINETHICK1;
BB333:X333,LINETHICK1;
BB375:X375,LINETHICK1;
BB50:X50,LINETHICK1;
BB625:X625,LINETHICK1;
BB667:X667,LINETHICK1;
BB75:X75,LINETHICK1;
BB875:X875,LINETHICK1;
DRAWTEXT(BARSTATUS=2,bb125,'1/8:'+NUMTOSTRN(bb125,2)+''),ALIGN2,color00FFff,LINETHICK1;
DRAWTEXT(BARSTATUS=2,bb25,'1/4:'+NUMTOSTRN(bb25,2)+''),ALIGN2,color00FFff,LINETHICK1;
DRAWTEXT(BARSTATUS=2,bb333,'1/3:'+NUMTOSTRN(bb333,2)+''),ALIGN2,color00FFff,LINETHICK1;
DRAWTEXT(BARSTATUS=2,bb375,'3/8:'+NUMTOSTRN(bb375,2)+''),ALIGN2,color00FFff,LINETHICK1;
DRAWTEXT(BARSTATUS=2,bb50,'1/2:'+NUMTOSTRN(bb50,2)+''),ALIGN2,COLORMAGENTA,LINETHICK1;
DRAWTEXT(BARSTATUS=2,bb625,'5/8:'+NUMTOSTRN(bb625,2)+''),ALIGN2,color00FFff,LINETHICK1;
DRAWTEXT(BARSTATUS=2,bb667,'2/3:'+NUMTOSTRN(bb667,2)+''),ALIGN2,color00FFff,LINETHICK1;
DRAWTEXT(BARSTATUS=2,bb75,'3/4:'+NUMTOSTRN(bb75,2)+''),ALIGN2,color00FFff,LINETHICK1;
DRAWTEXT(BARSTATUS=2,bb875,'7/8:'+NUMTOSTRN(bb875,2)+''),ALIGN2,color00FFff,LINETHICK1;
gd15604