九毛八公式指标
公式模块:
DIF:(EMA(CLOSE,12) - EMA(CLOSE,26)),Colorred,LINETHICK,PRECISION2;
DEA:EMA(DIF,9),COLORYELLOW,LINETHICK,PRECISION2;
macd:2*(DIF-DEA),COLORFFFFFF,LINETHICK,PRECISION2;
RSV14:=(CLOSE - LLV(LOW,14))/(HHV(HIGH,14) - LLV(LOW,14))-0.5;
K14:=SMA(RSV14,3,1),COLORFF00FF,LINETHICK,PRECISION2;
D14:=SMA(K14,3,1),COLORB00000,LINETHICK,PRECISION2;
J14:=3*K14-2*D14;
FILLRGN(DIF>0 AND DIF>=DEA,DIF,DEA),Color000088;
FILLRGN(DIF>0 AND DIF<DEA,DIF,DEA),COLORGRAY;
FILLRGN(DIF<=0 AND DIF<DEA,DIF,DEA),Color33FF33;
FILLRGN(DIF<=0 AND DIF>=DEA,DIF,DEA),ColorFFCCDD;
STICKLINE(MacD>REF(MACD,1) AND MACD>0,0,MACD,3,0),COLOR000055;
STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,2,0),COLOR000099;
STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,1,0),COLOR0000BB;
STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,0.5,0),COLOR0000DD;
STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD,3,0),COLOR888888;
STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD,2,0),COLORBBBBBB;
STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD,1,0),COLORDDDDDD;
STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD,0.5,0),COLORFFFFFF;
STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,3,0),COLOR3377AA;
STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,2,0),COLOR3388BB;
STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,1,0),COLOR4499CC;
STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,0.5,0),COLOR5599DD;
STICKLINE(MACD<=REF(MACD,1) AND MACD<0,0,MACD,3,0),COLORFF3300;
STICKLINE(MACD<=REF(MACD,1) AND MACD<0,0,MACD,2,0),COLORFF5500;
STICKLINE(MACD<=REF(MACD,1) AND MACD<0,0,MACD,1,0),COLORFF7700;
STICKLINE(MACD<=REF(MACD,1) AND MACD<0,0,MACD,0.5,0),COLORFF9900;
MACDXG2:=REF(count(dif>0 AND MACD<0 AND macd<ref(macd,1),4)=4,1) AND MACD>REF(MACD,1);
STICKLINE(MACDXG2,macd,0,8,0),COLORred;
TRlsx1:= MAX(MAX((hhv(dif,13)-Llv(dif,13)),ABS(REF(dif,1)-hhv(dif,13))),ABS(REF(dif,1)-llv(dif,13)));
trlsx2:=ema(trlsx1,13);
trlsx3:=ref(dif,1)-ref(trlsx2,1);
支撑:hhv(trlsx3,13),PRECISION2,COLORffffff;
PARTLINE(dea<=ref(DEA,1),Dea),COLORff0000,LINETHICK1;
PARTLINE(dea>ref(DEA,1),Dea),COLORYELLOW,LINETHICK1;
PARTLINE(DIF>ref(dif,1),DIF),Colorred,LINETHICK1;
PARTLINE(DIF<=ref(dif,1),DIF),Color008080,LINETHICK1;
difk:=ema(dif,3);
difd:=ema(difk,3);
DKK:4*dif-3*dea,COLORff00ff,PRECISION2,LINETHICK;
DDD:ema(dkk,5),COLOR2588ff,PRECISION2,LINETHICK;
PARTLINE(DKK>ref(DKK,1),DKK),COLORff00ff,LINETHICK1,LINEDOT;
PARTLINE(DKK<=ref(DKK,1),DKK),COLORffffff,LINETHICK1,LINEDOT;
PARTLINE(DDD>ref(DDD,1),DDD),COLOR2255ff,LINETHICK1,LINEDOT;
PARTLINE(DDD<=ref(DDD,1),DDD),COLOR33ff33,LINETHICK1,LINEDOT;
MACDXG1:=ref(cross(0,macd),3) and count(dif>0 and macd<ref(macd,1),4)=4 ;
DRAWICON(MACDXG1,macd*1.15,1),ALIGN;
kdjXG:=REF(COUNT(J14<REF(J14,1),5)>=3,1) AND REF(J14,1)<-0.4 AND J14>REF(J14,1);
DRAWICON(C AND FILTER(kdJXG,3),macd*1.35,8),ALIGN;
DRAWICON(C AND FILTER(KDJXG,3),macd*1.4,8),ALIGN;
DRAWICON(C AND FILTER(KDJXG,3),macd*1.45,8),ALIGN;
DIF:(EMA(CLOSE,12) - EMA(CLOSE,26)),COLORRED,LINETHICK1;
DEA:EMA(DIF,9),COLORYELLOW,LINETHICK1;
MACD:2*(DIF-DEA),COLORFFFFFF,LINETHICK1;
RSV14:=(CLOSE - LLV(LOW,14))/(HHV(HIGH,14) - LLV(LOW,14))-0.5;
K14:=SMA(RSV14,3,1),COLORFF00FF,LINETHICK;
D14:=SMA(K14,3,1),COLORB00000,LINETHICK;
J14:=3*K14-2*D14;
DRAWBAND(DIF,RGB(136,0,0),DEA,RGB(128,128,128));
DRAWBAND(IF(DIF<0,DIF,DRAWNULL),RGB(221,204,255),IF(DIF<0,DEA,DRAWNULL),RGB(51,255,51));
STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,1.5,0),COLOR000055;
STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,1.5,0),COLOR000099;
STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,1,0),COLOR0000BB;
STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,0.5,0),COLOR0000DD;
STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD,1.5,0),COLOR888888;
STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD,1.5,0),COLORBBBBBB;
STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD,1,0),COLORDDDDDD;
STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD,0.5,0),COLORFFFFFF;
STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,1.5,0),COLOR3377AA;
STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,1.5,0),COLOR3388BB;
STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,1,0),COLOR4499CC;
STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,0.5,0),COLOR5599DD;
STICKLINE(MACD<=REF(MACD,1) AND MACD<0,0,MACD,1.5,0),COLORFF3300;
STICKLINE(MACD<=REF(MACD,1) AND MACD<0,0,MACD,1.5,0),COLORFF5500;
STICKLINE(MACD<=REF(MACD,1) AND MACD<0,0,MACD,1,0),COLORFF7700;
STICKLINE(MACD<=REF(MACD,1) AND MACD<0,0,MACD,0.5,0),COLORFF9900;
MACDXG2:=REF(COUNT(DIF>0 AND MACD<0 AND MACD<REF(MACD,1),4)=4,1) AND MACD>REF(MACD,1);
STICKLINE(MACDXG2,MACD,0,5,0),COLORRED;
TRLSX1:= MAX(MAX((HHV(DIF,13)-LLV(DIF,13)),ABS(REF(DIF,1)-HHV(DIF,13))),ABS(REF(DIF,1)-LLV(DIF,13)));
TRLSX2:=EMA(TRLSX1,13);
TRLSX3:=REF(DIF,1)-REF(TRLSX2,1);
支撑:HHV(TRLSX3,13),COLORFFFFFF;
IF(DEA<=REF(DEA,1),DEA,DRAWNULL),COLORFF0000,LINETHICK1;
IF(DEA>REF(DEA,1),DEA,DRAWNULL),COLORYELLOW,LINETHICK1;
IF(DIF>REF(DIF,1),DIF,DRAWNULL),COLORRED,LINETHICK1;
IF(DIF<=REF(DIF,1),DIF,DRAWNULL),COLOR008080,LINETHICK1;
DIFK:=EMA(DIF,3);
DIFD:=EMA(DIFK,3);
DKK:4*DIF-3*DEA,COLORFF00FF,LINETHICK1;
DDD:EMA(DKK,5),COLOR2588FF,LINETHICK1;
IF(DKK>REF(DKK,1),DKK,DRAWNULL),COLORFF00FF,LINETHICK1;
IF(DKK<=REF(DKK,1),DKK,DRAWNULL),COLORFFFFFF,LINETHICK1;
IF(DDD>REF(DDD,1),DDD,DRAWNULL),COLOR2255FF,LINETHICK1;
IF(DDD<=REF(DDD,1),DDD,DRAWNULL),COLOR33FF33,LINETHICK1;
MACDXG1:=REF(CROSS(0,MACD),3) AND COUNT(DIF>0 AND MACD<REF(MACD,1),4)=4 ;
DRAWICON(MACDXG1,MACD*1.15,5);
KDJXG:=REF(COUNT(J14<REF(J14,1),5)>=3,1) AND REF(J14,1)<-0.4 AND J14>REF(J14,1);
DRAWICON(C AND FILTER(KDJXG,3),MACD*1.35,1);
DRAWICON(C AND FILTER(KDJXG,3),MACD*1.4,1);
DRAWICON(C AND FILTER(KDJXG,3),MACD*1.45,1);