[Blotter-commits] r1093 - in pkg/FinancialInstrument: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Jun 30 18:19:43 CEST 2012


Author: gsee
Date: 2012-06-30 18:19:43 +0200 (Sat, 30 Jun 2012)
New Revision: 1093

Added:
   pkg/FinancialInstrument/man/Tick2Sec.Rd
Removed:
   pkg/FinancialInstrument/man/alltick2sec.Rd
   pkg/FinancialInstrument/man/to_secBATV.Rd
Modified:
   pkg/FinancialInstrument/NAMESPACE
   pkg/FinancialInstrument/R/Tick2Sec.R
   pkg/FinancialInstrument/R/instrument.R
   pkg/FinancialInstrument/man/instrument.Rd
Log:
 docs; combine docs for to_secBATV and alltick2sec

Modified: pkg/FinancialInstrument/NAMESPACE
===================================================================
--- pkg/FinancialInstrument/NAMESPACE	2012-06-30 00:06:09 UTC (rev 1092)
+++ pkg/FinancialInstrument/NAMESPACE	2012-06-30 16:19:43 UTC (rev 1093)
@@ -1,5 +1,6 @@
 export(add.defined.by)
 export(add.identifier)
+export(alltick2sec)
 export(bond)
 export(bond_series)
 export(buildBasket)

Modified: pkg/FinancialInstrument/R/Tick2Sec.R
===================================================================
--- pkg/FinancialInstrument/R/Tick2Sec.R	2012-06-30 00:06:09 UTC (rev 1092)
+++ pkg/FinancialInstrument/R/Tick2Sec.R	2012-06-30 16:19:43 UTC (rev 1093)
@@ -12,7 +12,7 @@
 #
 ###############################################################################
 
-#' convert tick data to one-second data
+#' Convert tick data to one-second data
 #'
 #' This is like taking a snapshot of the market at the end of every second, 
 #' except the volume over the second is summed.
@@ -23,27 +23,44 @@
 #' \dQuote{Bid.Size}, \dQuote{Ask.Price}, \dQuote{Ask.Size},
 #' \dQuote{Trade.Price}, and \dQuote{Volume}
 #'
-#' The primary purpose of this function is to reduce the amount of data on disk 
-#' so that it will take less time to load the data into memory.
+#' The primary purpose of these functions is to reduce the amount of data on 
+#' disk so that it will take less time to load the data into memory.
 #'
-#' If there are no trades or bid/ask price updates in a given second, we will not make
-#' a row for that timestamp.  If there were no trades, but the bid or ask
-#' price changed, then we _will_ have a row but the Volume and Trade.Price will be NA.  
+#' If there are no trades or bid/ask price updates in a given second, we will 
+#' not make a row for that timestamp.  If there were no trades, but the bid or 
+#' ask price changed, then we _will_ have a row but the Volume and Trade.Price 
+#' will be NA.  
 #'
-#' If there are multiple trades in the same second, Volume will be the sum of the volume, 
-#' but only the last trade price in that second will be printed. Similarly, if there
-#' is a trade, and then later in the same second, there is a bid/ask update, the last
-#' Bid/Ask Price/Size will be used.
+#' If there are multiple trades in the same second, Volume will be the sum of 
+#' the volume, but only the last trade price in that second will be printed. 
+#' Similarly, if there is a trade, and then later in the same second, there is 
+#' a bid/ask update, the last Bid/Ask Price/Size will be used.
 #' 
-#' @param x the xts series to convert to 1 minute BATMV
-#' @return an xts object of 1 second frequency
+#' \code{alltick2sec} is used to convert the data of several files from tick to 
+#' one second frequency data.
+#'
+#' @param x the xts series to convert to 1 minute BATV
+#'
+#' @param getdir Directory that contains tick data
+#' @param savedir Directory in which to save converted data
+#' @param Symbols String names of instruments to convert
+#' @param overwrite TRUE/FALSE. If file already exists in savedir, should it be 
+#'   overwritten?
+#' @return \code{to_secBATV} returns an xts object of one second frequency.
+#'   \code{alltick2sec} returns a list of files that were converted.
 #' @author gsee
+#' @note \code{to_secBATV} is used by the TRTH_BackFill.R script in the 
+#'   inst/parser directory of the FinancialInstrument package.  These functions
+#'   are specific to to data created by that script and are not intended for
+#'   more general use.
 #' @examples
 #' \dontrun{
 #' getSymbols("CLU1")
 #' system.time(xsec <- to_secBATV(CLU1))
+#' convert.log <- alltick2sec()
 #' }
 #' @export
