[R-SIG-Finance] Having troubles with timezone retrieving intraday bar data

juandi juandiq at gmail.com
Mon Jun 13 12:42:40 CEST 2011


Hi All

I want to retrieve the intraday closing prices per minute of an ETF in the
US, namely EWQ UP Equity.
I am located in Amsterdam, my timezone in R is configured as "CET", nowdays
shown as "CEST" with the summer adjustment.

I make the following query:
startDate <- as.Date("2010-12-01")
endDate <- as.Date("2010-12-03")
firstSecurity <- "EWQ UP Equity"
intervalData <- "1"

startDateUTC <- paste(strptime(as.chron(startDate,
"01:00:00"),format="(%m/%d/%y %H:%M:%S)"),".000",sep="")
endDateUTC <- paste(strptime(as.chron(endDate, "22:00:00"),format="(%m/%d/%y
%H:%M:%S)"),".000",sep="")

dataFirstSec <- try(bar(conn, firstSecurity, "TRADE", start=startDateUTC,
end=endDateUTC, intervalData))

It works like a charm except that I get the first data point at 14:30 but
actually I expected it at 15:30 when is the US opening at CET. When
retrieving the data in Excel with the wizard I get the correct time stamps.

I get in R for instance:
                                           time  open  high   low close
2010-12-01T14:30:00.000 2010-12-01T14:30:00.000 23.00 23.00 22.98 22.98
2010-12-01T14:31:00.000 2010-12-01T14:31:00.000 23.01 23.02 23.00 23.00
2010-12-01T14:32:00.000 2010-12-01T14:32:00.000 23.01 23.01 23.01 23.01
2010-12-01T14:35:00.000 2010-12-01T14:35:00.000 23.00 23.00 23.00 23.00
2010-12-01T14:37:00.000 2010-12-01T14:37:00.000 23.01 23.01 23.01 23.01
2010-12-01T14:38:00.000 2010-12-01T14:38:00.000 23.04 23.04 23.04 23.04
                        numEvents volume
2010-12-01T14:30:00.000        16  15427
2010-12-01T14:31:00.000        29  62600
2010-12-01T14:32:00.000         3   1200
2010-12-01T14:35:00.000         1    100
2010-12-01T14:37:00.000         1   2500
2010-12-01T14:38:00.000         1    104

I wonder what I am doing wrong, what I am missing to get the correct time
stamps in my timezone ? Thanks in advance for any hints on this issue.

--
View this message in context: http://r.789695.n4.nabble.com/Having-troubles-with-timezone-retrieving-intraday-bar-data-tp3593582p3593582.html
Sent from the Rmetrics mailing list archive at Nabble.com.



More information about the R-SIG-Finance mailing list