R quantmod Demonstration App

Rich Harken
12/28/2015

The Problem

In taking the Coursera Course: Developing Data Products - The class project has the following requirements:

  1. Write a shiny application with associated supporting documentation. The documentation should be thought of as whatever a user will need to get started using your application.
  2. Deploy the application on Rstudio's shiny server
  3. Share the application link by pasting it into the text box below
  4. Share your server.R and ui.R code on github

           What to do?

The Solution

In a previous class in this specialization - I learned about a fun little package called 'quantmod'.

It is a package to work with stock market information in an easy to use way. It also has a number of options that drive what analysis occurs when looking at certain stock information.

I thought:

  • Why not create an app that demonstrates the capabilities of this package
  • Learn more about Shiny, Slidify, and the quantmod package all at the same time
  • Create an app that might be fun to use and play with as well…

Quantmod

So here's how easy quantmod is to work with. In the R quantmod package, the following code:

library(quantmod)
getSymbols("^DJI", from=Sys.Date()-90, to=Sys.Date())
chartSeries(DJI, theme=chartTheme("beige"))

Produces a nice detailed graph like this: plot of chunk unnamed-chunk-4

The Project

The final version of my project allows you to:

  • Enter whatever stock you want to analyze
  • Choose your own date ranges to look at
  • Choose different themes for the chart display
  • Overlay many of the available analysis options for the graph
  • Play with many of the available options interactivly and get feedback immediately

You can run the demo at https://rharken.shinyapps.io/ShinyDemo

     Have Fun with it!