SHORT:=12;LONG:=26;MID:=9;
DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:EMA(DIF,MID);
macd:(DIF-DEA)*2,COLORSTICK;
{主升段}
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,27);
DEA1:=EMA(DIFF,9);
MacD1:=2*(DIFF-DEA1),COLORSTICK,LINETHICK2;
趋势:=MA(MACD,1);
STICKLINE(MACD1>REF(MACD1,1) AND 趋势>0,0,MACD1,2,0),COLOR0000FF;
STICKLINE(MACD1>REF(MACD1,1) AND 趋势>0,0,MACD1,1.8,0),COLOR0000FF;
STICKLINE(MACD1>REF(MACD1,1) AND 趋势>0,0,MACD1,1.5,0),COLOR0000FF;
STICKLINE(MACD1>REF(MACD1,1) AND 趋势>0,0,MACD1,1.2,0),COLOR0000FF;
STICKLINE(MACD1>REF(MACD1,1) AND 趋势>0,0,MACD1,0.6,0),COLOR0000FF;
STICKLINE(MACD1>REF(MACD1,1) AND 趋势>0,0,MACD1,0.3,0),COLORCC66FF;
DRAWICON(MACD1>REF(MACD1,1) AND 趋势>0 ,趋势,1);
{ Gupang.com 股-旁-网_通达信股票指标公式}
低位金叉:=crOSS(DIF,DEA) AND DIF<-0.1;
JCCOUNT:=COUNT(CROSS(DIF,DEA),BArslAST(DEA>=0));
二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
STICKLINE(二次金叉,0,0.06,6,0),COLORFF00FF;
DRAWICON(二次金叉,DEA*0.9,13);
DRAWTEXT(二次金叉,DEA*1,'低二叉'),COLORYELLOW;
周DIF:="MACD.DIF#WEEK"(12,26,9);
周DEA:="MACD.DEA#WEEK"(12,26,9);
周MACD:="MACD.MACD#WEEK"(12,26,9);
DIF周金叉:=CROSS(周DIF,周DEA);
DRAWTEXT(DIF周金叉,0,'周叉'),COLORYELLOW;
DRAWTEXT(CROSS(周DEA,周DIF),0,'周死'),COLORGREEN;
MACD周金叉:=CROSS(周MACD,周DIF) AND 周MACD>=(0-0.05) AND 周MACD<=0.02;