MACD:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(MACD,9);
DIFF:=MACD-DEA;
POSLAST:=BARSLAST(DIFF>0);
BENDI:=LLV(DIFF,POSLAST+1);
BENDIFOUND:=DIFF=BENDI AND DIFF<0;
TEST:BENDIFOUND;
MACD:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(MACD,9);
DIFF:=MACD-DEA;
POSLAST:=BARSLAST(DIFF>0);
BENDI:=LLV(DIFF,POSLAST+1);
BENDIFOUND:=DIFF=BENDI AND DIFF<0;
TEST:BENDIFOUND;