KUAIXIAN1:=IF(H>REF(H,1),H,IF(C>REF(C,1),C,REF(C,1)));
KUAIXIAN2:=IF(L<REF(L,1),L,IF(C<REF(C,1),C,REF(C,1)));
KUAIXIAN0:=HHV(H,5);
止损线0:MA(KUAIXIAN0,5),COLORRED,LINETHICK2;
止损线1:MA(KUAIXIAN1,5),COLORDD2347,LINETHICK2;
止损线2:MA(KUAIXIAN2,5),COLOR66AA4D,LINETHICK2;
MA5:=MA(C,5);
MA10 := MA(CLOSE,10);
MA60 := MA(CLOSE,60);
A:=(3*C+L+O+H)/6;
垂帘:(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*REF(A,4)+15*REF(A,5)
+14*REF(A,6)+13*REF(A,7)+12*REF(A,8)+11*REF(A,9)+10*REF(A,10)
+9*REF(A,11)+8*REF(A,12)+7*REF(A,13)+6*REF(A,14)+5*REF(A,15)
+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+REF(A,20))/210,COLORRED,POINTDOT;
听股:MA(垂帘,13),COLORFFCCCC,CIRCLEDOT;
ZAR1:=SLOPE(EMA(CLOSE,2),5)*15+C;
ZAR2:=EMA(ZAR1,5);
ZARA:=EMA(EMA(EMA(EMA(EMA(EMA(EMA(EMA(ZAR2,5),5),5),5),5),5),5),5);
ZARB:=BARSLAST(CROSS(CLOSE,ZARA));
ZARC:=BARSLAST(CROSS(ZARA,CLOSE));
STICKLINE(CLOSE<ZARA,REF(CLOSE,ZARC),REF(CLOSE,ZARC),12,0),LINETHICK2,COLORFFCCCC;
STICKLINE(CLOSE>ZARA AND CLOSE>REF(CLOSE,ZARB),REF(CLOSE,ZARB),垂帘,1,0),COLORFFC8FF;
STICKLINE(CLOSE>ZARA AND CLOSE>REF(CLOSE,ZARB),REF(CLOSE,ZARB),REF(CLOSE,ZARB),12,0),COLORFFC8FF,LINETHICK2;
STICKLINE(CLOSE<ZARA AND CLOSE<REF(CLOSE,ZARC),REF(CLOSE,ZARC),垂帘,1,0),COLOR00FF00;
VAR41:= EMA(100*(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34)),3);
VAR42:=EMA(100*(INDEXC-LLV(INDEXL,34))/(HHV(INDEXH,34)-LLV(INDEXL,34)),3);
VAR4A:=REF(VAR41,1)>92 AND VAR41<92;
DRAWTEXT(VAR4A AND C<止损线1,H+0.12,'短卖'),COLOR00FF00;
DRAWTEXT(VAR4A,H+0.05,'●'),COLOR00FF00;
STICKLINE(C>=O,H,L,0,0),COLORRED;
STICKLINE(C<O,H,L,0,0),COLORFFFF52;
STICKLINE(C>=O,C,O,4,1),COLORRED;
STICKLINE(C<O,C,O,4,0),COLORFFFF52;
MA13:MA(C,13),COLORWHITE,LINETHICK2;
MA250:=MA(C,250);
T:=BARSLAST(L>REF(H,1));
E:=COUNT(L<REF(H,T+1),T)<2;
VLL:=CROSS(MA(C,13),MA(C,21));
X5:=HHV((REF(CLOSE,1)+REF(CLOSE,2)+REF(CLOSE,3)+REF(CLOSE,4))/4,5);
X10:=HHV((REF(CLOSE,2)+REF(CLOSE,3)+REF(CLOSE,4)+REF(CLOSE,5))/4,10);
X20:=HHV((REF(CLOSE,3)+REF(CLOSE,4)+REF(CLOSE,5)+REF(CLOSE,6))/4,20);
BY:=CROSS(C,X5) AND CROSS(C,X10) AND CROSS(C,X20) AND C/REF(C,1)>1.015;
BH:=CROSS(X5,X10) AND C>O;
PDAY1 := BARSLAST(CROSS(MA5,MA60));{5日均线上穿60日均线}
PDAY2 := BARSLAST(CROSS(MA10,MA60));{10日均线上穿60日均线,至此形成鸭颈部}
PDAY3 := BARSLAST(HIGH=HHV(HIGH,PDAY2));{形成头部,要下跌}
PDAY4 := BARSLAST(CROSS(MA10,MA5));{下跌后,5日均线和10日均线死叉}
PDAY5 := BARSLAST(CROSS(MA5,MA10));{回落不久,5日均线和10日均线形成金叉,形成部};
AS1:= PDAY1>PDAY2 AND PDAY2>PDAY3 AND PDAY3>PDAY4 AND PDAY4>PDAY5 AND PDAY5<5;
AS2:= COUNT(CROSS(MA10,MA5),PDAY2)=1;
GJTJ1:=100*(C-LLV(L,5))/(HHV(C,5)-LLV(L,5));
GJTJ2:=100*(C-LLV(L,10))/(HHV(C,10)-LLV(L,10));
GJTJ3:=100*(C-LLV(L,20))/(HHV(C,20)-LLV(L,20));
GJTJ4:=100*(C-LLV(L,30))/(HHV(C,30)-LLV(L,30));
BAIJIN1:=BARSLAST(CROSS(30,GJTJ1))<2 AND BARSLAST(CROSS(GJTJ1,50))<2;
BAIJIN2:=BARSLAST(CROSS(GJTJ4,GJTJ1))<2 AND GJTJ1>GJTJ4;
BAIJIN3:=GJTJ1>60 AND GJTJ4>70;