Skip to content
Prev 256028 / 398506 Next

pass character vector in instrument field of get.hist.quote function

On Apr 6, 2011, at 12:06 PM, algotr8der wrote:

            
only needed to use three for demonstration purposes
As pointed out by Joshua Ulrich this was crossposted on SO. Here is  
the code I posted there:

 > ClosePrices <- do.call(cbind, lapply(tickers,  function(x)  
Cl(get(x))))
 > head(ClosePrices)
            SPY.Close DIA.Close QQQ.Close
2001-03-01    124.60    104.68     48.80
2001-03-02    123.61    104.80     46.70
2001-03-05    124.74    105.57     47.55
2001-03-06    126.08    106.15     49.40
2001-03-07    126.98    107.45     49.42
2001-03-08    127.12    108.61     48.50