通达信波段顶底主图指标公式

20151),COLORRED;
STICKLINE(REF(L,1)>H,REF(L,1),H,1.8,LLV(L,25));FX2:=100*(HHV(H,60)LLV(L,15))/(HHV(H,25)LC,0),N2,1)/SMA(ABS(C-LC),N2,1)*100;
{青顶预警}
STICKLINE((REF(RSI,1)>=80 AND RSI<80),H,(O+H)/2,2.1,0),COLOR999900;
STICKLINE((REF(RSI,1)>=80 AND RSI<80),H,(O+H)/2,1.6,0),COLORAAAA00;
STICKLINE((REF(RSI,1)>=80 AND RSI<80),H,(O+H)/2,1.2,0),COLORBBBB00;
STICKLINE((REF(RSI,1)>=80 AND RSI<80),H,(O+H)/2,0.8,0),COLORCCCC00;
STICKLINE((REF(RSI,1)>=80 AND RSI<80),H,(O+H)/2,0.2,0),COLORDDDD00;
{橘底预警}
STICKLINE((REF(RSI,1)<=20 AND RSI>20),L,(O+L)/2,1.9,0),COLOR002288;
STICKLINE((REF(RSI,1)<=20 AND RSI>20),L,(O+L)/2,1.6,0),COLOR0033AA;
STICKLINE((REF(RSI,1)<=20 AND RSI>20),L,(O+L)/2,1.2,0),COLOR0044CC;
STICKLINE((REF(RSI,1)<=20 AND RSI>20),L,(O+L)/2,0.8,0),COLOR0055EE;
STICKLINE((REF(RSI,1)<=20 AND RSI>20),L,(O+L)/2,0.2,0),COLOR0088FF;
{顶底K线分型}
ZXX:=(H+L+O+C*3)/6;NX:=(3*C+L+O+H)/6;
ZNX:=(20*NX+19*REF(NX,1)+18*REF(NX,2)+17*REF(NX,3)+16*REF(NX,4)
+15*REF(NX,5)+14*REF(NX,6)+13*REF(NX,7)+12*REF(NX,8)+11*REF(NX,9)
+10*REF(NX,10)+9*REF(NX,11)+8*REF(NX,12)+7*REF(NX,13)+6*REF(NX,14)
+5*REF(NX,15)+4*REF(NX,16)+3*REF(NX,17)+2*REF(NX,18)+REF(NX,20))/210;
NXX:=MA(ZNX,6);
GD:=H>REF(H,1) AND REF(H,1)<REF(H,2) AND L>REF(L,1) AND REF(L,1)<REF(L,2);
GT:=H<REF(H,1) AND REF(H,1)>REF(H,2) AND L<REF(L,1) AND REF(L,1)>REF(L,2);
BH1:=REF(H,1)>=REF(H,2) AND REF(L,1)<=REF(L,2);
BH2:=REF(H,1)<=REF(H,2) AND REF(L,1)>=REF(L,2);
BD1:=H>REF(H,2) AND REF(H,2)<REF(H,3) AND L>REF(L,1) AND REF(L,1)<REF(L,3);
BD2:=H>REF(H,1) AND REF(H,1)<REF(H,3) AND L>REF(L,2) AND REF(L,2)<REF(L,3);
BT1:=H<REF(H,1) AND REF(H,1)>REF(H,3) AND L<REF(L,2) AND REF(L,2)>REF(L,3);
BT2:=H<REF(H,2) AND REF(H,2)>REF(H,3) AND L<REF(L,1) AND REF(L,1)>REF(L,3);
FD:=IF(BH1,BD1,IF(BH2,BD2,GD));FT:=IF(BH1,BT1,IF(BH2,BT2,GT));
DFX:=IF(BARSLAST(CROSS(NXX,ZXX))>3,FILTER(BACKSET(FILTER(FD AND ZXX<NXX,3),2),1),0);
TFX:=IF(BARSLAST(CROSS(ZXX,NXX))>3,FILTER(BACKSET(FILTER(FT AND ZXX>NXX,3),2),1),0);
{深绿顶分型}
STICKLINE(TFX,H,L,0,0),COLOR668800;
STICKLINE(TFX,C,O,2.1,10),COLOR113300;
STICKLINE(TFX,C,O,1.9,10),COLOR224400;
STICKLINE(TFX,C,O,1.6,10),COLOR335500;
STICKLINE(TFX,C,O,1.2,10),COLOR446600;
STICKLINE(TFX,C,O,0.6,10),COLOR557700;
STICKLINE(TFX,C,O,0.1,0),COLOR668800;
{暗黄底分型}
STICKLINE(DFX,H,L,0,0),COLOR4499CC;
STICKLINE(DFX,O,C,1.9,10),COLOR225588;
STICKLINE(DFX,O,C,1.6,10),COLOR226699;
STICKLINE(DFX,O,C,1.2,10),COLOR3377AA;
STICKLINE(DFX,O,C,0.6,10),COLOR3388BB;
STICKLINE(DFX,O,C,0.1,0),COLOR4499CC;
{压力支撑位}
VAR1111:=BACKSET(REF(H,2)=HHV(H,5),3);
VAR2222:=CROSS(VAR1111,0.9);
VAR3333:=BACKSET(REF(L,2)=LLV(L,5),3);
VAR4444:=CROSS(VAR3333,0.9);
波段顶:= REF(H,BARSLAST(VAR2222));
STICKLINE(C,REF(H,BARSLAST(VAR2222)),REF(H,BARSLAST(VAR2222)),0.5,1),COLORGREEN;
波段底:= REF(L,BARSLAST(VAR4444));
STICKLINE(C,REF(L,BARSLAST(VAR4444)),REF(L,BARSLAST(VAR4444)),0.5,1),COLORRED;

通达信波段顶底主图指标公式的选股公式