We know that we can use R to download historical data (Daily OHLC), for EACH stock.
In R, the commands to receive MSFT via free and open yahoo source are
install.packages("quantmod")
library(quantmod)
getSymbols("MSFT", src="yahoo",from ="2013-01-01",to="2014-08-28")
The three lines will provide the dataset with name "MSFT" in you R system.
Obviously MSFT[,4] is the daily closes.
************************************************
Now my question is how to make daily close historical data for 500 stocks in SnP500.
The matrix in R will have 500 rows and 300(?) columns.
In R, the commands to receive MSFT via free and open yahoo source are
install.packages("quantmod")
library(quantmod)
getSymbols("MSFT", src="yahoo",from ="2013-01-01",to="2014-08-28")
The three lines will provide the dataset with name "MSFT" in you R system.
Obviously MSFT[,4] is the daily closes.
************************************************
Now my question is how to make daily close historical data for 500 stocks in SnP500.
The matrix in R will have 500 rows and 300(?) columns.