[R-SIG-Finance] Hourly quotations from 1 minutes quotations.
pierre8r-list at yahoo.fr
pierre8r-list at yahoo.fr
Mon Jun 30 22:12:17 CEST 2008
Hello,
I am trying to do 5 minutes quotations and to hourly quotations.
>From 1 minute quotations.
I wrote a script that does not work.
Thank you in advance,
Pierre8r
Here's my script that does not work:
library(xts)
library(quantmod)
quotes <- read.csv2("E:\\00001-Compare\\Import\\ImportIB\\TestGBPUSD-1mn.txt",
header = TRUE, sep = ",", dec=".")
q1mn <- xts(as.matrix(quotes[,-(1:2)]),as.POSIXct(paste(quotes[,1],quotes[,2]),
format='%m/%d/%Y%H:%M'))
colnames(q1mn) <- c('Open','High','Low','Close','Volume')
q5mns <- q1mn
to.minutes5(q5mns)
qHourly <- q1mn
to.hourly(qHourly)
barChart(q1mn,TA=NULL)
barChart(q5mns,TA=NULL)
barChart(qHourly,TA=NULL)
Some datas :
01/08/2007,00:00,1.93025,1.93025,1.93015,1.9302,-1
01/08/2007,00:01,1.9302,1.9302,1.93015,1.9302,-1
01/08/2007,00:02,1.9302,1.93025,1.9302,1.9302,-1
01/08/2007,00:03,1.9302,1.93025,1.9302,1.9302,-1
01/08/2007,00:04,1.9302,1.93025,1.9302,1.9302,-1
01/08/2007,00:05,1.9302,1.93025,1.9302,1.9302,-1
01/08/2007,00:06,1.9302,1.93025,1.93015,1.93015,-1
01/08/2007,00:07,1.93015,1.93025,1.93015,1.9302,-1
01/08/2007,00:08,1.9302,1.93035,1.9302,1.9303,-1
01/08/2007,00:09,1.9303,1.9303,1.9303,1.9303,-1
01/08/2007,00:10,1.9303,1.9303,1.9303,1.9303,-1
01/08/2007,00:11,1.9303,1.9303,1.9303,1.9303,-1
01/08/2007,00:12,1.9303,1.9303,1.9302,1.9302,-1
01/08/2007,00:13,1.9302,1.9302,1.9302,1.9302,-1
01/08/2007,00:14,1.9302,1.9302,1.9302,1.9302,-1
01/08/2007,00:15,1.9302,1.9302,1.9302,1.9302,-1
01/08/2007,00:16,1.9302,1.9302,1.9302,1.9302,-1
01/08/2007,00:17,1.9302,1.9302,1.9302,1.9302,-1
01/08/2007,00:18,1.9302,1.9302,1.9302,1.9302,-1
01/08/2007,00:19,1.9302,1.9302,1.9302,1.9302,-1
01/08/2007,00:20,1.9302,1.9302,1.9302,1.9302,-1
01/08/2007,00:21,1.9302,1.9302,1.9302,1.9302,-1
01/08/2007,00:22,1.9302,1.9302,1.9302,1.9302,-1
01/08/2007,00:23,1.9302,1.9302,1.9302,1.9302,-1
01/08/2007,00:24,1.9302,1.9302,1.93015,1.93015,-1
01/08/2007,00:25,1.93015,1.93015,1.93015,1.93015,-1
01/08/2007,00:26,1.93015,1.93015,1.93015,1.93015,-1
01/08/2007,00:27,1.93015,1.93015,1.93015,1.93015,-1
01/08/2007,00:28,1.93015,1.93015,1.93015,1.93015,-1
01/08/2007,00:29,1.93015,1.93015,1.93005,1.93005,-1
01/08/2007,00:30,1.93005,1.93005,1.93005,1.93005,-1
01/08/2007,00:31,1.93005,1.93005,1.93005,1.93005,-1
01/08/2007,00:32,1.93005,1.93005,1.93005,1.93005,-1
01/08/2007,00:33,1.93005,1.93005,1.93005,1.93005,-1
01/08/2007,00:34,1.93005,1.93005,1.93005,1.93005,-1
01/08/2007,00:35,1.93005,1.93005,1.93005,1.93005,-1
01/08/2007,00:36,1.93005,1.93015,1.93005,1.93005,-1
01/08/2007,00:37,1.93005,1.9301,1.93005,1.93005,-1
01/08/2007,00:38,1.93005,1.93015,1.93005,1.93015,-1
01/08/2007,00:39,1.93015,1.93015,1.93015,1.93015,-1
01/08/2007,00:40,1.93015,1.93015,1.9301,1.9301,-1
01/08/2007,00:41,1.9301,1.9302,1.9301,1.9302,-1
01/08/2007,00:42,1.9302,1.9302,1.9301,1.9301,-1
01/08/2007,00:43,1.9301,1.9301,1.9301,1.9301,-1
01/08/2007,00:44,1.9301,1.9301,1.9301,1.9301,-1
01/08/2007,00:45,1.9301,1.9301,1.93005,1.9301,-1
01/08/2007,00:46,1.9301,1.9301,1.9301,1.9301,-1
01/08/2007,00:47,1.9301,1.9301,1.93005,1.9301,-1
01/08/2007,00:48,1.9301,1.9301,1.9301,1.9301,-1
01/08/2007,00:49,1.9301,1.9301,1.9301,1.9301,-1
01/08/2007,00:50,1.9301,1.9301,1.9301,1.9301,-1
01/08/2007,00:51,1.9301,1.9301,1.92995,1.93,-1
01/08/2007,00:52,1.93,1.93015,1.93,1.93005,-1
01/08/2007,00:53,1.93005,1.93005,1.92995,1.93,-1
01/08/2007,00:54,1.93,1.93,1.92995,1.93,-1
01/08/2007,00:55,1.93,1.93,1.92995,1.93,-1
____________________________________________________________
ente http://mail.yahoo.fr
More information about the R-SIG-Finance
mailing list