{红中红背离顶底-海边的鲨优化版}N:=26; M:=12; P:=9;DIF:EMA(CLOSE,M) - EMA(CLOSE,N);DEA:EMA(DIF,P);MACD:(DIF-DEA)*2,COLORSTICK;//======= 顶底背离检测 ========底背离条件:=LLV(LOW,30)=LOW AND DIF>REF(DIF,1) AND MACD>REF(MACD,1);顶背离条件:=HHV(HIGH,30)=HIGH AND DIF<REF(DIF,1) AND MACD<REF(MACD,1);//======= 量价共振过滤 ========成交量异动:=VOL>MA(VOL,20)*1.5 AND CLOSE>OPEN;均线支撑:=C>MA(C,60) AND EVERY(MA(C,5)>MA(C,10),3);//======= 最终信号 ========钻石底部:IF(底背离条件 AND 成交量异动 AND 均线支撑, LOW*0.98, DRAWNULL),ICON(1);绿箭逃顶:IF(顶背离条件 AND C<MA(C,20), HIGH*1.02, DRAWNULL),ICON(2);DRAWTEXT(钻石底部, LOW*0.95,'←钻石坑'),COLORFF00FF;DRAWTEXT(绿箭逃顶, HIGH*1.05,'←老乡快跑'),COLORGREEN;