IDEAS home Printed from https://ideas.repec.org/c/boc/bocode/s457712.html
 

MVPORT: Stata module for Collection, Optimization and Backtest of Financial Portfolios

Author

Listed:
  • Alberto Dorantes

    (Tecnológico de Monterrey)

Programming Language

Stata

Abstract

This package is a set of 12 commands designed to a) collect online financial data, b) optimize portfolios, c) simulate portfolios, and d) backtest portfolios. The 12 commands are the following: 1) returnsyh - gets prices and trade volume of a list of stocks from Yahoo Finance, computes simple and continuously compounded returns, and integrates the data in one dataset 2) meanrets - calculates the expected simple returns of a historical series of continuously compounded returns or simple returns. Expected returns can also be calculated using weights from other variable or using the exponentially weighted moving average (EWMA) method. 3) varrets - calculates the variance-covariance matrix of a series of continuously compounded returns. The variance-covariance matrix can also be estimated using weights from a variable or using the exponentially weighted moving average (EWMA) method. 4) gmvport - calculates the global minimum variance portfolio of a set of continuously compounded returns following Portfolio Theory. 5) mvport - calculates the minimum variance portfolio given a required return following Portfolio Theory. 6) ovport - calculates the optimal variance portfolio that lies in the Capital Market Line. 7) efrontier - generates and graph two efficient frontiers: with and without allowing for short sales. 8) cmline - generates and graph the efficient frontier along with the capital market line when adding a risk-free asset. 9) simport - simulates random portfolios inside the portfolio frontier 10) holdingrets – calculates the holding period return of one or more price variables of a sorted time series dataset 11) backtest - performs a backtest of a financial portfolio. It calculates the holding period return of a specific portfolio 12) cbacktest – performs a cumulative backtest of a financial portfolio. For each time period, a holding return is calculated. It also graphs the cumulative holding period return of the portfolio for all periods. The optimization commands gmvport, ovport, efrontier, and cmline allow for weight constraints such as minimum and/or maximum weights for each asset. They also allow to use any variance-covariance matrix and any vector of expected asset returns. The variance-covariance matrix and the vector of expected returns can be calculated using the EWMA method. In addition, these commands performs risk decomposition for each portfolio asset using Euler’s theorem of decomposition for homogenous functions.

Suggested Citation

  • Alberto Dorantes, 2013. "MVPORT: Stata module for Collection, Optimization and Backtest of Financial Portfolios," Statistical Software Components S457712, Boston College Department of Economics, revised 02 Sep 2016.
  • Handle: RePEc:boc:bocode:s457712
    Note: This module should be installed from within Stata by typing "ssc install mvport". The module is made available under terms of the GPL v3 (https://www.gnu.org/licenses/gpl-3.0.txt). Windows users should not attempt to download these files with a web browser.
    as

    Download full text from publisher

    File URL: http://fmwww.bc.edu/repec/bocode/m/mvport.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mvport.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/b/backtest.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/b/backtest.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/c/cbacktest.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/c/cbacktest.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/c/cmline.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/c/cmline.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/e/efrontier.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/e/efrontierm.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/e/efrontier.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/g/gmvport.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/g/gmvport.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/h/holdingrets.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/h/holdingrets.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/meanrets.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/meanrets.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/o/ovport.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/o/ovport.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/r/returnsyh.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/r/returnsyh.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/s/simport.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/s/simport.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/v/varrets.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/v/varrets.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/l/lportheory.mlib
    File Function: Mata object library
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mvport.mata.zip
    File Function: Mata source code archive
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/b/backtest-test.do
    File Function: sample do-file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/b/backtest-test.do
    File Function: sample do-file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/c/cbacktest-test.do
    File Function: sample do-file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/c/cmline-test.do
    File Function: sample do-file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/e/efrontier-test.do
    File Function: sample do-file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/g/gmvport-test.do
    File Function: sample do-file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/h/holdingrets-test.do
    File Function: sample do-file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/meanrets-test.do
    File Function: sample do-file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mvport-test.do
    File Function: sample do-file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/o/ovport-test.do
    File Function: sample do-file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/s/simport-test.do
    File Function: sample do-file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/v/varrets-test.do
    File Function: sample do-file
    Download Restriction: no
    ---><---

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Colombo, Jefferson A. & Cruz, Fernando I. L. & Paese, Luis H. Z. & Cortes, Renan X., 2021. "The diversification benefits of cryptocurrencies in multi-asset portfolios: cross-country evidence," Textos para discussão 542, FGV EESP - Escola de Economia de São Paulo, Fundação Getulio Vargas (Brazil).

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:boc:bocode:s457712. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Christopher F Baum (email available below). General contact details of provider: https://edirc.repec.org/data/debocus.html .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.