均线、MACD、KDJ金叉选股公式: DIF:=EMA(CLOSE,12)-EMA(CLOSE,26); DEA:=EMA(DIF,9); MACD:=2*(DIF-DEA);{系统自带MACD指标} RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100; K:=SMA(RSV,3,1); D:=SMA(K,3,1); J:=3*K-2*D;{系统自带KDJ指标} 周期 := 1;{金叉出现周期} 五日均线 := MA(CLOSE,5); 十日均线 := MA(CLOSE,10); 均线金叉周期 := BARSLAST(CROSS(五日均线,十日均线)); KDJ金叉周期 := BARSLAST(CROSS(K,D)); MACD水下金叉:= CROSS(DIF,DEA) AND DEA<0; MACD金叉周期 := BARSLAST(MACD水下金叉); 三金叉见底:IF((均线金叉周期<=周期 AND KDJ金叉周期<=周期 AND MACD金叉周期 <=周期),1,0); |
|