+#' @rdname Tick2Sec
 to_secBATV <- function(x) {
     #require(qmao)
     # Define Bi and As functions (copied from qmao package)
@@ -79,19 +96,8 @@
 } 
 
 
-
-#' Convert several files from tick to 1 second
-#'
-#' @param getdir directory to get tick data from
-#' @param savedir directory to save converted data in
-#' @param Symbols names of instruments to convert
-#' @param overwrite TRUE/FALSE. If file already exists in savedir, should it be overwritten?
-#' @return list of files that were converted
-#' @author gsee
-#' @examples
-#' \dontrun{
-#' convert.log <- alltick2sec()
-#' }
+#' @export
+#' @rdname Tick2Sec
 alltick2sec <- function(getdir = '~/TRTH/tick/', 
                         savedir = '~/TRTH/sec/', 
                         Symbols=list.files(getdir),

Modified: pkg/FinancialInstrument/R/instrument.R
===================================================================
--- pkg/FinancialInstrument/R/instrument.R	2012-06-30 00:06:09 UTC (rev 1092)
+++ pkg/FinancialInstrument/R/instrument.R	2012-06-30 16:19:43 UTC (rev 1093)
@@ -144,10 +144,11 @@
 #' instrument
 #' fund
 #' @seealso 
-#' \code{\link{exchange_rate}}
-#' \code{\link{option_series}}
-#' \code{\link{future_series}}
-#' \code{\link{spread}}
+#' \code{link{currency}},
+#' \code{\link{exchange_rate}},
+#' \code{\link{option_series}},
+#' \code{\link{future_series}},
+#' \code{\link{spread}},
 #' \code{\link{load.instruments}}
 #' @export
 instrument<-function(primary_id , ..., currency , multiplier , tick_size=NULL, 

Added: pkg/FinancialInstrument/man/Tick2Sec.Rd
===================================================================
--- pkg/FinancialInstrument/man/Tick2Sec.Rd	                        (rev 0)
+++ pkg/FinancialInstrument/man/Tick2Sec.Rd	2012-06-30 16:19:43 UTC (rev 1093)
@@ -0,0 +1,77 @@
+\name{to_secBATV}
+\alias{alltick2sec}
+\alias{to_secBATV}
+\title{Convert tick data to one-second data}
+\usage{
+  to_secBATV(x)
+
+  alltick2sec(getdir = "~/TRTH/tick/",
+    savedir = "~/TRTH/sec/", Symbols = list.files(getdir),
+    overwrite = FALSE)
+}
+\arguments{
+  \item{x}{the xts series to convert to 1 minute BATV}
+
+  \item{getdir}{Directory that contains tick data}
+
+  \item{savedir}{Directory in which to save converted data}
+
+  \item{Symbols}{String names of instruments to convert}
+
+  \item{overwrite}{TRUE/FALSE. If file already exists in
+  savedir, should it be overwritten?}
+}
+\value{
+  \code{to_secBATV} returns an xts object of one second
+  frequency.  \code{alltick2sec} returns a list of files
+  that were converted.
+}
+\description{
+  This is like taking a snapshot of the market at the end
+  of every second, except the volume over the second is
+  summed.
+}
+\details{
+  From tick data with columns: \dQuote{Price},
+  \dQuote{Volume}, \dQuote{Bid.Price}, \dQuote{Bid.Size},
+  \dQuote{Ask.Price}, \dQuote{Ask.Size}, to data of one
+  second frequency with columns \dQuote{Bid.Price},
+  \dQuote{Bid.Size}, \dQuote{Ask.Price}, \dQuote{Ask.Size},
+  \dQuote{Trade.Price}, and \dQuote{Volume}
+
+  The primary purpose of these functions is to reduce the
+  amount of data on disk so that it will take less time to
+  load the data into memory.
+
+  If there are no trades or bid/ask price updates in a
+  given second, we will not make a row for that timestamp.
+  If there were no trades, but the bid or ask price
+  changed, then we _will_ have a row but the Volume and
+  Trade.Price will be NA.
+
+  If there are multiple trades in the same second, Volume
+  will be the sum of the volume, but only the last trade
+  price in that second will be printed. Similarly, if there
+  is a trade, and then later in the same second, there is a
+  bid/ask update, the last Bid/Ask Price/Size will be used.
+
+  \code{alltick2sec} is used to convert the data of several
+  files from tick to one second frequency data.
+}
+\note{
+  \code{to_secBATV} is used by the TRTH_BackFill.R script
+  in the inst/parser directory of the FinancialInstrument
+  package.  These functions are specific to to data created
+  by that script and are not intended for more general use.
+}
+\examples{
+\dontrun{
+getSymbols("CLU1")
+system.time(xsec <- to_secBATV(CLU1))
+convert.log <- alltick2sec()
+}
+}
+\author{
+  gsee
+}
+

Deleted: pkg/FinancialInstrument/man/alltick2sec.Rd
===================================================================
--- pkg/FinancialInstrument/man/alltick2sec.Rd	2012-06-30 00:06:09 UTC (rev 1092)
+++ pkg/FinancialInstrument/man/alltick2sec.Rd	2012-06-30 16:19:43 UTC (rev 1093)
@@ -1,33 +0,0 @@
-\name{alltick2sec}
-\alias{alltick2sec}
-\title{Convert several files from tick to 1 second}
-\usage{
-  alltick2sec(getdir = "~/TRTH/tick/",
-    savedir = "~/TRTH/sec/", Symbols = list.files(getdir),
-    overwrite = FALSE)
-}
-\arguments{
-  \item{getdir}{directory to get tick data from}
-
-  \item{savedir}{directory to save converted data in}
-
-  \item{Symbols}{names of instruments to convert}
-
-  \item{overwrite}{TRUE/FALSE. If file already exists in
-  savedir, should it be overwritten?}
-}
-\value{
-  list of files that were converted
-}
-\description{
-  Convert several files from tick to 1 second
-}
-\examples{
-\dontrun{
-convert.log <- alltick2sec()
-}
-}
-\author{
-  gsee
-}
-

Modified: pkg/FinancialInstrument/man/instrument.Rd
===================================================================
--- pkg/FinancialInstrument/man/instrument.Rd	2012-06-30 00:06:09 UTC (rev 1092)
+++ pkg/FinancialInstrument/man/instrument.Rd	2012-06-30 16:19:43 UTC (rev 1093)
@@ -142,8 +142,8 @@
   \code{\link[quantmod]{setSymbolLookup}}.
 }
 \seealso{
-  \code{\link{exchange_rate}} \code{\link{option_series}}
-  \code{\link{future_series}} \code{\link{spread}}
-  \code{\link{load.instruments}}
+  \code{link{currency}}, \code{\link{exchange_rate}},
+  \code{\link{option_series}}, \code{\link{future_series}},
+  \code{\link{spread}}, \code{\link{load.instruments}}
 }
 

Deleted: pkg/FinancialInstrument/man/to_secBATV.Rd
===================================================================
--- pkg/FinancialInstrument/man/to_secBATV.Rd	2012-06-30 00:06:09 UTC (rev 1092)
+++ pkg/FinancialInstrument/man/to_secBATV.Rd	2012-06-30 16:19:43 UTC (rev 1093)
@@ -1,51 +0,0 @@
-\name{to_secBATV}
-\alias{to_secBATV}
-\title{convert tick data to one-second data}
-\usage{
-  to_secBATV(x)
-}
-\arguments{
-  \item{x}{the xts series to convert to 1 minute BATMV}
-}
-\value{
-  an xts object of 1 second frequency
-}
-\description{
-  This is like taking a snapshot of the market at the end
-  of every second, except the volume over the second is
-  summed.
-}
-\details{
-  From tick data with columns: \dQuote{Price},
-  \dQuote{Volume}, \dQuote{Bid.Price}, \dQuote{Bid.Size},
-  \dQuote{Ask.Price}, \dQuote{Ask.Size}, to data of one
-  second frequency with columns \dQuote{Bid.Price},
-  \dQuote{Bid.Size}, \dQuote{Ask.Price}, \dQuote{Ask.Size},
-  \dQuote{Trade.Price}, and \dQuote{Volume}
-
-  The primary purpose of this function is to reduce the
-  amount of data on disk so that it will take less time to
-  load the data into memory.
-
-  If there are no trades or bid/ask price updates in a
-  given second, we will not make a row for that timestamp.
-  If there were no trades, but the bid or ask price
-  changed, then we _will_ have a row but the Volume and
-  Trade.Price will be NA.
-
-  If there are multiple trades in the same second, Volume
-  will be the sum of the volume, but only the last trade
-  price in that second will be printed. Similarly, if there
-  is a trade, and then later in the same second, there is a
-  bid/ask update, the last Bid/Ask Price/Size will be used.
-}
-\examples{
-\dontrun{
-getSymbols("CLU1")
-system.time(xsec <- to_secBATV(CLU1))
-}
-}
-\author{
-  gsee
-}
-



More information about the Blotter-commits mailing list