Answer
When price falls outside your range could mean you got your analysis wrong so depending on type of trading will decide if you close it or not. if its a long term trade you can still hold and wait for price to return to range however if it a short term trade you can accept loss re evalute your trade and reset your bot