F:=.DIF;D:=MACD.DEA;M:=MACD.MACD;HT:=BARSLAST(OSS(F,D));HT1:=SUMBARS(HT=0,2);LT:=BARSLAST(CROSS(D,F));LT1:=SUMBARS(LT=0,2);H1:=BARSLAST(H=HHV(H,HT+1));H2:=REF(H1,LT)+CONST(LT);H3:=REF(H1,LT1-1)+CONST(LT1);L1:=BARSLAST(L=LLV(L,LT+1));L2:=REF(L1,HT1-1)+CONST(HT1);L3:=REF(L1,HT)+CONST(HT);DRAWLINE(CURRBARSCOUNT=CONST(H2)+1,H,CONST(M)>0 AND CURRBARSCOUNT=CONST(H1)+1,H,1),COLORRED;DRAWLINE(CURRBARSCOUNT=CONST(L2),L,CONST(M)>0 AND CURRBARSCOUNT=CONST(L1)+1,L,1),COLORYELLOW;DRAWLINE(CURRBARSCOUNT=CONST