I think you should learn the function called Stop Loss