Skip to main content

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.

Project description

=======================
Mean Variance Portfolio
=======================


.. image:: https://img.shields.io/pypi/v/mvport.svg
:target: https://pypi.python.org/pypi/mvport

.. image:: https://img.shields.io/travis/condereis/mean-variance-portfolio.svg
:target: https://travis-ci.org/condereis/mean-variance-portfolio

.. image:: https://readthedocs.org/projects/mean-variance-portfolio/badge/?version=latest
:target: https://mean-variance-portfolio.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status


.. image:: https://pyup.io/repos/github/condereis/mean-variance-portfolio/shield.svg
:target: https://pyup.io/repos/github/condereis/mean-variance-portfolio/
:alt: Updates



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://mvport.readthedocs.io.

.. Modern portfolio theory (MPT), or mean-variance analysis, is a mathematical framework for assembling a portfolio of assets such that the expected return is maximized for a given level of risk. It is a formalization and extension of diversification in investing, the idea that owning different kinds of financial assets is less risky than owning only one type. Its key insight is that an asset's risk and return should not be assessed by itself, but by how it contributes to a portfolio's overall risk and return. It uses the variance of asset prices as a proxy for risk.

Features
--------

* Easy portfolio setup
* Portfolio evaluation
* Random portfolio allocation
* Minimum Variance Portfolio optimization
* Efficient Frontier evaluation
* Tangency Portfolio for a given risk free return rate


Installation
------------
To install MV Port, run this command in your terminal:

.. code:: bash

$ pip install mvport

Check `here <https://mvport.readthedocs.io/en/latest/installation.html>`_ for further information on installation.

Basic Usage
-----------

Instantiate a portfolio and add some stock and evaluate it given a set of weights:

.. code:: python

>>> 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 <https://mvport.readthedocs.io/en/latest/usage.html>`_ for further information on usage.

=======
History
=======

1.0.0 (2018-06-28)
------------------

* First release on PyPI.
* Stock class implemented.
* Portfolio class implemented.
* Minimum Variance Portfolio optimization
* Efficient Frontier evaluation
* Tangency Portfolio for a given risk free return rate


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mean-variance-portfolio-1.0.0.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

mean_variance_portfolio-1.0.0-py2.py3-none-any.whl (9.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file mean-variance-portfolio-1.0.0.tar.gz.

File metadata

  • Download URL: mean-variance-portfolio-1.0.0.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

File hashes

Hashes for mean-variance-portfolio-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ae06c105450a81a631ff6c8bc766ea564544a5074baa7c945764982cf8647710
MD5 426b1cceac458bdd3b163424ec7a7111
BLAKE2b-256 e626137821181ec48aa32ba7014b0be3b0d63a1ab4c2c8c37ea4c9f1e0ebf1f8

See more details on using hashes here.

File details

Details for the file mean_variance_portfolio-1.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: mean_variance_portfolio-1.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

File hashes

Hashes for mean_variance_portfolio-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 44548ca6047124f481ecfaeff77d14590d0ee70a70d3e004673515032b02debc
MD5 722e8c1d4039ca12b7cb21e54b903d99
BLAKE2b-256 7ee3af1bbf485d07104629d1e9fa0d00843c2f4b62920bcf5fbfd33488f19020

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page