很类似MACD,作为上传的测试专用。其中主要使用EMA函数作为主要函数。
均线的参数自己填写
dim0:0;
MA1=EMA(CLOSE,n1);
MA2=EMA(CLOSE,n2);
MA3=EMA(CLOSE,n3);
MA4=EMA(CLOSE,n4);
MA5=EMA(CLOSE,n5);
MA6=EMA(CLOSE,n6);
MAD=EMA(((MA1-MA2)/MA2+(MA2-MA3)/MA3+(MA3-MA4)/MA4+(MA4-MA5)/MA5+(MA5-MA6)/MA6),3);
MAdL:MAd;
MAde=EMA(MAd,8);
MAdel:MAde;
DELTA=(MAd-REF(MAd,1))*5;
DRAWLINE(DELTA>=0,0,1,DELTA,1),colorred;
DRAWLINE(DELTA<0,0,1,DELTA,1),colorgreen;
IF CROSS(MAdl,0)
THEN BUY;
IF CROSS(0,MAdl)
THEN SELL;
DRAWICON(CROSS(MAd,MAde),MAde,"buy2");
DRAWICON(CROSS(MAde,MAd),MAde,"sell2");