[Blotter-commits] r570 - in pkg/RTAQ: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Mar 11 13:09:33 CET 2011
Author: jonathan
Date: 2011-03-11 13:09:33 +0100 (Fri, 11 Mar 2011)
New Revision: 570
Modified:
pkg/RTAQ/R/periodicityTAQ.R
pkg/RTAQ/man/convert.Rd
pkg/RTAQ/man/spotVol.rd
Log:
spotvol update and bugfix convert helpfile
Modified: pkg/RTAQ/R/periodicityTAQ.R
===================================================================
--- pkg/RTAQ/R/periodicityTAQ.R 2011-03-08 20:31:57 UTC (rev 569)
+++ pkg/RTAQ/R/periodicityTAQ.R 2011-03-11 12:09:33 UTC (rev 570)
@@ -2,7 +2,7 @@
# Documented function:
-spotVol = function (pdata, dailyvol = "medrv" , periodicvol = "TML" , on = "minutes" , k = 5 ,
+spotVol = function (pdata, dailyvol = "bipower" , periodicvol = "TML" , on = "minutes" , k = 5 ,
dummies = FALSE , P1 = 4 , P2 = 2, ...)
{
dates = unique(format(time(pdata),"%Y-%m-%d"))
@@ -227,5 +227,11 @@
return( -log(-log(beta))*b(M) + a(M) )
}
+center = function()
+{
+ g=function(y){ return( sqrt(2/pi)*exp(y-exp(2*y)/2) )}
+ f=function(y){ return( y*g(y) ) }
+ return( integrate(f,-Inf,Inf)$value )
+}
Modified: pkg/RTAQ/man/convert.Rd
===================================================================
--- pkg/RTAQ/man/convert.Rd 2011-03-08 20:31:57 UTC (rev 569)
+++ pkg/RTAQ/man/convert.Rd 2011-03-11 12:09:33 UTC (rev 570)
@@ -15,7 +15,7 @@
convert(from,to,datasource,datadestination,trades=TRUE,quotes=TRUE,
ticker,dir=FALSE,extention="txt",header=FALSE,
tradecolnames=NULL,quotecolnames=NULL,
- format="%Y%M%D %H:%M:%S")
+ format="\%Y\%M\%D \%H:\%M:\%S")
}
\arguments{
@@ -34,7 +34,7 @@
\item{quotecolnames}{ vector containing column names of your quote data. By default,
the standard NYSE data format is taken, see pdf documentation for more details.}
\item{format}{ character, indicates in what format TIME and DATE are recorded in the original data.
-By default, "%Y%M%D %H:%M:%S" is taken, which means the date is denoted by e.g. "20080130" and the time by e.g. "09:30:00".}
+By default, "\%Y\%M\%D \%H:\%M:\%S" is taken, which means the date is denoted by e.g. "20080130" and the time by e.g. "09:30:00".}
}
\value{For each day an xts object is saved into the folder of that date, containing the converted data.
Modified: pkg/RTAQ/man/spotVol.rd
===================================================================
--- pkg/RTAQ/man/spotVol.rd 2011-03-08 20:31:57 UTC (rev 569)
+++ pkg/RTAQ/man/spotVol.rd 2011-03-11 12:09:33 UTC (rev 570)
@@ -27,7 +27,7 @@
\usage{
spotVol(pdata,
- dailyvol = "medrv",
+ dailyvol = "bipower",
periodicvol = "TML",
on = "minutes",
k = 5,
@@ -82,8 +82,6 @@
data("sample_real5minprices");
#compute and plot intraday periodicity
-par(mfrow =c(2,1));
-out = spotVol(price,P1=6,P2=4,method="OLS",k=5, dummies=TRUE);
out = spotVol(price,P1=6,P2=4,method="OLS",k=5, dummies=FALSE);
head(out);
}
More information about the Blotter-commits
mailing list