Analyzing Stock Screener Data for Investing

Posted on Dec 20, 2019

Introduction

The world of investing has always been fraught with a myriad of choices and decisions one must make to succeed. Everything from what financial products to invest in to when to purchase or sell. Stock screeners have been a tool that has made it easy to filter stocks based on user-defined metrics. I wanted to scrape data from a stock screener named "Finviz" in order to explore the stocks in the "New York Stock Exchange" (NYSE).

The objective of this web scraping project was to visualize the important data sets one must examine when an individual such as a portfolio manager is deciding what type of stocks to invest in over the long term.

Data

All data the was scraped from the stock screener located at Finviz.com. The filter was set to extract information from the NYSE. This resulted in 4353 rows of data with 11 different columns. "Scrapy" was used as the means of extracting the data.

Information Extracted:

  • No (Number)
  • Ticker
  • Company
  • Sector
  • Industry
  • Country
  • Market Cap
  • PE
  • Price
  • Change 
  • Volume

Data Analysis:

How many stocks are in each sector of the  NYSE?

The financial sector is the sector with the greatest number of stocks. An investor looking to diversify a portfolio must make sure they do not over-invest in the financial sector. 

What are the 5 top countries represented in the NYSE?

The top five countries in the NYSE are the USA, Canada, China, the United Kingdom and Brazil. An investor would get a better an idea of how to diversify a portfolio internationally and which countries to focus on. Nevertheless, the USA makes up a large portion of the NYSE.

What are the five (5) most popular industries?

Exchange traded funds makes up the top industry in the NYSE followed by closed end funds. This information would also help investors not be overexposed to any one industry.

What are the PE ratios in the NYSE?

PE ratios are price earning ratios and they are used to measure the share price of a stock relative to the annual net income earned by the firm per share. A high PE ratio usually means a stock is overvalued whereas a low PE ratio means the stock is undervalued.

The above chart has removed all PE ratios that are 0 or negative resulting in the highest range of PE ratios in the 15 to 20 range.

Examining sectors with respect to PE

It is a good idea to examine the relationship between the PE ratios and respective sectors of the economy. This would give an investor a good idea of which sectors are undervalued and overvalued.

All sectors except for the "financial sector" and "conglomerate sector" have an interquartile range between 0 and 22. The conglomerate sector has a few outliers but no interquartile range showing. The financial sector is also not showing an interquartile range but rather a spattering of PE values between approximately 22 to 50.

Analyzing the relationship between price, PE and the sectors 

The chart above shows the relationship between the price of each stock, the PE (price earnings ratio) and the relative sectors. This visualization makes it easy for an investor to determine how to invest by analyzing 3 of the most useful variables one must consider when creating a portfolio.

To make the relationship easier to analyze, we scale the x-axis to log scale in the chart below:

One can see the financial sector seems to dominate most of the chart.

Summary

In conclusion, our use of "Scrapy" and data visualization has allowed us to gain a greater understanding of the data one must consider when investing. The NYSE data we examined seemed to be primarily concentrated by financial stocks in the USA with the largest number of stocks having a PE range between 15 and 20.

Our key takeaway from this project is that our scraping and data science tools would definitely be important in analyzing and increasing profitability for anyone looking to invest in the stock market.

The skills the authors demonstrated here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.

About Author

Steven Owusu

Steven Owusu has several years experience working as a credit analyst. He holds a Masters of Business Administration from Columbia Business School. Steven loves applying data science techniques to solving real world business problems.
View all posts by Steven Owusu >

Leave a Comment

No comments found.

View Posts by Categories


Our Recent Popular Posts


View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI