通达信主图红绿波浪公式源码
STICKLINE(L>REF(H,1) ,REF(H,1),L,4,-1),COLORDF00DF;
STICKLINE(H<REF(L,1) ,REF(L,1),H,4,-1),COLORDFDF00;
DIF1:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA1:=EMA(DIF1,9);
MACDA:=2*(DIF1-DEA1);
CY:=BARSLAST(CURRBARSCOUNT=100);
VAR1:=CONST(IF(ISLASTBAR=1,LLV(L,CY),0));
VAR2:=LAST(MACDA>=REF(MACDA,1),3,1);
VAR3:=MACDA<REF(MACDA,1);
VAR4:=LAST(MACDA<=REF(MACDA,1),3,1);
DD1:=MACDA>REF(MACDA,1);
SS:=VAR4 AND DD1 AND MACDA<0; XX:=VAR2 AND VAR3 AND MACDA>0;
VAR5:=(3*C+H+L+O)/6;
XJ:=(VAR5+0.618*REF(VAR5,1)+0.382*REF(VAR5,2)+0.236*REF(VAR5,3)+0.146*REF(VAR5,4))/2.382; YCZXH:=(MA(HHV(VAR5,2),5)+MA(HHV(VAR5,2),13)+MA(HHV(VAR5,2),21)+MA(HHV(VAR5,2),32))/4; YCZXL:=(MA(LLV(VAR5,2),5)+MA(LLV(VAR5,2),13)+MA(LLV(VAR5,2),21)+MA(LLV(VAR5,2),32))/4;
SMH:=EMA(YCZXH,21);
SML:=EMA(YCZXL,21),NODRAW;
SMJ:=(SML+SMH)/2,NODRAW;
PJ:=(10*VAR5+9*REF(VAR5,1)+8*REF(VAR5,2)+7*REF(VAR5,3)+6*REF(VAR5,4)+5*REF(VAR5,5)+4*REF(VAR5,6)+3*REF(VAR5,7)+2*REF(VAR5,8)+REF(VAR5,9))/55; A1:=EMA(PJ,3),COLOR00400D,NODRAW;
VAR52:=EMA(PJ,5),COLOR00400D,NODRAW;
公式3:=EMA(PJ,7),COLOR00400D,NODRAW;
公式4:=EMA(PJ,9),COLOR00400D,NODRAW;
公式5:=EMA(PJ,11),COLOR00400D,NODRAW;
A66:=EMA(PJ,1),COLOR00400D,NODRAW;
LX:=REF(XJ,1),NODRAW; ZD:=(SMA(MAX(XJ-LX,0),5,1)/SMA(ABS(XJ-LX),5,1))*100,NODRAW;
KX1:=(CLOSE>=OPEN) AND ZD>=50,NODRAW;
KX2:=(CLOSE<OPEN) AND ZD>=50,NODRAW;
KX3:=(CLOSE>=OPEN) AND ZD<50,NODRAW;
KX4:=(CLOSE<OPEN) AND ZD<50,NODRAW;
DRAWBAND(IF(CURRBARSCOUNT<=100,VAR1+MACD*1.5,DRAWNULL),RGB(230,12,12),VAR1,RGB(10,30,230));
DRAWBAND(IF(CURRBARSCOUNT<=100,VAR1+MACD*1.5,DRAWNULL),RGB(230,30,12),VAR1,RGB(10,200,30)); IF(CURRBARSCOUNT<100,VAR1+MACD*1.5,DRAWNULL),COLORYELLOW;