try this:
Set a new Variable (as 0) - for this example I will use 'RunOnce'
Add a condition to run your EA only if RunOnce == 0
After your BUY or SELL - set RunOnce to 1
Add an extra condition to set RunOnce to 0 once the Opposite Cross Over happens again
See screenshot

... look for indicator which is doing this things, like zigzag trendline indicator: