We study the optimal timing strategies for trading a mean-reverting price process with afinite deadline to enter and a separate finite deadline to exit the market. The price process is modeled by a diffusion with an affine drift that encapsulates a number of well-known models,including the Ornstein-Uhlenbeck (OU) model, Cox-Ingersoll-Ross (CIR) model, Jacobi model,and inhomogeneous geometric Brownian motion (IGBM) model.We analyze three types of trading strategies: (i) the long-short (long to op...