Stephanie Stallworth
April 14, 2017
StockTrak is an easy-to-use Shiny app that tracks stock prices for a selected time period based on data from Google.
App features include:
With StockTrak, stock data is just a few mouse clicks away!
Simply access app: https://stephaniestallworth.shinyapps.io/StockTrak/
Input the following in the appropriate boxes:
Click “Get Stock” to see results
Note: Remember to select “Get Stock” when changing dates or stock selection to view new results.
library(shiny)
library(shinythemes)
library(shiny)
library(shinythemes)
shinyUI(fluidPage(theme =shinytheme("simplex"),
headerPanel("StockTrak"),
sidebarPanel(
textInput("symb", "Ticker Symbol", "GOOG"),
dateRangeInput("dates",
"Date Range",
start = "2014-03-27",
end = as.character(Sys.Date())),
helpText("Input stock symbol and dates to see stock performance over time"),
submitButton('Get Stock')),
mainPanel(
plotOutput('newHist'),
h4("Statistical Summary"),
verbatimTextOutput("summary"),
h4("Observations"),
tableOutput("view")
)
))
library(quantmod)
library(shiny)
shinyServer(
function(input, output) {
datasetInput <- reactive({
getSymbols(input$symb, src = "google",
from = input$dates[1],
to = input$dates[2],
auto.assign = FALSE)
})
output$newHist <- renderPlot({
candleChart(datasetInput(),
theme=chartTheme('white',up.col='dark blue',dn.col='red'),TA=c(addBBands()))
addMACD()
})
# Generate a summary of the dataset
output$summary <- renderPrint({
dataset <- datasetInput()
summary(dataset)
})
# Show the first "n" observations
output$view <- renderTable({
head(datasetInput(), n = 10)
})
})
StockTrak allows users to easily see the performance of their favorite stock over a desired time, and this is only the beginning.
Possible features to implement in later releases:
…Stay tuned!