[R-SIG-Finance] R Bloomberg for intraday prices

Jeff Ryan jeff.a.ryan at gmail.com
Wed Apr 4 03:29:15 CEST 2012


TZ management in xts is widely used and very well tested. 

There isn't a need to use lubridate IMO. 

Recast as xts (a proper time series) and look at the vignettes associated as well as indexTZ documentation as Brian Peterson said. 

Best,
Jeff

Jeffrey Ryan    |    Founder    |    jeffrey.ryan at lemnica.com

www.lemnica.com

On Apr 3, 2012, at 8:14 PM, algotr8der <algotr8der at gmail.com> wrote:

> Hi Alain - thanks for the suggestion.
> 
> I tried to feed the first column of the data frame object created by
> RBloomberg  to with_tz() and I got the following error:
> 
>> head(SMH)
>                                           time  open   high    low close
> numEvents volume
> 2011-09-19T13:30:00.000 2011-09-19T13:30:00.000 30.52 30.550 30.460 30.49      
> 319 105000
> 2011-09-19T13:31:00.000 2011-09-19T13:31:00.000 30.48 30.520 30.470 30.50      
> 198  63700
> 2011-09-19T13:32:00.000 2011-09-19T13:32:00.000 30.49 30.590 30.480 30.56      
> 260  98800
> 2011-09-19T13:33:00.000 2011-09-19T13:33:00.000 30.56 30.610 30.530 30.53      
> 106  20900
> 2011-09-19T13:34:00.000 2011-09-19T13:34:00.000 30.53 30.545 30.525 30.53       
> 89  24900
> 2011-09-19T13:35:00.000 2011-09-19T13:35:00.000 30.53 30.540 30.495 30.53      
> 648 159000
> 
>> with_tz(SMH[,1], "EST")
> Error in UseMethod("reclass_date", orig) : 
>  no applicable method for 'reclass_date' applied to an object of class
> "character"
> 
>> with_tz(SMH[,1], tz="America/New_york")
> Error in UseMethod("reclass_date", orig) : 
>  no applicable method for 'reclass_date' applied to an object of class
> "character"
> 
> Firstly, I'm not sure why RBloomberg creates the date/timestamp as follows:
> 
> 2011-09-19T13:35:00.000
> 
> Why attach a 'T' between the date and the time? This type of format looks
> very foreign to me and my guess is this is why with_tz returns an exception. 
> 
> Any thoughts would be greatly appreciated. Thank you.
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/R-Bloomberg-for-intraday-prices-tp4261687p4530646.html
> Sent from the Rmetrics mailing list archive at Nabble.com.
> 
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.



More information about the R-SIG-Finance mailing list