diff:="macd.diff";
MADC底背离:(LLV(C,60)=REF(C,1)) AND NOT(LLV(diff,60)=REF(diff,1)) AND diff>REF(diff,1),colorred,linethick0;
MACD顶背离:(HHV(C,60)=REF(C,1)) AND NOT(HHV(diff,60)=REF(diff,1)) AND diff<REF(diff,1),linethick0,colorred;
j:="KDJ.j"(9,3,3);
KDJ底背离:(LLV(C,60)=REF(C,1)) AND NOT(LLV(J,60)=REF(J,1)) AND J>REF(J,1),linethick0,colorgreen;
KDJ顶背离:(HHV(C,60)=REF(C,1)) AND NOT(HHV(J,60)=REF(J,1)) AND J<REF(J,1),linethick0,colorgreen;
RSI:="RSI.RSI2";
RSI底背离:(LLV(C,60)=REF(C,1)) AND NOT(LLV(RSI,60)=REF(RSI,1)) AND RSI>REF(RSI,1),linethick0,colorblue;
RSI顶背离:(HHV(C,60)=REF(C,1)) AND NOT(HHV(RSI,60)=REF(RSI,1)) AND RSI<REF(RSI,1),linethick0,colorblue;
STICKLINE(MADC底背离,-3,0,3,0),colorred;
STICKLINE(KDJ底背离,-2,0,6,0),colorgreen;
STICKLINE(RSI底背离,-1,0,9,0),colorblue;
STICKLINE(MACD顶背离,3,0,3,0),colorred;
STICKLINE(KDJ顶背离,2,0,6,0),colorgreen;
STICKLINE(RSI顶背离,1,0,9,0),colorblue;