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;
};