The following lecture talks about the Markowitz Portfolio Optimization problem in convex optimization. Indeed, many variants of this problem exists, but the classical one looks like this
where is an sized vector containing the amount of assets to invest in. The vector is the mean of the relative price asset change and the matrix is the matrix of variance-covariance of assets. The parameter is minimum accepted returns.
Learn more about the above problem and its application to the stock market by watching the above lecture.