You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Question:How to set the total number of stocks #13
Thanks for this program! It is awesome!
Counld you hlep me figure out how to set the limit of total number of stocks?
For example, the data contains about 2000 stocks, and I want to get a portfolio which has only 100
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
Activity
robertmartin8 commentedon Jan 5, 2019
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
gammaparameter, which will encourage 'centralisation'.Don't hesitate to reach out if you need any more help!
Robert