• Stars
    star
    160
  • Rank 230,265 (Top 5 %)
  • Language
    Python
  • Created over 4 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python program that rates stocks out of 100 based on valuation, profitability, growth, and price performance metrics, relative to the company's sector.

Automated Fundamental Analysis via Python

This python program rates stocks out of 100 based on valuation, profitability, growth, and price performance metrics, relative to sector.

View the file StockRatings-04.05.22.csv as an example of the output of this program

How to Run the Code

  1. Clone the repository git clone https://github.com/faizancodes/Automated-Fundamental-Analysis.git
  2. Run cd Automated-Fundamental-Analysis
  3. Download all the dependencies pip install -r requirements.txt
  4. Run stockgrader.py, this will scrape data from all 8300+ stocks on Finviz.com and grade each of them out of 100
    • The program will also generate the CSV files you can use for analysis
  5. Open the csv file created from the program through Excel and analyze!

How to Run the Web App

  1. Run cd WebApp
  2. Run streamlit run app.py
    • If that does not work, run py -m streamlit run app.py
  3. Open the web app in your browser, it will be on localhost

Web App Screenshots

Grading System

The grading system used in this program is based on the normal distribution of values for a certain metric for a specified sector. For example, if I want to grade the Net Margin of a stock in the Technology sector, I look at the net margins of all the stocks in the technology sector and grade the stock's net margin based on its percentile in the distribution of values.

In the figure below, we see that the average net margin for a stock in technology sector is 1.8% and the 90th percentile is 16.45%. The grading system utilized in the program takes the standard deviation of the set of values after removing outliers and divides that number by 3, which is represented by the 'Change' value shown in the figure, equaling 4.68. This is the value that is used to grade each metric for each stock.

The figure shown below represents exactly how each metric is graded, where each bar in the graph is representative of 1 increment of the 'Change' value. Based on this figure and the 'Change' value, a stock in the technology sector with a net margin of:

  • 17% is rated A+
  • 15% is rated A
  • 11% is rated A-

After all the metrics in each category of valuation, profitability, growth, and price performance are graded, the grades are then converted to numbers and then the average of the values is computed. To get the overall rating of a stock, these numerical ratings for each category are added together and multiplied to get a score out of 100.

For metrics where a lower value is considered better, such as P/E ratios, the algorithm will use the 10th percentile as the basis for grading. So if a stock in the Technology sector has a P/E ratio of 10 and that is in the 10th percentile of all P/E ratios for Technology stocks, it will be rated A+.

More Repositories

1

COVID-19-X-Ray-Classification

Utilizing Deep Learning to detect COVID-19 and Viral Pneumonia from x-ray images
Jupyter Notebook
16
star
2

Investment-Insights-Web-App

A web application that provides an array of financial advice.
JavaScript
12
star
3

Resume-Matcher

See how your resume would stack up against an employer's ATS system! Quantify the text in your resume with NLP to calculate how good of a match you are with an internship position
Python
8
star
4

NBA-Pose-Estimation-Analysis

Analysis of NBA shooting forms with Pose Estimation
Jupyter Notebook
7
star
5

Algo-Trading-ML-Model

Machine Learning model that identifies optimal buy and sell points for stocks. Can also be used to test user-defined algorithmic trading strategies.
Python
6
star
6

Spotify-ML-Music-Recommendations

Music recommendations based on your favorite artists and songs powered by machine learning
Python
5
star
7

Job-Listing-Scraper

Speed up your job application process with python! Gain access to hundreds of job listings with direct URLs to apply for each position in seconds.
Jupyter Notebook
4
star
8

Financial-Statement-Screener

Scrape through thousands of financial statements in minutes!
Jupyter Notebook
4
star
9

Insider-Trades-Visualizer

Visualize the points in which insiders purchase shares of stock
Jupyter Notebook
3
star
10

AI-Generated-Art

Utilizing GANs for Art generation
Jupyter Notebook
3
star
11

Stock-Portfolio-Backtester

Efficient way to backtest optimized portfolio allocations for proper hedging techniques.
Python
3
star
12

Stock-Ratings

This program gives a stock a numerical and letter rating based on the company's valuation, profitability, growth, and performance metrics.
Python
3
star
13

Algo-Trading-Strats

Application of various algorithmic strategies to produce max alpha
Jupyter Notebook
3
star
14

quantexcapital

Advanced Stock Screener
Python
2
star
15

Breast-Cancer-Detection

Machine learning model to identify if a tumor is malignant or benign
Jupyter Notebook
2
star
16

Options-Spread-Calc

Optimizing profit on call spread strategies for options trading
Jupyter Notebook
2
star
17

Atlas-Code

Atlas is a fully 3D printed car powered by Arduino that I designed using Fusion 360. The car is capable of avoiding objects autonomously and be controlled via bluetooth on an iPhone app.
C++
2
star
18

Quantex-Twitter-Bot

This is a twitter bot I developed that utilizes web scraping to find key data and insights on stocks. The program features multiple functions which have the ability to find the top performing stocks for the week, stocks that have the highest ROE compared to their industry average, find stocks with the lowest PEG ratios, and much more. I run the program on the Google Cloud platform and it tweets automatically straight to the @quantexbot twitter account.
Python
2
star
19

NBA-Finals-Teams-Predictions

Machine Learning program that aims to predict the teams that will reach the NBA finals
Python
1
star
20

NBA-ML-Team-Win-Predictions

Machine Learning model to predict NBA team wins per season
Python
1
star
21

Automated-Options-Returns-Analysis

An automated way to analyze the returns of various options strategies
Python
1
star
22

Network-Graphs

Visualize network graphs to see how certain topics are related to each other
Jupyter Notebook
1
star
23

Headstarter-Bot

Documentation on the Headstarter Discord Bot
1
star
24

Stock-Industry-Comparisons

Python
1
star