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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Mar 15 18:11:14 CET 2012


Author: gsee
Date: 2012-03-15 18:11:14 +0100 (Thu, 15 Mar 2012)
New Revision: 973

Modified:
   pkg/FinancialInstrument/DESCRIPTION
   pkg/FinancialInstrument/R/instrument.R
   pkg/FinancialInstrument/man/exchange_rate.Rd
Log:
 tick_size a formal of exchange_rate to avoid formal argument matched by
 multiple actual arguments error

Modified: pkg/FinancialInstrument/DESCRIPTION
===================================================================
--- pkg/FinancialInstrument/DESCRIPTION	2012-03-14 20:04:27 UTC (rev 972)
+++ pkg/FinancialInstrument/DESCRIPTION	2012-03-15 17:11:14 UTC (rev 973)
@@ -11,7 +11,7 @@
     meta-data and relationships. Provides support for
     multi-asset class and multi-currency portfolios. Still
     in heavy development.
-Version: 0.13.0
+Version: 0.13.1
 URL: https://r-forge.r-project.org/projects/blotter/
 Date: $Date$
 Depends:

Modified: pkg/FinancialInstrument/R/instrument.R
===================================================================
--- pkg/FinancialInstrument/R/instrument.R	2012-03-14 20:04:27 UTC (rev 972)
+++ pkg/FinancialInstrument/R/instrument.R	2012-03-15 17:11:14 UTC (rev 973)
@@ -635,12 +635,15 @@
 #' @param primary_id string identifier, usually expressed as a currency pair 'USDYEN' or 'EURGBP'
 #' @param currency string identifying the currency the exchange rate ticks in
 #' @param counter_currency string identifying the currency which the rate uses as the base 'per 1' multiplier
+#' @param tick_size minimum price change
 #' @param identifiers named list of any other identifiers that should also be stored for this instrument
 #' @param assign_i TRUE/FALSE. Should the instrument be assigned in the \code{.instrument} environment? (Default TRUE)
 #' @param ... any other passthru parameters
 #' @references http://financial-dictionary.thefreedictionary.com/Base+Currency
 #' @export
-exchange_rate <- function (primary_id = NULL, currency = NULL, counter_currency = NULL, identifiers = NULL, assign_i=TRUE, ...){
+exchange_rate <- function (primary_id = NULL, currency = NULL, 
+                           counter_currency = NULL, tick_size=0.01, 
+                           identifiers = NULL, assign_i=TRUE, ...){
   # exchange_rate_temp = instrument(primary_id , currency , multiplier=1 , tick_size=.01, identifiers = identifiers, ..., type="exchange_rate")
   if (is.null(primary_id) && !is.null(currency) && !is.null(counter_currency)) {
     primary_id <- c(outer(counter_currency,currency,paste,sep=""))
@@ -656,7 +659,10 @@
   if(!exists(counter_currency, where=FinancialInstrument:::.instrument,inherits=TRUE)) warning(paste("counter_currency",counter_currency,"not found")) # assumes that we know where to look
 
   ## now structure and return
-  instrument(primary_id=primary_id , currency=currency , multiplier=1 , tick_size=.01, identifiers = identifiers, ..., counter_currency=counter_currency, type=c("exchange_rate","currency"), assign_i=assign_i)
+  instrument(primary_id=primary_id , currency=currency , multiplier=1, 
+             tick_size=tick_size, identifiers = identifiers, ..., 
+             counter_currency=counter_currency, 
+             type=c("exchange_rate","currency"), assign_i=assign_i)
 }
 
 #TODO  auction dates, coupons, etc for govmt. bonds

Modified: pkg/FinancialInstrument/man/exchange_rate.Rd
===================================================================
--- pkg/FinancialInstrument/man/exchange_rate.Rd	2012-03-14 20:04:27 UTC (rev 972)
+++ pkg/FinancialInstrument/man/exchange_rate.Rd	2012-03-15 17:11:14 UTC (rev 973)
@@ -3,8 +3,8 @@
 \title{constructor for spot exchange rate instruments}
 \usage{
   exchange_rate(primary_id = NULL, currency = NULL,
-    counter_currency = NULL, identifiers = NULL,
-    assign_i = TRUE, ...)
+    counter_currency = NULL, tick_size = 0.01,
+    identifiers = NULL, assign_i = TRUE, ...)
 }
 \arguments{
   \item{primary_id}{string identifier, usually expressed as
@@ -16,6 +16,8 @@
   \item{counter_currency}{string identifying the currency
   which the rate uses as the base 'per 1' multiplier}
 
+  \item{tick_size}{minimum price change}
+
   \item{identifiers}{named list of any other identifiers
   that should also be stored for this instrument}
 



More information about the Blotter-commits mailing list