通达信钻石出击指标公式
VAR1:=EMA(CLOSE,12)-EMA(CLOSE,26);
VAR2:=EMA(VAR1,9);
VAR3:=VAR1>VAR2;
VAR4:=(CLOSE-LLV(LOW,12))/(HHV(HIGH,12)-LLV(LOW,12))*100;
VAR5:=SMA(VAR4,3,1);
VAR6:=SMA(VAR5,3,1);
VAR7:=VAR5>VAR6;
VAR8:=REF(CLOSE,1);
VAR9:=SMA(MAX(CLOSE-VAR8,0),9,1)/SMA(ABS(CLOSE-VAR8),9,1)*100;
VAR10:=SMA(MAX(CLOSE-VAR8,0),26,1)/SMA(ABS(CLOSE-VAR8),26,1)*100;
VAR11:=VAR9>VAR10;
VAR12:=SMA(VAR4,3,1);
VAR13:=SMA(VAR12,3,1);
VAR14:=VAR12>VAR13;
VAR15:=(MA(CLOSE,3)+MA(CLOSE,9)+MA(CLOSE,12)+MA(CLOSE,26))/4;
VAR16:=CLOSE>VAR15;
VAR17:=CLOSE-REF(CLOSE,1);
VAR18:=100*EMA(EMA(VAR17,9),9)/EMA(EMA(ABS(VAR17),9),3);
VAR19:=100*EMA(EMA(VAR17,26),12)/EMA(EMA(ABS(VAR17),26),12);
VAR20:=VAR18>VAR19;
VAR21:=DMA((HIGH+LOW+CLOSE*2)/4,0.9);
VAR22:=REF(EMA(VAR21,3),1);
VAR23:=VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN));
VAR24:=IF(CLOSE>OPEN,VAR23*(HIGH-LOW),IF(CLOSE<OPEN,VAR23*(HIGH-OPEN+CLOSE-LOW),VOL/2))+IF(CLOSE>OPEN,0-VAR23*(HIGH-CLOSE+OPEN-LOW),IF(CLOSE<OPEN,0-VAR23*(HIGH-LOW),0-VOL/2));
VAR25:=VAR24/20/1.15;
VAR26:=VAR25*0.55+REF(VAR25,1)*0.33+REF(VAR25,2)*0.22;
VAR27:=EMA(VAR26,8);
VAR28:=EMA(VAR26,3);
VAR29:=VAR28;
VAR30:=VOL;
VAR31:=MA(VAR30,5);
VAR32:=MA(VAR30,10);
VAR33:=VAR31>=VAR32;
VAR34:=VAR29>=0;
VAR35:=VAR34 AND VAR33;
DRAWICON(VAR35,1,25);
VAR36:=MA(KDJ.K#WEEK(9,3,3),5);
VAR37:=EMA(CLOSE,12/2)-EMA(CLOSE,26/2);
VAR38:=EMA(VAR37,9/2);
VAR39:=VAR36>=REF(VAR36,1) AND VAR37>=VAR38;
DRAWICON(VAR39,0.9,7);
VAR40:=VAR39 OR VAR35;
VAR41:=VAR3 AND VAR7 AND VAR11 AND VAR14 AND VAR16 AND VAR20;
VAR42:=COST(50)*COST(50)/COST(80);
VAR43:=COST(40)*COST(40)/COST(60);
VAR44:=VAR43-VAR42;
VAR45:=VAR44>0 AND CLOSE>VAR43;
VAR46:=VAR44<0 AND CLOSE>VAR42;
VAR47:=VAR45 OR VAR46 OR (VAR45 AND VAR46);
VAR48:=VAR47=0 OR (VAR44>0 AND CLOSE>VAR43 AND CLOSE<MA(CLOSE,10)) OR (VAR44<0 AND CLOSE>VAR42 AND CLOSE<MA(CLOSE,5));
VAR49:=VAR47 AND REF(VAR48,1);
VAR50:=VAR48 AND REF(VAR47,1);
STICKLINE(VAR48,0.5,0.8,3,0),COLORGREEN;
STICKLINE(VAR48,0.5,0.8,2.5,0),COLOR006000;
STICKLINE(VAR48,0.5,0.8,2,0),COLOR007500;
STICKLINE(VAR48,0.5,0.8,1.5,0),COLOR009100;
STICKLINE(VAR48,0.5,0.8,1,0),COLOR00A600;
STICKLINE(VAR48,0.5,0.8,0.5,0),COLOR00BB00;
STICKLINE(VAR48,0.5,0.8,0,0),COLOR00CC00;
STICKLINE(VAR47,0.5,0.8,3,0),COLORYELLOW;
STICKLINE(VAR47,0.5,0.8,2.5,0),COLOR0035FF;
STICKLINE(VAR47,0.5,0.8,2,0),COLOR0064FF;
STICKLINE(VAR47,0.5,0.8,1.3,0),COLOR0093FF;
STICKLINE(VAR47,0.5,0.8,0.8,0),COLOR00C2FF;
STICKLINE(VAR47,0.5,0.8,0.3,0),COLOR00FFFF;
STICKLINE(VAR41,0.5,0.8,3,0),COLORRED;
STICKLINE(VAR41,0.5,0.8,2.5,0),COLOR000055;
STICKLINE(VAR41,0.5,0.8,2,0),COLOR000077;
STICKLINE(VAR41,0.5,0.8,1.5,0),COLOR000099;
STICKLINE(VAR41,0.5,0.8,1,0),COLOR0000BB;
STICKLINE(VAR41,0.5,0.8,0.5,0),COLOR0000DD;
STICKLINE(VAR41,0.5,0.8,0,0),COLOR0000FF;
DRAWICON(VAR47 OR VAR41 AND REF(VAR47 OR VAR41,1)=0 AND VAR40,0.5,25);