1 of 26

Stock Market Shiny app

Yicheng Shen, Zheng Ren, Angela Zhao, Yuzi Li

2024.12.12

2 of 26

Requirement

Presentation quality: Is the presentation clear on what was the question being investigated? What were the original goals and what was accomplished along the way? Was there previous work in this area? Are the slides readable? Do the figures have large enough legends and figure titles? Did you describe the data?

Paradigm integration: How effectively does your project demonstrate multiple paradigms?

Functionality: Does the data analytic product work as intended? Are the components well-integrated?

Usability and documentation: Is the data analytic product easy to use/read and well-documented?

Originality and complexity: Does the project address a non-trivial statistical or programming problem with creativity?

3 of 26

Overview

You should describe a research or data analysis question and explain its importance

You should summarize work that already exists (if it does)

You should outline the work you plan to do

You should demonstrate you have access to the data, describe the data, and propose how you will collect the data

You should describe the programming paradigms you plan to use and why it makes sense to combine them for your project

You should describe any packages and/or software you plan to use

You should briefly describe the data analytic product you plan to build

4 of 26

Background

  • Investing in stocks involves buying shares of a company to own a portion of it
    • You earn a profit when stock price goes up�
  • Retail investors: individual, non-professional investors that buy and sell for their personal accounts�
  • Institutional investors are large organizations (e.g. hedge funds, banks, insurance companies)

5 of 26

Project Objective

S&P500 2023 performance (%): 26.3�Hedge funds:

Data from https://fundselectorasia.com/10-funds-that-beat-the-sp-500-by-over-20-in-2023/

6 of 26

Existing work

  • Gold-standard: Bloomberg Terminal
    • $30-50k/year�
  • Free options: Yahoo Finance/Stocks tracker
    • Real-time market data, news, portfolio tracking�
  • Jargon-heavy, investment research tools that can be confusing and distracting for many (and still very time consuming)�
  • Lack of statistical modelling and prediction

Stock Tracker.com

7 of 26

Programming Paradigms

  1. Functional programming:
    1. Higher-order functions such as sapply(), map() from the purrr package, e.g.:�`port_ret <- sum(map_df(price_data[-1] + 1, prod) * weights) - 1`
    2. Anonymous functions, e.g. defining slider values in the UI for portfolio specification: �weights <- sapply(weight_id, function(id) {input[[id]]})
    3. Function composition: helper functions were used in other functions�
  2. Machine learning
    • Unsupervised learning: K-means clustering

8 of 26

Our Data

Data source: Yahoo! Finance + library(tidyquant)

9 of 26

Our Data

  • Stock price
  • Dividends
  • Split ratio
  • Economic data

10 of 26

Data Analytic Product

  • Shiny app: A tool that aims to give beginners an edge to better understand stock performances and optimize their investment strategy in the stock market.

Advantage:

  • Ease of use
  • Interactive data visualization
  • Customization tailored to users' specific needs
  • Future prediction with MCMC

11 of 26

Shiny App Structure

  • Introduction of this app: General introduction to the app, customize the theme
  • Data summary: General information about the stock market in a tabular format
  • Stock trends: Stock Comparison
  • Market Distribution: Market performance based on the S&P 500 and its sectors
  • Understand your portfolio: Customized portfolio performance using historical data and predictions through Monte Carlo simulations
  • Stock clustering: S&P 500 stock clusters based on return and volatility

12 of 26

Live Demo

13 of 26

Stock Info

14 of 26

ETF Overview

15 of 26

16 of 26

17 of 26

18 of 26

19 of 26

20 of 26

21 of 26

22 of 26

23 of 26

24 of 26

25 of 26

26 of 26

Thank you!