Giter Club home page Giter Club logo

universal_portfolio's Introduction

universal_portfolio

The universal_portfolio is a Python-based script that allows users to specify a number of stock/mutual fund/exchanged-traded funds over an arbitrary period of time, to specify an investment strategy, and compare investment outcomes.

This Python code seeks to find the investment outcomes of different strategies such as old-fashioned buy-and-hold, as well as active rebalancing - while comparing each of the investment outcome against a benchmark. This benchmark can be arbitrarily specified by a user.

Required Packages

To run the Python code, you must have already installed NumPy, Pandas, Matpotlib, as well as pandas-datareader, and yahoo-finance.

How to Run the Code

Python IDE

Load the .py file in any Python IDE, and run.

Command Line

cd into the directory where the package is saved or downloaded, and python [filename.py]

How to Use the Code

In universal_beat_this.py, you can specify your own beanchmark investment, and further specify a list of tickers to invest in, as well as a starting date of the analysis. These values have been filled in by the project default values, but you are free to change it.

Technical Background

The technical background was inspired by Thomas M. Cover's Universal Portfolio theory . He demonstrated an algorithm for portfolio selection that outperforms the best stock in the market by actively rebalancing the weights of the investments daily. However, his algorithm had not taken into consideration the transaction costs.

This Python code builds upon Cover's theory of actively balancing, and seeks to find the investment outcomes of different strategies such as old-fashioned buy-and-hold, as well as active rebalancing - while comparing each of the investment outcome against a benchmark.

How to Contribute

I welcome your contribution! Portfolio selection is an NP-hard problem, and that can partially explain that the selection process is often an subjective process. Over time, the goal of this quantitative finance project is to show that it is very difficult, if not impossible, to outperform a diversified basket of investment under any strategy, and therefore mitigating the need for a choice set of investments.

License

The content of this repository is licensed under a Creative Commons Attribution License

universal_portfolio's People

Contributors

jehung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.