1、指标公式:
DIFF : EMA(CLOSE,12) - EMA(CLOSE,26);
DEA : EMA(DIFF,9);
MACD : 2*(DIFF-DEA);
Zero : 0;
IF( DIFF>=0 AND MACD>=0 AND MA(CLOSE,5)>=MA(CLOSE,10) AND MA(VOL,5)>=MA(VOL,10))RETURN BACKSET("colorred",2);
IF(MACD<=0 OR MA(CLOSE,5)<=MA(CLOSE,10))RETURN BACKSET("colorgreen",2);
2、选股公式:
IF DATE<20161001 THEN BEGIN
DIFF : EMA(CLOSE,12) - EMA(CLOSE,26);
DEA : EMA(DIFF,9);
MACD : 2*(DIFF-DEA);
Zero : 0;
SELECT (CROSS(DIFF,DEA) AND DIFF>=0 AND MA(CLOSE,5)>=MA(CLOSE,10) AND CLOSE>=MA(CLOSE,5) AND MA(VOL,5)>=MA(VOL,10) AND CLOSE>=OPEN AND (OPEN-PRE)/PRE*100 < 6 )
OR (MACD>=0 AND DIFF>=0 AND MA(CLOSE[1],5)<MA(CLOSE[1],10) AND MA(CLOSE,5)>=MA(CLOSE,10) AND CLOSE>=MA(CLOSE,5) AND MA(VOL,5)>=MA(VOL,10) AND CLOSE>=OPEN AND (OPEN-PRE)/PRE*100 < 6) ;
END;
BBY:(CROSS(DIFF,DEA) AND DIFF>=0 AND MA(CLOSE,5)>=MA(CLOSE,10) AND CLOSE>=MA(CLOSE,5) AND MA(VOL,5)>=MA(VOL,10) AND CLOSE>=OPEN AND (OPEN-PRE)/PRE*100 < 6 ))
OR ((MACD>=0 AND DIFF>=0 AND MA(CLOSE[1],5)<MA(CLOSE[1],10) AND MA(CLOSE,5)>=MA(CLOSE,10) AND CLOSE>=MA(CLOSE,5) AND MA(VOL,5)>=MA(VOL,10) AND CLOSE>=OPEN AND (OPEN-PRE)/PRE*100 < 6));