During a course the question posed was to find a small portfolio of n stocks with a good Sharpe Ratio. Of course we use an MINLP to help us with that:
This model picks both n instruments and the weights. The r’s are the (daily) returns for the individual symbols and R indicates the return for the portfolio. Actually I could do this with Excel Solver for the small data set I used.
For a pure Sharp Ratio optimization problem several smart algorithms are available (e.g. http://papers.ssrn.com/sol3/Delivery.cfm/SSRN_ID1437644_code1141713.pdf?abstractid=1437644&mirid=1, http://papers.ssrn.com/sol3/Delivery.cfm/SSRN_ID1767338_code1619061.pdf?abstractid=1767338&mirid=1). However here we want a cardinality constrained version, and that makes things a little bit more difficult. For a more standard cardinality constrained mean-variance problem, an MIQP model can be formulated (also a lot of research papers with alternative algorithms for this case are available).
These “n out of m” problems tend to be difficult to solve to full optimality using MIP/MINLP solvers.
PS. Interesting paper on cardinality constrained portfolio optimization algorithm by Stanford’s Walter Murray and Howard Shek: http://link.springer.com/article/10.1007/s10589-012-9471-1.