编写要求:
选股条件: 1,MACD在0轴上方。 2,均线多头向上,然后K线股价回调在20日均线附近。
公式在线网解答:
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2;
X1:=MACD>0;{MACD在0轴上方}
X2:=MA(C,5)>MA(C,10) AND MA(C,10)>MA(C,20) AND MA(C,5)>REF(MA(C,5),1) AND MA(C,10)>REF(MA(C,10),1) AND MA(C,20)>REF(MA(C,20),1);{均线多头向上}
X3:=L<=MA(C,20) AND C>MA(C,20); {股价回调在20日均线附近}
XG:X1 AND X2 AND X3;