以下是DIF线不破零轴再现红第一根红柱(通用副图/选股源码)
DIF:=(EMA(CLOSE,12)-EMA(CLOSE,26));
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2,;
零下TJ:=IF(CROSS(0,DEA),1,0);
DIF金叉:=IF(DIF>0 AND CROSS(DIF,DEA),1,0);
总金叉TJ:=IF(零下TJ,SUM(DIF金叉,0),0);
最后金叉次:=HHV(总金叉TJ,0);
总金叉次:=SUM(DIF金叉,0);
轴上首金:总金叉次-最后金叉次=1 AND 总金叉次>REF(总金叉次,1) AND LLV(DIF,5)>0 AND LLV(DIF,5)<N/10;{N由自己设定,建议从1-6}