Trading stops are often used by traders to risk manage their positions. In this talk, we show how to derive optimal trading stops for generic algorithmic trading strategies when the P&L of the position is modeled by a Markov modulated diffusion. Optimal stop levels are derived by maximising the expected discounted utility of the P&L. The approach is independent of the signal used to enter the position. We analyse in detail the case of trading signals with a limited (random) life. We show how to calibrate the model to market data and present a series of numerical examples to illustrate the main features of the approach.