编写要求:
macd红柱过前波高点.绿柱比前坡缩小的选股公式。
www.guhai.com.cn股海网解答:
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2;
T1:=BARSLAST(CROSS(DIF,DEA))+1;
T2:=SUMBARS(CROSS(DIF,DEA),2);
TT1:=BARSLAST(CROSS(DEA,DIF))+1;
TT2:=SUMBARS(CROSS(DEA,DIF),2);
HH1:=FINDHIGH(MACD,TT1,T2-TT1,1);
XG:LLV(MACD,TT2)<>LLV(MACD,TT1) AND BARSSINCEN(CROSS(MACD,HH1),T1)=0 AND (TT2-T2)>(TT1-T1);