N:=13;
VAR2:=CLOSE*vol;
MID:=EMA((expma(VAR2,3)/EXPMA(VOL,3)+EXPMA(VAR2,6)/EXPMA(VOL,6)+EXPMA(VAR2,12)/EXPMA(VOL,12)+EXPMA(VAR2,24)/EXPMA(VOL,24))/4,N);
主趋势线1:MID;MID2:=MID*1.01;
SDN:=MID*0.94;
SDN3:=REFDATE(CLOSE,1050609),COLORYELLOW;
SUP:=1.06*MID,COLORBLUE;
VAR4:=EXPMA(CLOSE,9);
B9:=COUNT(HIGH>SUP,5);
VAR1:=MID;
RMID:IF(VAR1>REF(VAR1,1),VAR1,DRAWNULL),LINETHICK2,COLORRED;
GMID:IF(VAR1<REF(VAR1,1),VAR1,DRAWNULL),LINETHICK2,COLORCYAN;
PP:=(2*CLOSE+HIGH+LOW)/4;
QQ:=Abs(PP-MA(CLOSE,N*15));
AA:=QQ/MA(CLOSE,N*15);
N2:=(N-2)*15;
N3:=(N+2)*15;
N4:=(N+3)*15;
主趋势线:=(MA(CLOSE,13)),LINETHICK2,COLORRED;
CC:=(CLOSE/主趋势线);
MA1:=MA(CC*(2*CLOSE+HIGH+LOW)/4,3);
MAAA:=((MA1-主趋势线)/主趋势线)/3;
TMP:=MA1-MAAA*MA1;
短期趋势线:TMP,LINETHICK2,COLORYELLOW;
{- }
QSX:=IF(TMP<=MID,MID,DRAWNULL),LINETHICK2,COLORCYAN;
DQ2:IF(TMP<=REF(TMP,1),TMP,DRAWNULL),LINETHICK2,COLORWHITE;
DQSX:IF(TMP<=MID,TMP,DRAWNULL),LINETHICK2,COLORGREEN;
DQ3:IF(TMP>=REF(TMP,1) AND TMP<MID,TMP,DRAWNULL),LINETHICK2,COLORLIRED;
{
DRAWTEXT(crOSS(TMP,主趋势线),LOW,'开
多'),COLORYELLOW;
DRAWTEXT(TMP<=REF(TMP,1) AND REF
(TMP,2)>REF(TMP,1) AND TMP>主趋势
线,LOW,'平多'),COLORYELLOW;
DRAWTEXT(CROSS(主趋势线,TMP),LOW,'开
空'),COLORGREEN;
};