DIF:=EMA(C,12)-EMA(C,26);
DEA:=EMA(DIF,9);
macd:=2*(DIF-DEA);
S05:=SUM(MacD,0);
QST:=BArslAST(MACD<0 AND REF(MACD,1)>0)+1;
QXT:=BARSLAST(MACD>0 AND REF(MACD,1)<0)+1;
S5:=IF(MACD>0,S05-REF(S05,BARSLAST(MACD<0)),S05-REF(S05,BARSLAST(MACD>0)))/10;
ST:=IF(MACD>0,REF(QST,QXT)+QXT,REF(QXT,QST)+QST);
RS5:=REF(S5,ST);
BC:IF(MACD>0 AND S5<RS5,0,IF(MACD<0 AND S5>RS5 AND DEA<0,1,0));