Hi everyone!
I am using solver to set up the best portfolio (which is just a set of weights) given an x number of stocks. For instance, I might have data for 100 stocks and with this data, solver will give me the optimal weights of each stock for my portfolio by maximizing a ratio that takes into account both expected returns and volatility (sharpe ratio). The problem that I am facing is related to the constraints: I am trying to set a maximum number of stocks (i.e., maximum number of non-zero values for weights) but solver keeps saying that it can't find any feasible solution. Important to note that there are in fact feasible solutions. Can anyone help me? By the way, as a constraint for the maximum number of stocks i was using a countif (non-zero) function which seems to work for a small number of stocks (I tried with only 5) but not for 100 as in my case.
Thanks in advance!
Bookmarks