Giter VIP home page Giter VIP logo

inverse_volatility_caculation's Introduction

inverse_volatility_caculation

This is to help people get forward signal of their inverse volatility allocation strategy. https://www.portfoliovisualizer.com/ used to provide this for free, but now it requires a subscription.

If you are interested why this may help build your portfolio, see https://quantdare.com/risk-parity-versus-inverse-volatility/ and https://www.physixfan.com/risk-parity-touziceluegaijinbandongtaidiaozhenguprohetmfdebili/ (in Chinese)

Preparation

pip3 install numpy
pip3 install requests

Example Usage

./inverse_volatility.py
Portfolio: ['UPRO', 'TMF'], as of 2020-02-15 (window size is 20 days)
UPRO allocation ratio: 49.09% (anualized volatility: 39.87%, performance: 5.36%)
TMF allocation ratio: 50.91% (anualized volatility: 38.45%, performance: 11.64%)

Checking against Portfolio Visualizer:

./inverse_volatility.py upro,voo,edv # comma separated symbols
Portfolio: ['UPRO', 'VOO', 'EDV'], as of 2020-02-15 (window size is 20 days)
UPRO allocation ratio: 15.79% (anualized volatility: 39.87%, performance: 5.36%)
VOO allocation ratio: 47.22% (anualized volatility: 13.33%, performance: 2.06%)
EDV allocation ratio: 36.98% (anualized volatility: 17.03%, performance: 5.63%)

Checking against Portfolio Visualizer:

Note

Data source: https://finance.yahoo.com/quote/VOO/history?p=VOO -> Historical Data -> Download Data

Note that the cookie in the code may expire that you need to update the crumb parameter in the url along with your cookie from browser accordingly.

inverse_volatility_caculation's People

Contributors

linzebing avatar

Watchers

 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.