Skip to content
Prev 2769 / 15274 Next

xts. Change the way time series is build ( minutes ).

Using minute data from Interactive Brokers interface in R (IBrokers)
Loading required package: xts
Loading required package: zoo

Attaching package: 'zoo'


        The following object(s) are masked from package:base :

         as.Date.numeric

IBrokers version 0.1-2: (pre-alpha)

This software comes with NO WARRANTY.  Not intended for production use!
See ?IBrokers for details
waiting for TWS reply ...... done.
Open  High   Low Close Volume   WAP hasGaps Count
2008-08-04 08:30:00 44.88 44.92 44.82 44.82   9491 44.88       0   884
2008-08-04 08:31:00 44.82 44.83 44.52 44.57  31075 44.67       0  3102
2008-08-04 08:32:00 44.58 44.66 44.50 44.63  16498 44.57       0  1853
2008-08-04 08:33:00 44.63 44.68 44.62 44.66   3604 44.65       0   625
2008-08-04 08:34:00 44.67 44.72 44.67 44.69   3803 44.70       0   547
2008-08-04 08:35:00 44.69 44.75 44.68 44.75   2539 44.70       0   306
QQQQ.Open QQQQ.High QQQQ.Low QQQQ.Close QQQQ.Volume
2008-08-04 08:59:00     44.88     44.92    44.50      44.68      148632
2008-08-04 09:59:00     44.67     44.71    44.38      44.49      176134
2008-08-04 10:59:00     44.48     44.84    44.41      44.77      185493
2008-08-04 11:59:00     44.77     44.82    44.59      44.60       61961
2008-08-04 12:59:00     44.60     44.69    44.51      44.62       62291
2008-08-04 13:12:00     44.61     44.64    44.57      44.62       11080
QQQQ.Open QQQQ.High QQQQ.Low QQQQ.Close QQQQ.Volume
2008-08-04 08:30:00     44.88     44.92    44.50      44.68      148632
2008-08-04 09:00:00     44.67     44.71    44.38      44.49      176134
2008-08-04 10:00:00     44.48     44.84    44.41      44.77      185493
2008-08-04 11:00:00     44.77     44.82    44.59      44.60       61961
2008-08-04 12:00:00     44.60     44.69    44.51      44.62       62291
2008-08-04 13:00:00     44.61     44.64    44.57      44.62       11080

Like previous posts.. the indexAt arg is the key.  For hourly you are
going to have to use the R-forge version, or the source (all open!)
from r-forge as well.  You can also modify the code to your liking, if
you'd be so inclined.  Though the latter would be unnecessary in this
case as it does what you want.

If you have the windows tools (I am assuming that is your platform) to
build R packages, just grab the source from r-forge.  If not, you'll
have to wait until I clean it so that it passes R CMD check and makes
it to CRAN.

Here are the links:

http://r-forge.r-project.org/bin/windows/contrib/latest/xts_0.0-16.zip
http://r-forge.r-project.org/src/contrib/xts_0.0-16.tar.gz

Or from R:

install.packages('xts', type='source', repos='http://r-forge.r-project.org')


Jeff
On Mon, Aug 4, 2008 at 1:04 PM, Pierre8rou <pierre8r-nabble at yahoo.fr> wrote: