robertmartin8 / PyPortfolioOpt

Financial portfolio optimisation in python, including classical efficient frontier, Black-Litterman, Hierarchical Risk Parity
https://pyportfolioopt.readthedocs.io/
MIT License
4.43k stars 948 forks source link

Constraints that include an "or" condition #502

Closed OriKatz1 closed 1 year ago

OriKatz1 commented 1 year ago

What are you trying to do? I want for the assets to be either 0% of the optimal portfolio or, say, above 10%. I mean, something like that: opt = EfficientCVaR(expected_returns, scenarios) opt.add_constraint(lambda x : x >= 0.1 if x != 0 ) How can I do that?

What data are you using? My "assets" are real estate markets, no point on investing in a market if the share is very small

robertmartin8 commented 1 year ago

Try #411