Comments (1)
Hi there,
Currently that isn't explicitly supported: it is assumed that you will provide the exact universe of stocks that you can buy, then the algorithm will treat them all as fair game.
However, if you run the portfolio optimisation, you will find that the optimiser naturally produces many near-zero weights. In my initial tests, universes of 50 stocks sometimes had less than 10 with nonzero weights. So I think you might find it worthwhile to just try out a vanilla efficient frontier and see then filter the resulting weights to see how many are non-negligible.
If that doesn't work (i.e you still have too many stocks with non-negligible weights), you may try running the optimisation with a negative gamma
parameter, which will encourage 'centralisation'.
Don't hesitate to reach out if you need any more help!
Robert
from pyportfolioopt.
Related Issues (20)
- Could not install PyPortfolioOpt on macOS Monterey v. 12.5 HOT 6
- Question: How to use PyPortfolioOpt for algo trading strategies rather than stocks/assets HOT 1
- pypfopt\plotting.py specifies an invalid style plt.style.use("seaborn-deep") HOT 1
- setting min and max weights on the stocks for "max_quadratic_utility" , with market_netural=True
- Why Doesn't max_sharp have the option of market neutral portfolio??
- e.g Could not install on Windows CMD (Have tried poetry but no success either, Help)
- question - who owns or maintains this package? Do you need help with maintenance? HOT 7
- TypeErrors in "A quick example"
- ModuleNotFoundError: No module named 'pypfopt.efficient_frontier' HOT 1
- OptimizationError: Please check your objectives/constraints or use a different solver.
- from pypfopt import plotting HOT 1
- Add constraints that ignore NaN scores
- Use of 0.02 default risk-free rate can surprise users HOT 1
- Add fama-french 3 and fama-french 5 factors (can be also 4 or 6) for expected returns HOT 2
- Results not same as portfoliovisualizer.com HOT 1
- What is the right input to EfficientSemivariance?
- Time Varying Constraints Based on Benchmark Weights
- Integrate multiple variants of the Black-Litterman into the Library
- Incorrect File Extension Parsing in save_weights_to_file Method
- Plotting efficient frontier
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyportfolioopt.