GithubHelp home page GithubHelp logo

rodolphekouyoumdjian / stockscorrelation Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 8.53 MB

A program that will return the Pearson correlation coefficient of the stocks entered. One coefficient is returned for each possible pair. The program will plot a heat map and will return a CSV file containing the correlation of each possible stock pair.

Python 0.02% Jupyter Notebook 99.98%
pearson-correlation-coefficient stock-market

stockscorrelation's Introduction

StocksCorrelation

A program that will return the Pearson correlation coefficient of the stocks entered. One coefficient is returned for each possible pair. The program will plot a heat map and will return a CSV file containing the correlation of each possible stock pair.

Line 12 & 13: Start and end date of data used to calculate the Pearson correlation coefficient. Line 70: Set the annot parameter to True if you want the correlation coefficients to be written on the heatmap, False in the opposite case.

If you wish to change the dates or remove/add stocks, restart the program.

In the tickers.txt textfile, write one stock symbol per line. The stock symbol of the company should be the same as the ones written on finance.yahoo.com

Libraries used: pandas, numpy, scipy, datetime, seaborn, matplotlib.pyplot, yfinance, warnings,

The file Stocks_correlations_by_industry.ipynb was added as a follow up to the initial idea. The code for the basic tool was improved and an analysis concerning the results was conducted. See bottom of file for conclusions.

stockscorrelation's People

Contributors

rodolphekouyoumdjian avatar

Stargazers

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