指数MACD+K线飞狐公式


{指数MACD+K线}
DIFF:EMA(INDEXC,12)-EMA(INDEXC,26);
DEA:EMA(DIFF,9),COLORGREEN;
MACD:2*(DIFF-DEA), COLORSTICK;
s1:=MACD0;
s2:=MACD

PARTLINE(DIFF>DEA,DIFF),COLORff11cc,LINETHICK2;
PARTLINE(DIFF>DEA AND DIFF<0,DIFF),COLORred,LINETHICK2;
DRAWICON(CROSS(DIFF,DEA),DIFF-0.01,6);
DRAWICON(CROSS(DEA,DIFF),DIFF,11);

D1:=EMA(INDEXC,3)-EMA(INDEXC,15);
D2:=EMA(INDEXO,3)-EMA(INDEXO,15);
D3:=EMA(INDEXH,3)-EMA(INDEXH,15);
D4:=EMA(INDEXL,3)-EMA(INDEXL,15);
DRAWICON(cross(d1,diff) and diff<-0.05 ,d4-0.1,1);
DRAWICON(cross(diff,d1) and diff>0.1 ,d3+0.1,2);
STICKLINE(D1>=D2,D1,D2,8,0),COLOR0055AA;
STICKLINE(D1<=D2,D1,D2,8,0),COLOR006600;
STICKLINE(D1>=D2,D1,D2,5,0),COLOR0077CC;
STICKLINE(D1>=D2,D1,D2,3,0),COLOR0099DD;
STICKLINE(D1>=D2,D3,D4,0,0),COLOR00BBFF;
STICKLINE(D1<=D2,D1,D2,5,0),COLOR009900;
STICKLINE(D1<=D2,D1,D2,3,0),COLOR00BB00;
STICKLINE(D1<=D2,D3,D4,0,0),COLOR00EE00;
-0.2