MA5:MA(CLOSE,5),pointdot,color000000,linethick1;
MA21:=EMA(CLOSE,21);
MID:MA(CLOSE,21),color000000,linethick0;
风险线: MA(CLOSE,13),linethick3,COLORGREEN;
止损线: MA(CLOSE,27),linethick0,Coloree00ee;
UPPER:MID + 2*STD(C,20),LINETHICK0,COLORFFFFFF;
LOWER:MID - 2*STD(C,20),LINETHICK0,COLORFFFFFF;
H1:=EMA(SLOPE(CLOSE,34)*20+CLOSE,75);
H2:=EMA(CLOSE,8);
Var1d:=H2-H1;
a:=(3*c+l+o+h)/6;
b:=(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;
d:=ma(b,10);
STICKLINE((MA21 > REF(MA21,1)),MA21,MA21,5,6),LINETHICK2,Color00FFFF;
STICKLINE(C>=MID AND C>=O,C,O,5,0),COLORRED;
STICKLINE(C>=MID AND C>=O,H,L,0,0),COLORRED;
STICKLINE(C>=MID AND C<O,C,O,5,1),COLORRED;
STICKLINE(C>=MID AND C<O,O,H,0,0),COLORRED;
STICKLINE(C>=MID AND C<O,C,L,0,0),COLORRED;
STICKLINE(C<MID AND C>O,C,O,5,1),COLORffff00;
STICKLINE(C<MID AND C<=O,C,O,5,1),COLORffff00;
STICKLINE(C<MID AND C<=O,H,L,0,1),COLORffff00;
STICKLINE(C<MID AND C>O,C,H,0,1),COLORffff00;
STICKLINE(C<MID AND C>O,O,L,0,1),COLORffff00;
牛熊线:EMA(C,250),CIRCLEDOT,color999999;
{- }
界:MA(CLOSE,21),pointdot,color000000,linethick0;
VAR1:=(100 - ((90 * (HHV(HIGH,21) - CLOSE)) / (HHV(HIGH,21) - LLV(LOW,21))));
VAR2:=(100 - ((90 * (HHV(HIGH,21) - CLOSE)) / (HHV(HIGH,21) - LLV(LOW,21))));
VAR3:=(100 - MA(((100 * (HHV(HIGH,6) - CLOSE)) / (HHV(HIGH,6) - LLV(LOW,6))),34));
DRAWICON(crOSS(VAR2,MA(VAR3,6)),(LOW * 0.95),4),linethick3;
DRAWICON(CROSS(MA(VAR3,6),VAR1),(HIGH * 1.05),5),linethick3;
DRAWTEXT(CROSS(VAR2,MA(VAR3,6)),(LOW * 0.988),'B'),coloryellow,linethick3;
DRAWTEXT(CROSS(MA(VAR3,6),VAR1),(HIGH * 1.02),'S'),Coloree00ee,linethick2;
STICKLINE(C>=界 AND C>=O,C,O,5,0),COLORRED;
STICKLINE(C>=界 AND C>=O,H,L,0,0),COLORRED;
STICKLINE(C>=界 AND C<O,C,O,5,1),COLORRED;
STICKLINE(C>=界 AND C<O,O,H,0,0),COLORRED;
STICKLINE(C>=界 AND C<O,C,L,0,0),COLORRED;
STICKLINE(C<界 AND C>O,C,O,5,1),COLORffff00;
STICKLINE(C<界 AND C<=O,C,O,5,1),COLORffff00;
STICKLINE(C<界 AND C<=O,H,L,0,1),COLORffff00;
STICKLINE(C<界 AND C>O,C,H,0,1),COLORffff00;
STICKLINE(C<界 AND C>O,O,L,0,1),COLORffff00;
DRAWTEXT(CROSS(MA5,界),(LOW * 0.80),'◇底背离'),COLORWHITE;
DRAWTEXT(CROSS(c,止损线)and 止损线>风险线,(LOW * 0.96),'主升浪'),COLORRED,linethick3;