要一个双叠加,于是写了出来,只是一种写指标的模式和方法,为指标热爱者提供一种思路!
MA5:MA(CLOSE,5),COLORFF00FF,LINETHICK0;
MA13:MA(C,13),COLOR00FFFF,LINETHICK0;
MA34: MA(CLOSE,34),COLORRED,LINETHICK0;
MA55: MA(CLOSE,55),COLORFF0090,LINETHICK0;
HH0:=CONST(HHV(C,150));
LL0:=CONST(LLV(C,150));
HL:=CONST(IF(CONST((HH0+LL0)/2)<CONST(C),LL0-(HH0-LL0)*0.2,HH0+(HH0-LL0)*0.2));
HH1:=IF(CONST((HH0+LL0)/2)>CONST(C),HH0,HL);
LL1:=IF(CONST((HH0+LL0)/2)<CONST(C),LL0,HL);
HL2:=CONST(IF(CONST((HH0+LL0)/2)>CONST(C),LL0*0.95-(HH0-LL0)*0.1,HH0*0.95+(HH0-LL0)*0.1));
HLMAX:=MAX(HH1,LL1);
HLMIN:=MIN(HH1,LL1);
HLMN1:=(HLMAX+HLMIN)/2;
HLMN2:=HLMAX-HLMIN;
STICKLINE(C,HH1,(HH1+LL1)/2,5,0),COLOR858500;
STICKLINE(C,LL1,(HH1+LL1)/2,5,0),COLOR330000;
STICKLINE(C,(0.75-0.5)*HLMN2/0.5+HLMN1,(1-0.5)*HLMN2/0.5+HLMN1,5,0),
COLOR000088;
STICKLINE(C,(0.25-0.5)*HLMN2/0.5+HLMN1,(0-0.5)*HLMN2/0.5+HLMN1,5,0),
COLOR555555;
STICKLINE("KDJ.K"(9,3,3)>"KDJ.D"(9,3,3),("KDJ.K"(9,3,3)/100-0.5)*HLMN2/0.5
+HLMN1,("KDJ.D"(9,3,3)/100-0.5)*HLMN2/0.5+HLMN1,1.5,0),COLOR5955FF;
STICKLINE("KDJ.K"(9,3,3)<"KDJ.D"(9,3,3),("KDJ.K"(9,3,3)/100-0.5)*HLMN2/0.5
+HLMN1,("KDJ.D"(9,3,3)/100-0.5)*HLMN2/0.5+HLMN1,1.5,0),COLORFF5955;
("KDJ.J"(27,3,3)/100-0.5)*HLMN2/0.5+HLMN1,COLORFC80FF,LINETHICK2;
("KDJ.K"(27,3,3)/100-0.5)*HLMN2/0.5+HLMN1,COLOR00FFFF;
("KDJ.D"(27,3,3)/100-0.5)*HLMN2/0.5+HLMN1,COLORFFFFFF;
STICKLINE("MACD.MACD">0,"MACD.MACD"*2+HL2,HL2,1,0),COLOR400080;
STICKLINE("MACD.MACD">0 AND "MACD.MACD">REF("MACD.MACD",1),
"MACD.MACD"*2+HL2,HL2,1,0),COLOR00FFFF;
STICKLINE("MACD.MACD"<0,"MACD.MACD"*2+HL2,HL2,1,0),COLOR008080;
STICKLINE("MACD.MACD"<0 AND "MACD.MACD">REF("MACD.MACD",1),
"MACD.MACD"*2+HL2,HL2,1,0),COLORC080FF;
("MACD.DIF"*2+HL2),COLORRED;
("MACD.DEA"*2+HL2),COLORFFFFFF;
MA13,COLOR00FFFF,LINETHICK2;
IF(MA(C,13)<REF(MA(C,13),1),MA(C,13),DRAWNULL),COLOR0B0000,LINETHICK2;
MA55,COLORFF0090,LINETHICK2;
IF(MA(C,55)<REF(MA(C,55),1),MA(C,55),DRAWNULL),COLORFFF000,LINETHICK2;
STICKLINE(C>O,H,L,0,0),COLORRED;
STICKLINE(C<=O,H,L,0,0),COLORCYAN;
STICKLINE(C>O,C,O,3.1,1),COLORRED;
STICKLINE(C<=O,C,O,3.1,0),COLORCYAN;
MA34,COLORRED;
IF(MA(C,34)<REF(MA(C,34),1),MA(C,34),DRAWNULL),COLORC08000,LINETHICK1;
MA5,COLORFF00FF;
IF(MA(C,5)<REF(MA(C,5),1),MA(C,5),DRAWNULL),COLORCYAN,LINETHICK1;
【本文仅提供源码,并无公式下载,如需公式,请参照下面公式编辑录像自行编辑成公式】 |