DIFF:=EMA(DCLOSE,12)-EMA(DCLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=(DIFF-DEA)*2;
A1:=CROSS(DEA,DIFF);
A2:=BARSLAST(A1);
A3:=LLV(DIFF,A2);
A4:=LLVBARS(DIFF,A2);
A5:=LLV(L,A2);
B1:=CROSS(DIFF,DEA);
B2:=BARSLAST(B1);
B3:=LLV(DIFF,B2);
A6:=LLVBARS(L,B1);
XG:A3