Code Monkey home page Code Monkey logo

portfolio_optimize_pmpt's Introduction

Portfolio Analysis and Optimization using Post-Modern Portfolio Theory (PMPT)

IN DEVELOPMENT

This project is about Post-Modern Portfolio Theory (PMPT) based analysis and optimization of a given portfolio’s returns based on individual risk tolerance. It is the continuation and natural evolution of the original project referenced in contributions section below.

The project tries to solve a typical business problem of a Portfolio Manager to find an optimal construction of an investment portfolio.

The post-modern portfolio theory (PMPT) is a portfolio optimization methodology that uses the downside risk of returns instead of the mean variance of investment returns used by the modern portfolio theory (MPT). Investopedia

The Post-Modern Portfolio Theory :

key concepts:


Technologies

This project leverages python 3.7.* with the following additional packages:

  • Jupyter Notebook - The main module of the Financial Planner is written in Jupyter Notebook.
  • Conda - Conda environment is recommended to have Pandas library and other dependencies pre-installed.

Required Libraries:

You may need the following libraries to work with the application.

  • Pandas - pandas is a Python package providing fast, flexible, and expressive data structures designed to make working with “relational” or “labeled” data both easy and intuitive.
  • NumPy - NumPy is the fundamental package for scientific computing in Python.
  • yfinance - Download market data from Yahoo! Finance's API
  • SQLAlchemy - SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL.

import pandas as pd import sqlalchemy as sql import numpy as np import scipy as sci import matplotlib.pyplot as plt import scipy.optimize as sco

import yfinance as yf

import hvplot.pandas import holoviews as hv import seaborn as sns import copy

from pathlib import Path

from pandas_datareader import data as pdr from pandas import Timestamp as tstamp from pandas import read_csv as rcsv from pandas import read_sql_query as rsqq from sqlalchemy import ( create_engine as ce, inspect )

Import date and timedelta class

from datetime import date from datetime import timedelta from scipy import stats

from MCForecastTools import MCSimulation from calculations import MPTCalculations as mpt from metrics import QuantMetrics as qm from dataset import DataCollection as ds

import warnings


Technologies


Dependencies

This project leverages Jupyter Lab v3.4.4 and python v3.7 with the following packages:

import os

  • pandas - Software library written for the python programming language for data manipulation and analysis.

  • read_csv - From 'pandas', reads a comma-separated values (csv) file into DataFrame.

  • concat - From 'pandas', concatenate pandas objects along a particular axis, allows optional set logic along the other axes.

  • numpy - Software library, NumPy is the fundamental package for scientific computing in Python, provides vast functionality.

  • Path - From pathlib - Object-oriented filesystem paths, Path instantiates a concrete path for the platform the code is running on.

  • hvplot - provides a high-level plotting API built on HoloViews that provides a general and consistent API for plotting data into numerous formats listed within linked documentation.

Hardware used for development

MacBook Pro (16-inch, 2021)

Chip Appple M1 Max
macOS Monterey version 12.6

Development Software

Homebrew 3.5.10

Homebrew/homebrew-core (git revision 0b6b6d9004e; last commit 2022-08-30)
Homebrew/homebrew-cask (git revision 63ae652861; last commit 2022-08-30)

anaconda Command line client 1.10.0

conda 4.13.0
Python 3.9

pip 22.1.2 from /opt/anaconda3/envs/dev/lib/python3.7/site-packages/pip (python 3.7)

git version 2.37.2


Installation of application (i.e. github clone)

In the terminal, navigate to directory where you want to install this application from the repository and enter the following command

git clone git@github.com:Billie-LS/Portfolio_Optimize_PMPT.git

Usage

From terminal, the installed application is run through jupyter lab web-based interactive development environment (IDE) interface by typing at prompt:

  > jupyter lab

The file you will run is:

  nmpt.ipynb

Contributors

Skylizard, Loki 'billie' GitHub LinkedIn

Conyea, Will GitHub LinkedIn

Original Project Contributors

Modern Portfolio Theory Based Portfolio Analysis and Optimization

Peers of FinTech Blended Boot Camp, Columbia Engineering (2022-23 Batch)


License

MIT License

Copyright (c) [2022] [Loki 'billie' Skylizard]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

portfolio_optimize_pmpt's People

Contributors

billie-ls avatar

Stargazers

 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.