Buy Signal condition check afl

I'm stuck in one of the issue to resolve fake signal.

My requirement is when buy condition meet true first time then our code should check buy condition again in 3-4 time within 2-3 second, when last check (4th time) is true, then buy signal plot or generate.

I don't want to use these Cross () or Ref(buy, -1)

Sample condition-

Buy=MACD() >SIGNAL() ;
Sell=MACD() <SIGNAL() ;

Experts help me