[Blotter-commits] r392 - in pkg/blotter: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Sep 10 15:50:48 CEST 2010


Author: braverock
Date: 2010-09-10 15:50:48 +0200 (Fri, 10 Sep 2010)
New Revision: 392

Added:
   pkg/blotter/man/chart.Posn.Rd
   pkg/blotter/man/chart.Spread.Rd
   pkg/blotter/man/extractTxns.Rd
Modified:
   pkg/blotter/R/extractTests.R
   pkg/blotter/R/getTxn.R
Log:
- update docs, minor additions

Modified: pkg/blotter/R/extractTests.R
===================================================================
--- pkg/blotter/R/extractTests.R	2010-09-09 15:03:04 UTC (rev 391)
+++ pkg/blotter/R/extractTests.R	2010-09-10 13:50:48 UTC (rev 392)
@@ -1,4 +1,16 @@
-
+#' extract transactions from a portfolio in a manner suitable for creating tests
+#' 
+#' This function reverse-engineers \code{\link{addTxn}} calls for all the transactions in \code{Portfolio}.
+#' This is the fundamental task required to create a reproducible example, as it would replicate the 
+#' state of the $txn slot in the portfolio after each addTxn call.  
+#' While market data, expected results, portfolio and account setup, etc, are also required, 
+#' these can usually be deduced or equivalent formulations can be found.  
+#' 
+#' For transactions, only the exact addTxn parameters will recreate the $txn slot.  This function creates that reproducibility.  
+#' 
+#' @param Portfolio string identifying the portfolio to extract from
+#' @return string vector of \code{\link{addTxn}} calls that would replicate the given portfolio
+#' @export
 extractTxns <- function(Portfolio)
 { # @author Brian G. Peterson, Josh Ulrich
 	
@@ -43,6 +55,6 @@
 # This library is distributed under the terms of the GNU Public License (GPL)
 # for full details see the file COPYING
 #
-# $Id: getTxn.R 378 2010-08-20 18:12:00Z braverock $
+# $Id$
 #
 ###############################################################################


Property changes on: pkg/blotter/R/extractTests.R
___________________________________________________________________
Added: svn:keywords
   + Revision Id Date Author

Modified: pkg/blotter/R/getTxn.R
===================================================================
--- pkg/blotter/R/getTxn.R	2010-09-09 15:03:04 UTC (rev 391)
+++ pkg/blotter/R/getTxn.R	2010-09-10 13:50:48 UTC (rev 392)
@@ -3,10 +3,10 @@
     pname<-Portfolio
     Portfolio<-get(paste("portfolio",pname,sep='.'),envir=.blotter)
     if(inherits(Portfolio,"try-error"))
-        stop(paste("Portfolio",name," not found, use initPortf() to create a new account"))
+        stop(paste("Portfolio",name," not found, use initPortf() to create a new portfolio first"))
     
     # DESCRIPTION:
-    # Gets the value of that period's transactions and returns the sum 
+    # Gets the transactions and returns 
 
     # Inputs
     # Portfolio: a portfolio object containing transactions

Added: pkg/blotter/man/chart.Posn.Rd
===================================================================
--- pkg/blotter/man/chart.Posn.Rd	                        (rev 0)
+++ pkg/blotter/man/chart.Posn.Rd	2010-09-10 13:50:48 UTC (rev 392)
@@ -0,0 +1,4 @@
+\name{chart.Posn}
+\alias{chart.Posn}
+\title{chart.Posn}
+\usage{chart.Posn(Portfolio, Symbol, Dates, ...)}

Added: pkg/blotter/man/chart.Spread.Rd
===================================================================
--- pkg/blotter/man/chart.Spread.Rd	                        (rev 0)
+++ pkg/blotter/man/chart.Spread.Rd	2010-09-10 13:50:48 UTC (rev 392)
@@ -0,0 +1,4 @@
+\name{chart.Spread}
+\alias{chart.Spread}
+\title{chart.Spread}
+\usage{chart.Spread(Account, Portfolio, Spread, Symbols, Dates, ...)}

Added: pkg/blotter/man/extractTxns.Rd
===================================================================
--- pkg/blotter/man/extractTxns.Rd	                        (rev 0)
+++ pkg/blotter/man/extractTxns.Rd	2010-09-10 13:50:48 UTC (rev 392)
@@ -0,0 +1,14 @@
+\name{extractTxns}
+\alias{extractTxns}
+\title{extract transactions from a portfolio in a manner suitable for creating tests...}
+\usage{extractTxns(Portfolio)}
+\description{extract transactions from a portfolio in a manner suitable for creating tests}
+\details{This function reverse-engineers \code{\link{addTxn}} calls for all the transactions in \code{Portfolio}.
+This is the fundamental task required to create a reproducible example, as it would replicate the 
+state of the $txn slot in the portfolio after each addTxn call.  
+While market data, expected results, portfolio and account setup, etc, are also required, 
+these can usually be deduced or equivalent formulations can be found.  
+
+For transactions, only the exact addTxn parameters will recreate the $txn slot.  This function creates that reproducibility.}
+\value{string vector of \code{\link{addTxn}} calls that would replicate the given portfolio}
+\arguments{\item{Portfolio}{string identifying the portfolio to extract from}}



More information about the Blotter-commits mailing list