Created
December 20, 2020 22:07
-
-
Save druce/59191a3dbf58d5cb80b48bdccd28653b to your computer and use it in GitHub Desktop.
po4.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Solve max return portfolio (corner solution) | |
| prob = cp.Problem(cp.Maximize(ret), # maximize return | |
| [cp.sum(w) == 1, | |
| w >= 0] | |
| ) | |
| prob.solve() | |
| wts = [float('%0.4f' % v) for v in w.value] | |
| maxretvol = vol.value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment