Stock Portfolio: Fundamental analysis for 13,000+ US equities and ETFs, Including Market Caps and Volume Price Trend

Hamid Gholizadegan
4 min readMay 15, 2020

NASDAQ and the New York Stock Exchange (NYSE) are the two largest stock exchanges in the world, providing a platform for trading securities. Each day there are millions of orders routed through the major financial exchanges. Whenever someone talks about the stock market as a place where equities or ETFs are exchanged between buyers and sellers, the first thing that comes to mind is either the New York Stock Exchange (NYSE) or NASDAQ. In this data science project, I collect information about basic enterprise information from all those stocks which is, among other things, the day high, market capital, open and close price and price-to-equity ratio and dollar volume from more than 13,000 stocks, exchanging in more than stock market exchanges including. In this project you will see:

  • Fetching the price of a day, previous close price, price change and percentage change for more than +13,000 stocks and creating a single data frame for all stocks.
  • Piloting top 100 stocks in terms of market capital.
  • Calculating and Generating data visualization for top 20 losers and gainers in today’s stock market.

Create a single data frame for +13K stocks from different stock market exchanges

Most data analysts try to analyze a single or group of stocks. I generated a single data frame for all stocks’ basic information to analyze the whole market capital exchange in one day. Here is all stock’s data frame for actual companies’ information which shows the head and tail of the data set with 13063 rows(stocks).

Visualizing the Stock Market corporation Market capital

Market capitalization is the market value of a publicly traded company’s outstanding shares. Market capitalization is equal to the share price multiplied by the number of shares outstanding. Equity markets around the world collectively lost $30 trillion in market cap between February 14, 2020 and March 20, 2020, and then clawed back more than half of the loss in the following month.

Because plotting all stock’s market capital is not readable with one graph by laptop or desktop screen, I chose to visualize top 100 corporation’s market capitals for 13th May.

There are some familiar faces at the top of this tree map: Microsoft, Amazon, Google, Apple and Facebook make up the top 5. these top 5 companies make up 18% of the S&P 500’s market cap.

Volume Price Trend (VPT)

The volume price trend (VPT) indicator adds or subtracts multiples of a percentage change in present stock volume and share price in accordance with their respective upward or downward movement. The VPT is a technical momentum indicator that is utilized by investors and analysts to identify the parity between the supply and demand of a stock. The percentage of change in the trend of share price is indicative of relative supply or demand of a particular stock and volume is indicative of the strength of buying or selling momentum. The code and calculation can be summarized as doing the following:

df_stocks['VPT'] = df_stocks["volume"] * df_stocks["percentage_of_change"]

Top 20 Loser and Gainers in stock market in terms of Volume Price

There are different approaches to find top gainers and losers in terms of profitable trades. Most of stock market analytics like yahoo find those lists are based on percentage to show better view for traders and investors. My approach is based on volume price trend. in these three maps below show VPT’s top 20 gainers and top losers in stock market.

Conclusion

These largest stocks in the S&P 500 index are all up 13% during the past month and make up a larger share of the S&P 500 than at any point in more than 30 years, giving them an outsized role in determining moves in the major benchmarks. As this analysis shows the trend of stock market in the last 24 hours, the stock market react to economic, when April’s unemployment numbers were announced. There was a lost for most of stocks yesterday. However, I hope that I’ve demonstrated how visualizations can help us digest complex datasets and begin to tackle challenging problems.

You can check my other articles in my LinkedIn profile:

https://www.linkedin.com/in/hamid-gholizadegan-mba-29ba268a/detail/recent-activity/posts/

--

--

Hamid Gholizadegan
0 Followers

Data scientist with a refined ability to combine business objectives with statistical methods and big data tools & technologies.