Giter VIP home page Giter VIP logo

portfolio-optimization's Introduction

Portfolio Optimization in Python

Table of Contents

Overview

A simple python project where we use price data from the NASDAQ website to help optimize our portfolio of stocks using modern portfolio theory.

Setup

Right now, the library is not hosted on PyPi so you will need to do a local install on your system if you plan to use it in other scrips you use.

First, clone this repo to your local system. After you clone the repo, make sure to run the setup.py file, so you can install any dependencies you may need. To run the setup.py file, run the following command in your terminal.

pip install -e .

This will install all the dependencies listed in the setup.py file. Once done you can use the library wherever you want.

Usage

Here is a simple example of using the pyopt library to grab the index files for specific quarter.

import pandas as pd
from pyopt.client import PriceHistory

# Define the symbols
symbols = ['AAPL', 'MSFT', 'SQ']
number_of_symbols = len(symbols)

# Initialize the client.
price_history_client = PriceHistory(symbols=['AAPL','MSFT','SQ'])

# Dump it to a CSV file.
price_history_client.price_data_frame.to_csv(
    'stock_data.csv',
    index=False
)
pprint(price_history_client.price_data_frame)

Support These Projects

Patreon: Help support this project and future projects by donating to my Patreon Page. I'm always looking to add more content for individuals like yourself, unfortuantely some of the APIs I would require me to pay monthly fees.

YouTube: If you'd like to watch more of my content, feel free to visit my YouTube channel Sigma Coding.

portfolio-optimization's People

Contributors

areed1192 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.