SHORT:=12;
LONG:=26;
M:=9;
N:=30;
DIFF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);
DEA : EMA(DIFF,M);
macd : 2*(DIFF-DEA);
MacDBUY1 : IF(REF(MACD,1)>LLV(MACD,N),0,1);
MACDBUY2 : IF(CLOSE>MA(CLOSE,25),1,0);
MACDBUY3 : IF(MA(CLOSE,99)>CLOSE,1,0);
MACDBUY4 : IF(MACD<0,1,0);
MACDBUY:MACDBUY1+MACDBUY2+MACDBUY3+MACDBUY4;