EA to cancel traces if price retraces before your limit order

I know nothing about EAs. But I have been having a problem with my limit orders. If say price comes down to my level but doesn’t actually reach my order say less than 8pips or 10 pips. Then bounces away say 20-30 pips is there a way I could cancel the limit order there???