Skip to content

Instantly share code, notes, and snippets.

@masonicboom
Created June 2, 2018 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masonicboom/cd311d4f1cacca20d6a4517a19a6ced2 to your computer and use it in GitHub Desktop.
Save masonicboom/cd311d4f1cacca20d6a4517a19a6ced2 to your computer and use it in GitHub Desktop.
# install.packages("quantmod")
library(quantmod)
ticks <- getSymbols.yahoo("spy", env=globalenv(), from="2003-01-01", to="2018-01-01", return.class="ts")
par(oma=c(4,4,3,0), pch='.', xaxs="i", yaxs="i")
plot(index(SPY), SPY[,4])
lines(index(SPY), SPY[,4], col="red")
title(main="You need a 4K monitor for timeseries analysis.", xlab="Day", ylab="Close ($)", outer=TRUE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment