Skip to content

matthewebates/financial_data_analysis

Repository files navigation

Financial Data Analysis

This project explores correlation between trends in trader/investor online information gathering and subsequent stock price movements. This involves using third-party APIs and custom requests to retrieve current and historical stock price data from Yahoo Finance, calculating metrics for comparing stock performance over time (n-day trailing returns averaged over some time period, arbitraily large magnitude gains or losses). These data are compared with time series of internet serach term frequncy, from Google Trends, for search queries related financial performance of individual stocks or market benchmarks. The project seeks to identify terms and temporal lags that show the highest correlations between the search term frequency data and stock prices.

It has been reported in multiple journal articles and white papers (authored or co-authored by Google employees and others, see literature review file for links) that an increase in financial-market-realted search terms can be associated with a subsequent stock sell off. This is related to concepts of risk aversion and information gathering in decision theory, where individuals may spent more time investigating sources of potential losses than potential gains (of equal size), and seek this information prior to making their trades.

This project includes using API use, making custom web data requests, calculating derived indicators, statistical analysis, exploring cross-correlation between lagged time series, and tabulation and graphical display of results. Machine learning could also be relevant, but simple statistical correlation provides a sufficient first pass.

Links to project files and pages:

  • For a literature review, see here.
  • For notes on working with Google Trends, see here.
  • For a summary of the analysis plan and task list, see here.
  • For a detailed and descriptive code explaining and demonstrating how to work with the Google Trends data, and development of functions to support that analysis, see here.
  • For a detailed and descriptive code explaining and demonstrating how to work with the Yahoo Finance data, and development of functions to support that analysis, see here.
  • For the final analysis combining functions from these two files (without the verbose descriptions and explainations shown elsewhere), applying them to data for Coca-Cola, and performaning the final cross-corrolation analysis, see here.
  • For a summary of approach and results in powerpoint format, see here.

About

Explores cross-correlation between time series of internet search term frequency and subsequent stock losses.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published