We consider a broad class of dynamic portfolio optimization problems that allow for complex models of return predictability, transaction costs, trading constraints, and risk considerations. Determining an optimal policy in this general setting is almost always intractable. We propose a class of linear rebalancing rules and describe an efficient computational procedure to optimize with this class. We illustrate this method in the context of portfolio execution and show that it achieves near optimal performance. We consider another numerical example involving dynamic trading with mean-variance preferences and demonstrate that our method can result in economically large benefits.