Chapter 7. Selecting Stocks with Financial Data Analysis

In this chapter, we will cover the following recipes:

  • Computing simple and log returns
  • Ranking stocks with the Sharpe ratio and liquidity
  • Ranking stocks with the Calmar and Sortino ratios
  • Analyzing returns statistics
  • Correlating individual stocks with the broader market
  • Exploring risk and return
  • Examining the market with the non-parametric runs test
  • Testing for random walks
  • Determining market efficiency with autoregressive models
  • Creating tables for a stock prices database
  • Populating the stock prices database
  • Optimizing an equal weights two-asset portfolio

Introduction

Finance deals with many subjects, such as money, saving, investing, and insurance. In this chapter, we will focus on stock investing because stock price data is abundant. According to academic theory, an average investor should not invest in individual stocks, but in whole markets, for instance, a basket of stocks representing large companies within a country. Economists make several such arguments for this theory. First, financial markets are random; therefore, beating an average basket by picking stocks is very difficult. Second, individual stocks are volatile with wild price swings. These price moves get averaged in a basket, which makes investing in a group of stocks less risky.

We will analyze stock prices, but nothing prevents you from reusing the recipes to analyze mutual funds and exchange traded funds or other financial assets. To keep the analysis simple, I limited the selection to half a dozen stocks for well-known U.S. companies, which are also represented in the S&P 500 stock index.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset