MV Port is a Python package to perform Mean-Variance Analysis. It provides a Portfolio class with a variety of methods to help on your portfolio optimization tasks.
- Free software: MIT license
- Documentation: https://mean-variance-portfolio.readthedocs.io.
- Easy portfolio setup
- Portfolio evaluation
- Random portfolio allocation
- Minimum Variance Portfolio optimization
- Efficient Frontier evaluation
- Tangency Portfolio for a given risk free return rate
To install MV Port, run this command in your terminal:
$ pip install mvport
Check here for further information on installation.
Instantiate a portfolio and add some stock and evaluate it given a set of weights:
>>> import mvport as mv
>>> p = mv.Portfolio()
>>> p.add_stock('AAPL', [.1,.2,.3])
>>> p.add_stock('AMZN', [.1,.3,.5])
>>> mean, variance, sharp_ratio, weights = p.evaluate([.5, .5])
>>> print '{} +- {}'.format(mean, variance)
0.25 +- 0.0225
Check here for further information on usage.