help me with ea to make it stop trading

 

hi, can any one please help me with ea ,

basically it is support and resistance ea , when price cross above resistance or below support ea opens a order if spread is in range that i set for it  , but it has problem that if spread is to high when price cross above or below S or R, ea will not open a trade that moment but will open a trade as soon as spread drop to the range ? and i dont want that , i wan it to cancel that trade if spread is to high when price cross S/R 




Reason: