I do not understand this, either to figure out the cause, let alone the fix.

 

Here is what I tried:

 

myfun <- function(d) {

  str(d)

}

apply.daily(alpha,myfun)

 

And here are what the beginning and end of alpha (an xts object created by
to.minute()):

 

> head(alpha)

                        Open     High      Low Close

2011-03-10 00:00:00 10350.00 10365.00 10350.00 10360

2011-03-10 00:00:01 10350.06 10364.97 10350.06 10360

2011-03-10 00:00:02 10350.11 10364.94 10350.11 10360

2011-03-10 00:00:03 10350.17 10364.92 10350.17 10360

2011-03-10 00:00:04 10350.22 10364.89 10350.22 10360

2011-03-10 00:00:05 10350.28 10364.86 10350.28 10360

> tail(alpha)

                    Open High  Low Close

2011-06-08 23:55:55 9430 9430 9430  9430

2011-06-08 23:55:56 9430 9430 9430  9430

2011-06-08 23:55:57 9430 9430 9430  9430

2011-06-08 23:55:58 9430 9430 9430  9430

2011-06-08 23:55:59 9430 9430 9430  9430

2011-06-08 23:56:00 9430 9430 9430  9430

> 

 

There is almost three months of tick data here, converted to one minute OHLC
data.

 

I had apparently successfully used the following to ensure I had an even
time series with values for every minute from start to end:

 

tseq <- seq(start(alpha),end(alpha), by = time("00:01:00"))

alpha <- na.approx(alpha, xout = tseq)

 

But there is something weird here.  How is it that alpha appears to have
rows for every second from the start to the end, rather than 'just' for
every minute?

 

Now here is what the output looks like:

 

An 'xts' object from 2011-06-05 to 2011-06-05 23:59:59 containing:

  Data: num [1:86400, 1:4] 9437 9437 9437 9437 9437 ...

- attr(*, "dimnames")=List of 2

  ..$ : NULL

  ..$ : chr [1:4] "Open" "High" "Low" "Close"

  Indexed by objects of class: [POSIXct,POSIXt] TZ: 

  xts Attributes:  

 NULL

An 'xts' object from 2011-06-06 to 2011-06-06 23:59:59 containing:

  Data: num [1:86400, 1:4] 9420 9420 9420 9420 9420 ...

- attr(*, "dimnames")=List of 2

  ..$ : NULL

  ..$ : chr [1:4] "Open" "High" "Low" "Close"

  Indexed by objects of class: [POSIXct,POSIXt] TZ: 

  xts Attributes:  

 NULL

An 'xts' object from 2011-06-07 to 2011-06-07 23:59:59 containing:

  Data: num [1:86400, 1:4] 9428 9428 9428 9428 9428 ...

- attr(*, "dimnames")=List of 2

  ..$ : NULL

  ..$ : chr [1:4] "Open" "High" "Low" "Close"

  Indexed by objects of class: [POSIXct,POSIXt] TZ: 

  xts Attributes:  

 NULL

An 'xts' object from 2011-06-08 to 2011-06-08 23:56:00 containing:

  Data: num [1:86161, 1:4] 9435 9435 9435 9435 9435 ...

- attr(*, "dimnames")=List of 2

  ..$ : NULL

  ..$ : chr [1:4] "Open" "High" "Low" "Close"

  Indexed by objects of class: [POSIXct,POSIXt] TZ: 

  xts Attributes:  

 NULL

Error in coredata.xts(x) : currently unsupported data type

 

Now, I do not understand what is happening here.  The data seem consistent
throughout, so why would it crash and burn on the very last day, and only on
that day, of the three months of data

 

Any insight would be greatly appreciated.

 

Thanks

 

Ted


	[[alternative HTML version deleted]]

