MA5:=MA(C,5);
MA20:=MA(C,20);
MTM:=C-REF(C,1);
A51:= REF(MA5,1)*0.98;
A52:= REF(MA5,2)*0.98;
B52:= BARSLAST(REF(C,2)>=REF(MA5,2) AND REF(C,1)<REF(MA5,1))+2;
B51:= BARSLAST(REF(C,2)>=REF(MA5,2) AND REF(C,1)<REF(MA5,1))+1;
DZ:=IF((REF(C,2)>=REF(MA5,2)) AND (REF(C,1)<REF(MA5,1)),IF(REF(MA5,2)<REF(MA5,1),A51,A52),IF(BARSSINCE(REF(C,2)>=REF(MA5,2) AND REF(C,1)<REF(MA5,1))>0,IF(REF(MA5, B52)< REF(MA5, B51),REF(MA5,B51)*0.98, REF(MA5,B52)*0.98), REF(MA5,1)));
DX:=100*EMA(EMA(MTM,6),6)/EMA(EMA(ABS(MTM),6),6);
卖:=IF(HHV(DX,2)=HHV(DX,7) AND COUNT(DX>50,2) AND CROSS(MA(DX,2),DX),1,0);
A201:=REF(MA20,1)*0.98;
A202:=REF(MA20,2)*0.98;
买入:=(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4,COLOR0000FF;
MA1:=SMA(C,3,1),COLORGREEN;
STICKLINE(CROSS(MA1,买入),0,1,1,0),COLORRED;
STICKLINE(FILTER(卖=1,1),0,1,1,0),COLORGREEN;
起涨线:C>A201+0.1 AND C>A202+0.1;