Hello,

 

I am currently analyzing market data retrieving data sets from yahoo with
the get.hist.quote function in the Performance Analytics package.

 

############ Data Import Sheet ##############

 

ticker<-c("^GSPC", "^GDAXI")

 

 

# Time horizon

 

from <- "1992-01-03"              # of type "YYYY-MM-DD"

till <- "2007-12-31"

 

# Return frequency

 

freque <- c("d", "w", "m", "y")

fq <- 1                             # input 1 for "d", 2 for "w" etc.

 

 

# Benchmark

benchmark <- get.hist.quote(ticker[1], start = from, end = till,
compression=freque[fq], quote="Close")

benchmark2 <- get.hist.quote(ticker[2], start = from, end = till,
compression=freque[fq], quote="Close")

 

Now, both benchmarks are zoo objects with an attached index. Unfortunately,
due to holidays etc both series do neither have identical indices nor the
same length (in most cases, sometimes they do by chance). 

I have been trying to address this problem for quite some time now, but
cannot find a solution to it. 

 

The problems arise as I usually store each series in a matrix format where
the rows contain the assets and the columns the respective quotes or returns
for a certain trading interval.

 

            Quote 1 .. Quote 2 .. Quote N

Asset1

 

Asset 2

 

..

..

..

 

Asset N 

 

Etc.

 

What I ultimately want to do is to match both series, i.e. same time indices
and same length. 

 

Do you have an idea how to overcome this? Thanks in advance.

 

regards


	[[alternative HTML version deleted]]

