Detecting a break away

 
I have a decent automation that works well for channeling scalps, but I seem to take a hit when the market breaks out of the channel to a new level. I was wondering if someone has code or an indicator that would help me to identify a channel break out. It would not be to bad I guess if I knew it was going to happen, but it happens within a couple of candles after placing a reversing trade. This is on a M5 so if I wait a couple candles to decide on the move, but that would kill the scalp opportunity.
 
any suggestions?
Reason: