In this paper, we study the problem of optimal trading using general alpha predictors with linear costs and temporary impact. We do this within the framework of stochastic optimization, with a finite horizon using both limit and market orders. Consistently with other studies, we find that the presence of linear costs induces a "no-trading" zone when using market orders, and a corresponding "market-making" zone when using limit orders. We show that, when combining market and limit orders, the problem is further divided into zones in which we trade more aggressively using market orders. Even though we do not solve analytically the full optimization problem, we present explicit and simple analytical "recipes" that approximate the full solution and are easy to implement in practice.We test the algorithms using Monte Carlo simulations and show how they improve our profit and losses.