{}DIFF:EMA(CLOSE,12) - EMA(CLOSE,26);DEA:EMA(DIFF,9);MACD:2*(DIFF-DEA), COLORSTICK,DRAWABOVE;MACD:=BARSLAST(REF(OSS(DIFF,DEA),1));MACD:=BARSLAST(REF(CROSS(DEA,DIFF),1));MACD上次金叉:=SUMBARS(REF(CROSS(DIFF,DEA),1),2);MACD上次死叉:=SUMBARS(REF(CROSS(DEA,DIFF),1),2);{MACD}MACD次:=LLV(DIFF,MACD金叉);MACD最低点:=LLV(DIFF,MACD上次死叉);MACD底背离:=REF(CLOSE,MACD金叉+1)>CLOSE AND MACD次低点>MACD最低点 AND CROSS(DIFF,DEA);DRAWLINE(MACD金叉=0,DEA,MACD底背离,DEA,0),COLORRED,LINETHICK2;{MACD}MACD次高点:=HHV(DIFF,MACD金叉);MACD最高点:=HHV(DIFF,MAC