Giter Club home page Giter Club logo

markowitz-portfolio-management's Introduction

Markowitz Portfolio Management

Learnt about the Markowitz theory to diversify portfolio to earn a particular interest with the smallest amount of risk and implemented the theory in python by analysing the Nifty 50 stocks over 4 years.

  • Analyzed the Nifty 50 stocks from 01/01/2016 to 31/11/2020 with Numpy and Pandas.
  • Calculated the Volatility , Compound Annual Growth Rate(CAGR) and Sharpe Ratio for the stock price series.
  • Indentified the top 15 stocks with highest Sharpe Ratio.
  • Initialized random weights to the 15 stocks (600000 different sets of weights to have a large representative sample) and calculated the expected return, volatility and sharpe ratio corresponding to each of the weights.
  • Identified the maximum sharpe ratio of the weight and plotted the portfolios on a Scatter Plot using MatPlotLib.
  • Plotted the Efficient Frontier using SLSQP method.
  • Distributed a total amount of 1,00,00,000 to get the amount of money for each stock and the number of stocks in our portfolio.
  • Tested the Portfolio generated from the observation period(2016-2020). Testing period : 1 Jan'21 - 30 Jun'21.
  • Scraped the data of stocks from Yahoo using the yfinance library.
  • Compared the portfolio with the benchmark(Nifty 50) over several metrics:
    1. Total Return on Portfolio
    2. Volatility and Sharpe Ratio
    3. Beta
    4. Jenson's Alpha
    5. Sortino/Teynor Ratio

Datafile: nifty50.csv

markowitz-portfolio-management's People

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.