DIF:EMA(CLOSE,12) - EMA(CLOSE,26),colorwhite;
DEA:EMA(DIF,9),coloryellow;
MACD:=2*(DIF-DEA);
Zero : 0,colorred;
IF (DIF DEA)
{
IF (DIF 0)STOCK: △建仓 ELSE STOCK: ▲加仓
}
ELSE
{
IF (DIF 0) STOCK: ◇减仓 ELSE STOCK: ◆清仓
}
DRAWICON(CROSS(DIF,0),DIF-0.02,1);//买点图标
DRAWICON(CROSS(0,DIF),DIF-0.02,2);//卖点图标
FILLRGN(DIF,DEA,DIF DEA AND DIF 0,RGB(255,0,0),DIF DEA AND DIF 0,RGB(0,255,0));//面积图
FILLRGN(DIF,DEA,DIF DEA AND DIF 0,RGB(255,255,255),DIF DEA AND DIF 0,RGB(0,255,255));//面积图
VERLINE(CROSS(DIF,DEA)OR CROSS(DEA,DIF),1);