[Blotter-commits] r550 - pkg/RTAQ/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Feb 8 10:08:07 CET 2011
Author: jonathan
Date: 2011-02-08 10:08:07 +0100 (Tue, 08 Feb 2011)
New Revision: 550
Modified:
pkg/RTAQ/R/convert_to_RData.R
pkg/RTAQ/R/manipulation.R
pkg/RTAQ/R/totalcleanup.R
Log:
back to fw slash
Modified: pkg/RTAQ/R/convert_to_RData.R
===================================================================
--- pkg/RTAQ/R/convert_to_RData.R 2011-02-04 21:51:33 UTC (rev 549)
+++ pkg/RTAQ/R/convert_to_RData.R 2011-02-08 09:08:07 UTC (rev 550)
@@ -37,14 +37,14 @@
if(dir) {
dir.create(datadestination);
for(i in 1:length(dates)) {
- dirname = paste(datadestination,"\\",as.character(dates[i]),sep="")
+ dirname = paste(datadestination,"/",as.character(dates[i]),sep="")
dir.create(dirname);
}
}
for(i in 1:length(dates)){
- datasourcex = paste(datasource,"\\",dates[i],sep="");
- datadestinationx = paste(datadestination,"\\",dates[i],sep="");
+ datasourcex = paste(datasource,"/",dates[i],sep="");
+ datadestinationx = paste(datadestination,"/",dates[i],sep="");
if(trades==TRUE){convert_trades(datasourcex,datadestinationx,ticker,extention=extention,header=header,tradecolnames=tradecolnames,format=format)}
if(quotes==TRUE){convert_quotes(datasourcex,datadestinationx,ticker,extention=extention,header=header,quotecolnames=quotecolnames,format=format)}
}
@@ -65,7 +65,7 @@
return(z)
}
for (i in 1:length(ticker)) {
- tfile_name = paste(datasource, "\\", ticker[i], "_trades",
+ tfile_name = paste(datasource, "/", ticker[i], "_trades",
sep = "")
tdata = try(readdata(path = tfile_name, extention = extention,
header = header, dims = 9), silent = TRUE)
@@ -123,7 +123,7 @@
return(z)
}
for (i in 1:length(ticker)) {
- qfile_name = paste(datasource, "\\", ticker[i], "_quotes",
+ qfile_name = paste(datasource, "/", ticker[i], "_quotes",
sep = "")
qdata = try(readdata(path = qfile_name, extention = extention,
header = header, dims = 9), silent = TRUE)
Modified: pkg/RTAQ/R/manipulation.R
===================================================================
--- pkg/RTAQ/R/manipulation.R 2011-02-04 21:51:33 UTC (rev 549)
+++ pkg/RTAQ/R/manipulation.R 2011-02-08 09:08:07 UTC (rev 550)
@@ -27,10 +27,10 @@
if(trades){ tdata=NULL;
for(i in 1:length(dates)){
- datasourcex = paste(datasource,"\\",dates[i],sep="");
- filename = paste(datasourcex,"\\",ticker,"_trades.RData",sep="");
+ datasourcex = paste(datasource,"/",dates[i],sep="");
+ filename = paste(datasourcex,"/",ticker,"_trades.RData",sep="");
- ifmissingname = paste(datasourcex,"\\missing_",ticker,".RData",sep="");
+ ifmissingname = paste(datasourcex,"/missing_",ticker,".RData",sep="");
if(file.exists(ifmissingname)){stop(paste("No trades available on ",dates[i],sep=""))}
if(!file.exists(filename)){stop(paste("The file ",filename," does not exist. Please read the documentation.",sep=""))}
@@ -57,9 +57,9 @@
if(quotes){ qdata=NULL;
for(i in 1:length(dates)){
- datasourcex = paste(datasource,"\\",dates[i],sep="");
- filename = paste(datasourcex,"\\",ticker,"_quotes.RData",sep="");
- ifmissingname = paste(datasourcex,"\\missingquotes_",ticker,".RData",sep="");
+ datasourcex = paste(datasource,"/",dates[i],sep="");
+ filename = paste(datasourcex,"/",ticker,"_quotes.RData",sep="");
+ ifmissingname = paste(datasourcex,"/missingquotes_",ticker,".RData",sep="");
if(file.exists(ifmissingname)){stop(paste("no quotes available on ",dates[i],sep=""))}
if(!file.exists(filename)){stop(paste("The file ",filename," does not exist. Please read the documentation.",sep=""))}
Modified: pkg/RTAQ/R/totalcleanup.R
===================================================================
--- pkg/RTAQ/R/totalcleanup.R 2011-02-04 21:51:33 UTC (rev 549)
+++ pkg/RTAQ/R/totalcleanup.R 2011-02-08 09:08:07 UTC (rev 550)
@@ -38,12 +38,12 @@
dates = dates[isBizday(dates, holidays = holidayNYSE(2004:2010))];
for(j in 1:length(dates)){
- datasourcex = paste(datasource,"\\",dates[j],sep="");
- datadestinationx = paste(datadestination,"\\",dates[j],sep="");
+ datasourcex = paste(datasource,"/",dates[j],sep="");
+ datadestinationx = paste(datadestination,"/",dates[j],sep="");
for(i in 1:length(ticker)){
dataname = paste(ticker[i],"_trades.RData",sep="");
- load(paste(datasourcex,"\\",dataname,sep=""));
+ load(paste(datasourcex,"/",dataname,sep=""));
if(class(tdata)[1]!="try-error"){
exchange = exchanges[i];
@@ -59,12 +59,12 @@
tdata = try(salescond(tdata)); nresult[4] = nresult[4] + dim(tdata)[1];
tdata = try(mergeTradesSameTimestamp(tdata,selection=selection)); nresult[5] = nresult[5] + dim(tdata)[1];
- save(tdata, file = paste(datadestinationx,"\\",dataname,sep=""));
+ save(tdata, file = paste(datadestinationx,"/",dataname,sep=""));
}
if(class(tdata)=="try-error") {
abc=1;
- save(abc, file = paste(datadestinationx,"\\missing_",ticker[i],".RData",sep=""));
+ save(abc, file = paste(datadestinationx,"/missing_",ticker[i],".RData",sep=""));
}
}
}
@@ -108,12 +108,12 @@
dates = dates[isBizday(dates, holidays = holidayNYSE(2004:2010))];
for(j in 1:length(dates)){
- datasourcex = paste(datasource,"\\",dates[j],sep="");
- datadestinationx = paste(datadestination,"\\",dates[j],sep="");
+ datasourcex = paste(datasource,"/",dates[j],sep="");
+ datadestinationx = paste(datadestination,"/",dates[j],sep="");
for(i in 1:length(ticker)){
dataname = paste(ticker[i],"_quotes.RData",sep="");
- load(paste(datasourcex,"\\",dataname,sep=""));
+ load(paste(datasourcex,"/",dataname,sep=""));
if(class(qdata)[1]!="try-error"){
exchange = exchanges[i];
@@ -132,12 +132,12 @@
qdata = try(mergequotessametimestamp(qdata,selection=selection)); nresult[6] = nresult[6]+dim(qdata)[1];
qdata = try(rmoutliers(qdata,maxi=rmoutliersmaxi,window=window,type=type)); nresult[7] = nresult[7]+dim(qdata)[1];
- save(qdata, file = paste(datadestinationx,"\\",dataname,sep=""));
+ save(qdata, file = paste(datadestinationx,"/",dataname,sep=""));
}
if(class(qdata)=="try-error"){
abc=1;
- save(abc, file = paste(datadestinationx,"\\missingquotes_",ticker[i],".RData",sep=""));
+ save(abc, file = paste(datadestinationx,"/missingquotes_",ticker[i],".RData",sep=""));
}
}
}
@@ -181,23 +181,23 @@
dates = dates[isBizday(dates, holidays = holidayNYSE(2004:2010))];
for(j in 1:length(dates)){
- datasourcex = paste(datasource,"\\",dates[j],sep="");
- datadestinationx = paste(datadestination,"\\",dates[j],sep="");
+ datasourcex = paste(datasource,"/",dates[j],sep="");
+ datadestinationx = paste(datadestination,"/",dates[j],sep="");
for(i in 1:length(ticker)){
dataname = paste(ticker[i],"_trades.RData",sep="");
dataname2 = paste(ticker[i],"_quotes.RData",sep="");
#Missing file??
- m1 = paste(datasourcex,"\\missing_",ticker[i],".RData",sep="");
- m2 = paste(datasourcex,"\\missingquotes_",ticker[i],".RData",sep="");
+ m1 = paste(datasourcex,"/missing_",ticker[i],".RData",sep="");
+ m2 = paste(datasourcex,"/missingquotes_",ticker[i],".RData",sep="");
miscondition = file.exists(m1)|file.exists(m1);
a=FALSE;#check whether tried to clean
if(!miscondition){
#load trades and quotes
- load(paste(datasourcex,"\\",dataname,sep=""));
- load(paste(datasourcex,"\\",dataname2,sep=""));
+ load(paste(datasourcex,"/",dataname,sep=""));
+ load(paste(datasourcex,"/",dataname2,sep=""));
tdata = dataformatc(tdata);
qdata = dataformatc(qdata);
@@ -206,7 +206,7 @@
tdata = try(rmtradeoutliers(tdata,qdata));
#save
- save(tdata, file = paste(datadestinationx,"\\",dataname,sep=""));
+ save(tdata, file = paste(datadestinationx,"/",dataname,sep=""));
a=TRUE;
}
@@ -214,7 +214,7 @@
if(miscondition|a) {
abc=1;
- save(abc, file = paste(datadestinationx,"\\missing_",ticker[i],".RData",sep=""));
+ save(abc, file = paste(datadestinationx,"/missing_",ticker[i],".RData",sep=""));
}
}
}
More information about the Blotter-commits
mailing list