Hi
I was thinking of between a min and max to be safe. It depends how tight you want the conditions.
and selection’s back price is greater than r_ticks(near_sp,-5)
and selection’s back price is less than r_ticks(near_sp,5)
and selections trigger expression g_ticks(back_price,lay_price) is less than 10
and market’s minutes before the off is less than 2
You can adjust the numbers as you want, but this should stop that happening again.
Edit:
Obviously the above conditions apply to before the off, so you would have another condition block for in-play:
OR
market's status is in-play
(here your price formula kicks in)