最低成本:=COST(0.99);
最高成本:=COST(99.9);
相对价位:=(C-最低成本)/(最高成本-最低成本)*100;
K:Sma(相对价位,3,1),COLORRED;
D:SMA(K,3,1),COLORBLUE;
J:3*K-2*D,COLORFF00FF;
DRAWICON( crOSS(J,K) AND J<80,J,1);
0,COLORLIGREEN;
20,COLORYELLOW;
50,COLORYELLOW;
100,COLORLIRED;
85,DOTLINE;
M3:=MA(CLOSE,3);
M13:=MA(CLOSE,13);
M34:=MA(CLOSE,34);
STICKLINE(M3>=M13 AND M34>=REF(M34,1),98,101,2,0 ),COLORWHITE;
STICKLINE(M3<M13 AND M34>=REF(M34,1),98,101,2,0 ),COLORBLUE;
STICKLINE(M3<M13 AND M34<REF(M34,1),98,101,2,0 ),COLORCYAN;
STICKLINE(M3>=M13 AND M34<REF(M34,1),98,101,2,0 ),COLORLIMAGENTA;
DRAWTEXT(ISLASTBAR,97,'---四色图'),COLORBROWN;
JJJ:=(CLOSE+HIGH+LOW)/3;
A1:=ema(JJJ,5);
B1:=REF(A1,1);
IF(A1>B1,0,DRAWNULL),COLORBLUE,LINETHICK2;
DRAWTEXT(ISLASTBAR,2,'---蓝黄线'),COLORBROWN;
VHF:=(HHV(CLOSE,28)-LLV(CLOSE,28))/SUM(Abs(CLOSE-REF(CLOSE,1)),28);
VHFMA:=MA(VHF,10);
短趋:=VHFMA>REF(VHFMA,1);
箱型:=VHFMA<REF(VHFMA,1);
中趋:=VHF>0.3 {AND VHFMA>REF(VHFMA,1) AND VHF>VHFMA};
IF(短趋,85,DRAWNULL),COLORBLUE,LINETHICK2;
IF(箱型,85,DRAWNULL),COLORBROWN,LINETHICK2;
IF(中趋,85,DRAWNULL),COLORWHITE,LINETHICK2;
DRAWTEXT(ISLASTBAR,85,'--趋势过滤'),COLORBROWN;
mtm:=CLOSE-REF(CLOSE,24);
MTMMA:=MA(MTM,24);
XGTJ:=MTM>0 AND MTM>MTMMA;
IF(XGTJ,50,DRAWNULL),COLORWHITE,LINETHICK2;
IF(XGTJ<1,50,DRAWNULL),COLORYELLOW,LINETHICK2;
DRAWTEXT(ISLASTBAR,51,'---动能MTM'),COLORBROWN;
MTM金叉:=(XGTJ AND CROSS(MTM,MTMMA));
DRAWTEXT(CROSS(MTM,MTMMA),53,'×'),COLORBLUE;
VA:=IF(CLOSE>REF(CLOSE,1),vol,-VOL);
obv:=SUM(IF(CLOSE=REF(CLOSE,1),0,VA),0);
MaoBV:=MA(OBV,30);
IF(OBV>MAOBV,20,DRAWNULL),COLORWHITE,LINETHICK2;
IF(OBV<=MAOBV,20,DRAWNULL),COLORYELLOW,LINETHICK2;
DRAWTEXT(ISLASTBAR,21,'----OBV'),COLORBROWN;
MA5 :=EMA(CLOSE,5);
趋势:=MA5-EMA(MA5,2);
JCSJ1:=BArslAST(CROSS(趋势,0))+1;
JCSJ2:=JCSJ1+REF(JCSJ1,JCSJ1);
双底:(IF(JCSJ1=1 AND MA5>REF(MA5,JCSJ2) AND COUNT(趋势<0,4)>=2,1,0))*50,STICK;