{底部偏差,通信版,同花順版}
DIFF:=EMA(收盤,12)-EMA(收盤,26);
DEA:=EMA(DIFF,9);
MACD:= 2 *(DIFF-DEA);
QZQ:=BARSLAST(REF(MACD,1)0);
QM:=LLVBARS(MACD,QZQ+20);
MQDZ:= IF(QM & gt;QZQ,REF(MACD,QM),0);
XG 1:= macmqdzandclose = LLV(CLOSE,QZQ+20)ANDMQDZ
XG:REF(XG1,1)= 1 andmacd & gt;REF(MACD,1);
{雙底背離,溝通版,同花順版}
DIFF:=EMA(收盤,12)-EMA(收盤,26);
DEA:=EMA(DIFF,9);
MACD:= 2 *(DIFF-DEA);
QZQ:=BARSLAST(REF(MACD,1)0);
QM:=LLVBARS(MACD,QZQ+20);
MQDZ:= IF(QM & gt;QZQ,REF(MACD,QM),0);
QF:=LLVBARS(DIFF,QZQ+20);
DQDZ:= IF(QF & gt;QZQ,REF(DIFF,QF),0);
XG 1:= macmqdzanddiffdqdzandclose = LLV(CLOSE,QZQ+20)and qdz
XG:REF(XG1,1)= 1 andmacd & gt;REF(MACD,1);
註意:底部雙背離意味著MACD(綠柱)和DIFF(黃白線)都背離底部。