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;
谢谢!作者: 老人与海 时间: 2016-8-29 23:56
IF DATE<20161001 THEN BEGIN,这段代码的意思是不选次新股,2016年之前发行的股票才是选股对象,其实大可不必,去次新:=FINANCE(42)>=60; 上市天数少于2个月不选就可以。
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));