Closed amos-peter closed 1 year ago
@amos-peter Can you specify what you mean by "right" min/max value for the number of assets?
@phschiele It is working no problem using default objectives such min_vol or max_sharpe. However it is not working when i try using convex objective such as maximize a set of scores.
@phschiele i added this code:
booleans = cp.Variable(len(ef.tickers), boolean=True)
ef.add_constraint(lambda x: x <= booleans)
ef.add_constraint(lambda x: cp.sum(booleans) >= 3)
However it is not working if using convex objectives.
Please guide me on how to get the right min/max value for the number of assets. I am working to maximize a set of score objectives with a min/max number of assets constraints.