Tips on how to avoid fake crossovers

 

Good Day..

I develop an EA on 2 simple moving averages to which it will Open/Close trades when 2 sma's crossed. The only problem is that, sometimes, the 2 sma's almost cross each other but after a few ticks it will not eventually cross and for that instant, trades will be Opened or closed according to direction... Do you have any tips on how to eliminate the "faking cross"?

Thank you very much...

 
Don't use bar_0 information. Exception would be bar_0 open price only.