背离就是说股价下跌但macd上涨,或者股价上涨macd下跌。底背离选股(macd,kdj,rsi){底背离}diff:=ema(close,12) - ema(close,26);dea:=ema(diff,9);a1:=barslast(ref(cross(diff,dea),1));b1:=ref(c,a1+1)>c and ref(diff,a1+1)<diff and cross(diff,dea);a2:=barslast(ref(cross("kdj.k"(9,3,3),"kdj.d"(9,3,3)),1));b2:=ref(c,a2+1)>c and ref("kdj.k"(9,3,3),a2+1)<"kdj.k"(9,3,3) and cross("kdj.k"(9,3,3),"kdj.d"(9,3,3));a3:=barslast(ref(cross("rsi.rsi1"(6,12,24),"rsi.rsi2"(6,12,24)),1));b3:=ref(c,a3+1)>c and ref("rsi.rsi1"(6,12,24),a3+1)<"rsi.rsi1"(6,12,24) and cross("rsi.rsi1"(6,12,24),"rsi.rsi2"(6,12,24));底背离:b1>0 or b2>0 or b3>0;{集成了macd、kdj、rsi三个指标的底背离};请自行处理,如果不需要kdj和rsi可以进行删除一些源码的操作。 20210311