Given the many possible objectives and constraints involved in choosing a query and the trade-offs possible among these factors, the problem of finding a .good. query model is complex. However, there is a principled framework that allows us to structure the problem by making our assumptions clear and allowing us to control how we manage competing tradeoffs between objectives, while providing efficient computational methods to find solutions. This is the approach known as convex optimization (CO). Using a novel application of methods from portfolio selection in computational finance, we show that even simple CO methods, with easy-to-understand objectives and constraints, help us balance the various trade-offs required of the optimal query model, such as the trade-off between expected return (a good feedback model) and model variance (the amount of harm if wrong). Typically, our optimization will embody a basic tradeoff between wanting to use evidence that has strong expected relevance (such as highly-ranked documents, or highly-weighted expansion terms), and the variance or risk of using that evidence, or variance in covering the query aspects. We also discuss how our optimization framework may be generalized beyond query models to other areas of IR, and comment on additional types of objectives such as sparsity.