Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Max/Min Number of Assets for the optimized Portfolio (pypfopt.efficient_frontier.EfficientCVaR) #529

Open
fstuelzebach opened this issue Apr 6, 2023 · 3 comments
Labels
question Further information is requested

Comments

@fstuelzebach
Copy link

What are you trying to do?
I am optimizing via the pypfopt.efficient_frontier.EfficientCVaR (mainly with efficient_risk() / efficient_return())

I was wondering how one could implement a min. or max. limit regarding the number of assets which the optimized portfolio should hold (as another restriction - like atleast 10 stocks or not more than 30 for example).

In my case efficient_risk() with ratio = 0.2 for example leads to very clumped portfolios for example and even for efficient_return() at ratios between 0.06 und 0.15 out of 52 assets it for example only considers 8 at best.

I am relatively new to python and could really use some help :)

If such a feature already exists i truly am sorry for bringing it up. Thanks in advance for the feedback and of course for the amazing module!

What data are you using?
I am using mainly stocks and optimizing the CVaR for a potential list of >50 assets.

@fstuelzebach fstuelzebach added the question Further information is requested label Apr 6, 2023
@88d52bdba0366127fffca9dfa93895
Copy link
Collaborator

Hi @fstulle,

That kind of stuff is not currently supported, as it requires an additional and complex constraint. I could give you a single line of code for this constraint, but I cannot guarantee the results, so I won’t do that here.

However, I believe this feature (min and/or max number of assets) would be useful for others, especially for practitioners. I’d like to include it in our next version. I hope this will be useful for you and others.

@schlafen318
Copy link

Any update on this? thanks.

@Liam-Deacon
Copy link

Liam-Deacon commented Apr 16, 2024

In addition to min/max number of assets, it would be great to be able state which ones must be included in the result (which must be < nmax). For example we may want at least 3 assets in our portfolio, but we always want to have GOOGL included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants