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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Dec 10 21:43:46 CET 2011


Author: gsee
Date: 2011-12-10 21:43:41 +0100 (Sat, 10 Dec 2011)
New Revision: 869

Modified:
   pkg/FinancialInstrument/DESCRIPTION
   pkg/FinancialInstrument/R/instrument.R
   pkg/FinancialInstrument/R/synthetic.R
   pkg/FinancialInstrument/man/currencies.Rd
   pkg/FinancialInstrument/man/exchange_rate.Rd
   pkg/FinancialInstrument/man/instrument.Rd
   pkg/FinancialInstrument/man/instrument.auto.Rd
   pkg/FinancialInstrument/man/root_contracts.Rd
   pkg/FinancialInstrument/man/series_instrument.Rd
   pkg/FinancialInstrument/man/synthetic.instrument.Rd
Log:
assign_i is now a formal argument for instrument wrappers.

Modified: pkg/FinancialInstrument/DESCRIPTION
===================================================================
--- pkg/FinancialInstrument/DESCRIPTION	2011-12-08 23:24:24 UTC (rev 868)
+++ pkg/FinancialInstrument/DESCRIPTION	2011-12-10 20:43:41 UTC (rev 869)
@@ -11,7 +11,7 @@
     meta-data and relationships. Provides support for
     multi-asset class and multi-currency portfolios. Still
     in heavy development.
-Version: 0.9.8
+Version: 0.9.9
 URL: https://r-forge.r-project.org/projects/blotter/
 Date: $Date$
 Depends:

Modified: pkg/FinancialInstrument/R/instrument.R
===================================================================
--- pkg/FinancialInstrument/R/instrument.R	2011-12-08 23:24:24 UTC (rev 868)
+++ pkg/FinancialInstrument/R/instrument.R	2011-12-10 20:43:41 UTC (rev 869)
@@ -69,7 +69,8 @@
 #' @param tick_size the tick increment of the instrument price in it's trading venue, as numeric quantity (e.g. 1/8 is .125)
 #' @param identifiers named list of any other identifiers that should also be stored for this instrument
 #' @param type instrument type to be appended to the class definition, typically not set by user
-#' @param assign_i TRUE/FALSE if TRUE, assign the instrument to the .instrument environment, default FALSE
+#' @param assign_i TRUE/FALSE. Should the instrument be assigned to the \code{.instrument} environment?  Default is FALSE for 
+#'  \code{instrument}, TRUE for wrappers.
 #' @aliases 
 #' stock
 #' bond
@@ -154,25 +155,25 @@
 
 #' @export
 #' @rdname instrument
-stock <- function(primary_id , currency=NULL , multiplier=1 , tick_size=.01, identifiers = NULL, ...){
+stock <- function(primary_id , currency=NULL , multiplier=1 , tick_size=.01, identifiers = NULL, assign_i=TRUE, ...){
     if (is.null(currency)) stop ("'currency' is a required argument")
     if (length(primary_id) > 1) return(unname(sapply(primary_id, stock, 
         currency=currency, multiplier=multiplier, tick_size=tick_size, identifiers=identifiers, ...=...)))
-    instrument(primary_id=primary_id , currency=currency , multiplier=multiplier , tick_size=tick_size, identifiers = identifiers, ..., type="stock", assign_i=TRUE)
+    instrument(primary_id=primary_id , currency=currency , multiplier=multiplier , tick_size=tick_size, identifiers = identifiers, ..., type="stock", assign_i=assign_i)
 }
 
 #' @export
 #' @rdname instrument
-fund <- function(primary_id , currency=NULL , multiplier=1 , tick_size=.01, identifiers = NULL, ...){
+fund <- function(primary_id , currency=NULL , multiplier=1 , tick_size=.01, identifiers = NULL, assign_i=TRUE, ...){
     if (is.null(currency)) stop ("'currency' is a required argument")
     if (length(primary_id) > 1) return(unname(sapply(primary_id, fund,
         currency=currency, multiplier=multiplier, tick_size=tick_size, identifiers=identifiers, ...=...)))
-    instrument(primary_id = primary_id, currency = currency, multiplier = multiplier, tick_size = tick_size, identifiers = identifiers, ..., type="fund", assign_i=TRUE)
+    instrument(primary_id = primary_id, currency = currency, multiplier = multiplier, tick_size = tick_size, identifiers = identifiers, ..., type="fund", assign_i=assign_i)
 }
 
 #' @export
 #' @rdname instrument
-future <- function(primary_id , currency , multiplier , tick_size=NULL, identifiers = NULL, ..., underlying_id=NULL){
+future <- function(primary_id , currency , multiplier , tick_size=NULL, identifiers = NULL, assign_i=TRUE, ..., underlying_id=NULL){
     if(missing(primary_id)) primary_id <- paste("..",underlying_id,sep="")
     if (length(primary_id) > 1) stop('primary_id must be of length 1')
     if (missing(currency) && !is.null(underlying_id)) {
@@ -192,7 +193,7 @@
         }  
     }
 
-    instrument(primary_id=primary_id , currency=currency , multiplier=multiplier , tick_size=tick_size, identifiers = identifiers, ... , type="future", underlying_id=underlying_id, assign_i=TRUE )
+    instrument(primary_id=primary_id , currency=currency , multiplier=multiplier , tick_size=tick_size, identifiers = identifiers, ... , type="future", underlying_id=underlying_id, assign_i=assign_i )
 }
 
 
@@ -217,6 +218,7 @@
 #' @param strike strike price of option
 #' @param payment_schedule not currently being implemented
 #' @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?
 #' @param ... any other passthru parameters
 #' @aliases 
 #' option_series
@@ -241,7 +243,7 @@
 #' }
 #' @export
 #' @rdname series_instrument
-future_series <- function(primary_id, root_id=NULL, suffix_id=NULL, first_traded=NULL, expires=NULL, identifiers = NULL, ...){
+future_series <- function(primary_id, root_id=NULL, suffix_id=NULL, first_traded=NULL, expires=NULL, identifiers = NULL, assign_i=TRUE, ...){
   if (missing(primary_id)) {
       if (all(is.null(c(root_id,suffix_id)))) {
           stop('must provide either a primary_id or both a root_id and a suffix_id')
@@ -258,7 +260,7 @@
           stop("'first_traded' and 'expires' must be NULL if calling with multiple primary_ids")
       return(unname(sapply(primary_id, future_series,
           root_id=root_id, suffix_id=suffix_id, first_traded=first_traded, 
-          expires=expires, identifiers = identifiers, ...=...)))
+          expires=expires, identifiers = identifiers, assign_i=assign_i, ...=...)))
   } else if (is.null(root_id) && !is.null(suffix_id) && parse_id(primary_id)$type == 'root') {
       #if we have primary_id, but primary_id looks like a root_id, and we have suffix_id and don't have root_id
       #then primary_id is really root_id and we need to replace primary_id
@@ -319,7 +321,7 @@
       if (!is.null(contract$description)) {
           args$series_description <- paste(contract$description, expires)
       }
-      args$assign_i=TRUE
+      args$assign_i=assign_i
       dargs<-list(...)
       dargs$currency=NULL
       dargs$multiplier=NULL
@@ -335,7 +337,7 @@
 
 #' @export
 #' @rdname instrument
-option <- function(primary_id , currency , multiplier , tick_size=NULL, identifiers = NULL, ..., underlying_id=NULL){
+option <- function(primary_id , currency , multiplier , tick_size=NULL, identifiers = NULL, assign_i=TRUE, ..., underlying_id=NULL){
   if (missing(primary_id)) primary_id <- paste(".",underlying_id,sep="")
   if (length(primary_id) > 1) stop("'primary_id' must be of length 1")
   if (missing(currency) && !is.null(underlying_id)) {
@@ -355,13 +357,13 @@
       }  
   }
   ## now structure and return
-  instrument(primary_id=primary_id , currency=currency , multiplier=multiplier , tick_size=tick_size, identifiers = identifiers, ... , type="option", underlying_id=underlying_id, assign_i=TRUE )
+  instrument(primary_id=primary_id , currency=currency , multiplier=multiplier , tick_size=tick_size, identifiers = identifiers, ... , type="option", underlying_id=underlying_id, assign_i=assign_i )
 }
 
 #' @export
 #' @rdname series_instrument
 option_series <- function(primary_id , root_id = NULL, suffix_id = NULL, first_traded=NULL, 
-                            expires=NULL, callput=c("call","put"), strike=NULL, identifiers = NULL, ...){
+                            expires=NULL, callput=c("call","put"), strike=NULL, identifiers = NULL, assign_i=TRUE, ...){
     if (missing(primary_id) ) {
         if (all(is.null(c(root_id,suffix_id)))) 
             stop('must provide either a primary_id or both a root_id and a suffix_id')
@@ -383,7 +385,7 @@
           stop("'first_traded' and 'expires' must be NULL if calling with multiple primary_ids")         
       return(unname(sapply(primary_id, option_series, 
           root_id=root_id, suffix_id=suffix_id, first_traded=first_traded,
-          expires=expires, callput=callput, strike=strike, identifiers=identifiers, ...=...)))
+          expires=expires, callput=callput, strike=strike, identifiers=identifiers, assign_i=assign_i, ...=...)))
     } else if (is.null(root_id) && !is.null(suffix_id) && parse_id(primary_id)$type == 'root') {
           #if we have primary_id, but primary_id looks like a root_id, and we have suffix_id and don't have root_id
           #then primary_id is really root_id and we need to replace primary_id
@@ -439,7 +441,7 @@
                     underlying_id = contract$underlying_id,
                     ...=dargs,
                     type=c("option_series", "option"),
-                    assign_i=TRUE
+                    assign_i=assign_i
                   ) 
     }
 }
@@ -536,7 +538,7 @@
 
 #' @export
 #' @rdname instrument
-currency <- function(primary_id, identifiers = NULL, ...){
+currency <- function(primary_id, identifiers = NULL, assign_i=TRUE, ...){
     if (length(primary_id) > 1) return(unname(sapply(primary_id, currency, identifiers=identifiers, ...=...)))
     ccy <- try(getInstrument(primary_id,type='currency',silent=TRUE))
     if (is.instrument(ccy)) {
@@ -563,8 +565,11 @@
         ccy <- c(ccy,dargs)
     }        
     class(ccy)<-c("currency","instrument")
-    assign(primary_id, ccy, pos=as.environment(.instrument) )
-    primary_id
+    if (assign_i) {
+        assign(primary_id, ccy, pos=as.environment(.instrument) )
+        return(primary_id)
+    }
+    ccy
 }
 
 #' class test for object supposedly of type 'currency'
@@ -592,10 +597,11 @@
 #' @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 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, ...){
+exchange_rate <- function (primary_id = NULL, currency = NULL, counter_currency = NULL, 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=""))
@@ -611,21 +617,21 @@
   if(!exists(counter_currency, where=.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=TRUE)
+  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)
 }
 
 #TODO  auction dates, coupons, etc for govmt. bonds
 #' @export
 #' @rdname instrument
-bond <- function(primary_id , currency , multiplier, tick_size=NULL , identifiers = NULL, ...){
+bond <- function(primary_id , currency , multiplier, tick_size=NULL , identifiers = NULL, assign_i=TRUE, ...){
     if (missing(currency)) stop ("'currency' is a required argument")
     if (length(primary_id) > 1) stop("'primary_id' must be of length 1 for this function")
-    instrument(primary_id=primary_id , currency=currency , multiplier=multiplier , tick_size=tick_size, identifiers = identifiers, ..., type="bond", assign_i=TRUE )
+    instrument(primary_id=primary_id , currency=currency , multiplier=multiplier , tick_size=tick_size, identifiers = identifiers, ..., type="bond", assign_i=assign_i )
 }
 
 #' @export
 #' @rdname series_instrument
-bond_series <- function(primary_id , suffix_id, ..., first_traded=NULL, maturity=NULL, identifiers = NULL, payment_schedule=NULL){
+bond_series <- function(primary_id , suffix_id, ..., first_traded=NULL, maturity=NULL, identifiers = NULL, payment_schedule=NULL, assign_i=TRUE){
     contract<-try(getInstrument(primary_id))
     if(!inherits(contract,"bond")) stop("bonds contract spec must be defined first")
     
@@ -656,7 +662,7 @@
                 identifiers = identifiers,
                 type=c("bond_series", "bond"),
                 ...=dargs,
-                assign_i=TRUE
+                assign_i=assign_i
         ) 
     }
 }
@@ -691,6 +697,7 @@
 #' @param multiplier numeric product multiplier
 #' @param silent TRUE/FALSE. silence warnings?
 #' @param default_type What type of instrument to make if it is not clear from the primary_id. ("stock", "future", etc.) Default is NULL.
+#' @param assign_i TRUE/FALSE. Should the \code{instrument} be assigned in the \code{.instrument} environment?
 #' @param ... other passthrough parameters
 #' @return Primarily called for its side-effect, but will return the name of the instrument that was created
 #' @note This is not intended to be used to create instruments of type \code{stock}, \code{future}, \code{option},
@@ -715,7 +722,7 @@
 #' getInstrument("VX_H11") #made a future_series
 #' }
 #' @export
-instrument.auto <- function(primary_id, currency='USD', multiplier=1, silent=FALSE, default_type='NULL', ...) {
+instrument.auto <- function(primary_id, currency='USD', multiplier=1, silent=FALSE, default_type='NULL', assign_i=TRUE, ...) {
 ##TODO: check formals against dots and remove duplicates from dots before calling constructors to avoid
 # 'formal argument "multiplier" matched by multiple actual arguments'
     if (!is.currency(currency)) {
@@ -730,15 +737,15 @@
     pid <- parse_id(primary_id)
     type <- NULL
     if (any(pid$type == 'calendar')) {
-        return(guaranteed_spread(primary_id, currency=currency, defined.by='auto', ...))
+        return(guaranteed_spread(primary_id, currency=currency, defined.by='auto', assign_i=assign_i, ...))
     } 
     if (any(pid$type == 'butterfly')) {
-        return(butterfly(primary_id, currency=currency, defined.by='auto', ...))
+        return(butterfly(primary_id, currency=currency, defined.by='auto', assign_i=assign_i, ...))
     }
     if (any(pid$type == 'future') || any(pid$type == 'SSF')) {
         root <- getInstrument(pid$root,silent=TRUE,type='future')
         if (is.instrument(root) && !inherits(root, 'future_series')) {
-            return(future_series(primary_id,defined.by='auto',...))
+            return(future_series(primary_id,defined.by='auto', assign_i=assign_i,...))
         } else {
             if (!silent) {
                 warning(paste(primary_id," appears to be a future_series, ", 
@@ -754,7 +761,7 @@
     if (any(pid$type == 'option')) {
         root <- getInstrument(pid$root,silent=TRUE,type='option')
         if (is.instrument(root) && !inherits(root, 'option_series')) {
-            return(option_series(primary_id, defined.by='auto', ...))
+            return(option_series(primary_id, defined.by='auto', assign_i=assign_i, ...))
         } else {
             if (!silent) {
                 warning(paste(primary_id," appears to be an option_series, ", 
@@ -775,7 +782,7 @@
         }
     } 
     if (any(pid$type == 'exchange_rate'))
-        return(exchange_rate(primary_id, defined.by='auto', ...))
+        return(exchange_rate(primary_id, defined.by='auto', assign_i=assign_i, ...))
     #if we weren't given a default_type, then if it's 6 uppercase letters, make an exchange rate    
     if (default_type == 'NULL' && nchar(primary_id) == 6 && sum(attr(gregexpr("[A-Z]",primary_id)[[1]],"match.length")) == 6) {
         if (!is.instrument(getInstrument(substr(primary_id,1,3), silent=TRUE))) {
@@ -786,13 +793,13 @@
             ccy.st <- currency(substr(primary_id,4,6), defined.by='auto') 
             if (!silent) cat("Created currency", ccy.st, "because it was not defined.\n")
         }
-        return(exchange_rate(primary_id, defined.by='auto', ...))
+        return(exchange_rate(primary_id, defined.by='auto', assign_i=assign_i, ...))
     }
     if (any(pid$type == 'synthetic')) {
         if (!is.na(pid$format) && pid$format == 'yahooIndex') {
             return(synthetic(gsub("\\^","",primary_id), currency=currency, identifiers=list(yahoo=primary_id), 
-                            src=list(src='yahoo',name=primary_id), defined_by='auto', ...))
-        } else return(synthetic(members=strsplit(primary_id,"\\.")[[1]], currency=currency, defined.by='auto', ...) )
+                            src=list(src='yahoo',name=primary_id), defined_by='auto', assign_i=assign_i, ...))
+        } else return(synthetic(members=strsplit(primary_id,"\\.")[[1]], currency=currency, defined.by='auto', assign_i=assign_i, ...) )
     } 
     ss <- strsplit(primary_id," ")[[1]]  #take out spaces (OSI uses spaces, but makenames would turn them into dots)
     ss <- ss[!ss %in% ""]
@@ -801,6 +808,7 @@
     dargs$currency <- currency
     dargs$multiplier <- multiplier
     dargs$defined.by='auto'
+    dargs$assign_i <- assign_i
     if(is.function(try(match.fun(default_type),silent=TRUE))) {
         if (!silent && !warned) 
             warning('Creating a _', default_type, '_ instrument because ', 
@@ -810,7 +818,6 @@
     if (!silent && !warned) 
         warning(paste(primary_id, 'is not of an unambiguous format.', 
                 'Creating basic instrument with multiplier 1.'))
-    dargs$assign_i <- TRUE
     do.call(instrument, dargs)
 }
  

Modified: pkg/FinancialInstrument/R/synthetic.R
===================================================================
--- pkg/FinancialInstrument/R/synthetic.R	2011-12-08 23:24:24 UTC (rev 868)
+++ pkg/FinancialInstrument/R/synthetic.R	2011-12-10 20:43:41 UTC (rev 869)
@@ -13,7 +13,7 @@
 
 #' @export
 #' @rdname synthetic.instrument
-synthetic <- function(primary_id=NULL, currency=NULL, multiplier=1, identifiers = NULL, ..., members=NULL, type="synthetic")
+synthetic <- function(primary_id=NULL, currency=NULL, multiplier=1, identifiers = NULL, assign_i=TRUE, ..., members=NULL, type="synthetic")
 {
     if (missing(primary_id) || (is.null(primary_id))) primary_id <- make_spread_id(members)
     if (missing(currency) || (is.null(currency))) {
@@ -24,7 +24,7 @@
             if (is.instrument(instr)) currency <- instr$currency
         }
     }
-    instrument(primary_id=primary_id , currency=currency , multiplier=multiplier , identifiers = identifiers, ...=..., type=type, members=members, assign_i=TRUE )
+    instrument(primary_id=primary_id , currency=currency , multiplier=multiplier , identifiers = identifiers, assign_i=assign_i, ...=..., type=type, members=members)
 }
 
 #' constructors for synthetic instruments
@@ -88,6 +88,7 @@
 #' @param multiplier multiplier of the spread (1 / divisor for price weighted baskets)
 #' @param tick_size minimum price change of the spread
 #' @param identifiers identifiers
+#' @param assign_i TRUE/FALSE. Should the instrument be assigned in the \code{.instrument} environment?
 #' @param type type of instrument; wrappers do not require this.
 #' @param root_id instrument identifier for the root contract, default NULL
 #' @param suffix_id identifiers for the member contract suffixes, default NULL, will be split as \code{members}, see Details
@@ -103,7 +104,7 @@
 #' }
 #' @export
 synthetic.instrument <- function (primary_id, currency, members, memberratio, ..., multiplier = 1, tick_size=NULL, 
-    identifiers = NULL, type = c("synthetic.instrument", "synthetic")) 
+    identifiers = NULL, assign_i=TRUE, type = c("synthetic.instrument", "synthetic")) 
 {
     if (!is.list(members)) {
         if (length(members) != length(memberratio) | length(members) < 2) {
@@ -160,18 +161,18 @@
 #' @export
 #' @rdname synthetic.instrument
 spread <- function (primary_id = NULL, currency = NULL, members, memberratio, tick_size=NULL,
-    ..., multiplier = 1, identifiers = NULL) 
+    ..., multiplier = 1, identifiers = NULL, assign_i=TRUE) 
 {
     synthetic.instrument(primary_id = primary_id, currency = currency, 
       members = members, memberratio = memberratio, ...=..., tick_size=tick_size,
-      multiplier = multiplier, identifiers = identifiers, 
+      multiplier = multiplier, identifiers = identifiers, assign_i=assign_i,
       type = c("spread", "synthetic.instrument", "synthetic", "instrument"))
 }
 
 
 #' @export
 #' @rdname synthetic.instrument
-butterfly <- function(primary_id = NULL, currency=NULL, members,tick_size=NULL, identifiers=NULL, ...)
+butterfly <- function(primary_id = NULL, currency=NULL, members,tick_size=NULL, identifiers=NULL, assign_i=TRUE, ...)
 {
 ##TODO: butterfly can refer to expirations (futures) or strikes (options)
 ##TODO: A butterfly could either have 3 members that are outrights, or 2 members that are spreads
@@ -188,7 +189,7 @@
   if (length(members) == 3) {
     synthetic.instrument(primary_id=primary_id,currency=currency,members=members,
 	    memberratio=c(1,-2,1), multiplier=1, tick_size=tick_size,
-	    identifiers=NULL, ...=..., type = c('butterfly','spread','synthetic.instrument',
+	    identifiers=NULL, assign_i=assign_i, ...=..., type = c('butterfly','spread','synthetic.instrument',
 	    'synthetic','instrument'))
   } else if (length(members) == 2) {
       stop('butterfly currently only supports 3 leg spreads (i.e. no spread of spreads yet.)')
@@ -201,7 +202,7 @@
 #' @export
 #' @rdname synthetic.instrument
 guaranteed_spread <- calendar_spread <- function (primary_id=NULL, currency=NULL, root_id=NULL, suffix_id=NULL, members = NULL, memberratio = c(1,-1), ..., 
-    multiplier = NULL, identifiers = NULL, tick_size=NULL)
+    multiplier = NULL, identifiers = NULL, assign_i=TRUE, tick_size=NULL)
 {
 
 	if (!is.null(suffix_id)) {
@@ -246,7 +247,7 @@
     }
 	
     synthetic.instrument(primary_id = id, currency = currency, members = members, 
-	memberratio = memberratio, multiplier = multiplier, identifiers = NULL, 
+	memberratio = memberratio, multiplier = multiplier, identifiers = NULL, assign_i=assign_i,
 	tick_size=tick_size, ... = ..., type = c("guaranteed_spread", "spread", 
 	"synthetic.instrument", "synthetic"))
 }

Modified: pkg/FinancialInstrument/man/currencies.Rd
===================================================================
--- pkg/FinancialInstrument/man/currencies.Rd	2011-12-08 23:24:24 UTC (rev 868)
+++ pkg/FinancialInstrument/man/currencies.Rd	2011-12-10 20:43:41 UTC (rev 869)
@@ -7,5 +7,5 @@
   \code{\link{load.instruments}}
 }
 \keyword{data}
-\keyword{dataset}
+\keyword{datasets}
 

Modified: pkg/FinancialInstrument/man/exchange_rate.Rd
===================================================================
--- pkg/FinancialInstrument/man/exchange_rate.Rd	2011-12-08 23:24:24 UTC (rev 868)
+++ pkg/FinancialInstrument/man/exchange_rate.Rd	2011-12-10 20:43:41 UTC (rev 869)
@@ -3,7 +3,8 @@
 \title{constructor for spot exchange rate instruments}
 \usage{
   exchange_rate(primary_id = NULL, currency = NULL,
-    counter_currency = NULL, identifiers = NULL, ...)
+    counter_currency = NULL, identifiers = NULL,
+    assign_i = TRUE, ...)
 }
 \arguments{
   \item{primary_id}{string identifier, usually expressed as
@@ -18,6 +19,10 @@
   \item{identifiers}{named list of any other identifiers
   that should also be stored for this instrument}
 
+  \item{assign_i}{TRUE/FALSE. Should the instrument be
+  assigned in the \code{.instrument} environment? (Default
+  TRUE)}
+
   \item{...}{any other passthru parameters}
 }
 \description{

Modified: pkg/FinancialInstrument/man/instrument.Rd
===================================================================
--- pkg/FinancialInstrument/man/instrument.Rd	2011-12-08 23:24:24 UTC (rev 868)
+++ pkg/FinancialInstrument/man/instrument.Rd	2011-12-10 20:43:41 UTC (rev 869)
@@ -13,23 +13,26 @@
     assign_i = FALSE)
 
   stock(primary_id, currency = NULL, multiplier = 1,
-    tick_size = 0.01, identifiers = NULL, ...)
+    tick_size = 0.01, identifiers = NULL, assign_i = TRUE,
+    ...)
 
   fund(primary_id, currency = NULL, multiplier = 1,
-    tick_size = 0.01, identifiers = NULL, ...)
+    tick_size = 0.01, identifiers = NULL, assign_i = TRUE,
+    ...)
 
   future(primary_id, currency, multiplier,
-    tick_size = NULL, identifiers = NULL, ...,
-    underlying_id = NULL)
+    tick_size = NULL, identifiers = NULL, assign_i = TRUE,
+    ..., underlying_id = NULL)
 
   option(primary_id, currency, multiplier,
-    tick_size = NULL, identifiers = NULL, ...,
-    underlying_id = NULL)
+    tick_size = NULL, identifiers = NULL, assign_i = TRUE,
+    ..., underlying_id = NULL)
 
-  currency(primary_id, identifiers = NULL, ...)
+  currency(primary_id, identifiers = NULL, assign_i = TRUE,
+    ...)
 
   bond(primary_id, currency, multiplier, tick_size = NULL,
-    identifiers = NULL, ...)
+    identifiers = NULL, assign_i = TRUE, ...)
 }
 \arguments{
   \item{primary_id}{string describing the unique ID for the
@@ -59,8 +62,9 @@
   \item{type}{instrument type to be appended to the class
   definition, typically not set by user}
 
-  \item{assign_i}{TRUE/FALSE if TRUE, assign the instrument
-  to the .instrument environment, default FALSE}
+  \item{assign_i}{TRUE/FALSE. Should the instrument be
+  assigned to the \code{.instrument} environment?  Default
+  is FALSE for \code{instrument}, TRUE for wrappers.}
 }
 \description{
   All 'currency' instruments must be defined before

Modified: pkg/FinancialInstrument/man/instrument.auto.Rd
===================================================================
--- pkg/FinancialInstrument/man/instrument.auto.Rd	2011-12-08 23:24:24 UTC (rev 868)
+++ pkg/FinancialInstrument/man/instrument.auto.Rd	2011-12-10 20:43:41 UTC (rev 869)
@@ -4,7 +4,7 @@
 \usage{
   instrument.auto(primary_id, currency = "USD",
     multiplier = 1, silent = FALSE, default_type = "NULL",
-    ...)
+    assign_i = TRUE, ...)
 }
 \arguments{
   \item{primary_id}{charater primary identifier of
@@ -21,6 +21,9 @@
   is not clear from the primary_id. ("stock", "future",
   etc.) Default is NULL.}
 
+  \item{assign_i}{TRUE/FALSE. Should the \code{instrument}
+  be assigned in the \code{.instrument} environment?}
+
   \item{...}{other passthrough parameters}
 }
 \value{

Modified: pkg/FinancialInstrument/man/root_contracts.Rd
===================================================================
--- pkg/FinancialInstrument/man/root_contracts.Rd	2011-12-08 23:24:24 UTC (rev 868)
+++ pkg/FinancialInstrument/man/root_contracts.Rd	2011-12-10 20:43:41 UTC (rev 869)
@@ -7,5 +7,5 @@
   \code{\link{load.instruments}}
 }
 \keyword{data}
-\keyword{dataset}
+\keyword{datasets}
 

Modified: pkg/FinancialInstrument/man/series_instrument.Rd
===================================================================
--- pkg/FinancialInstrument/man/series_instrument.Rd	2011-12-08 23:24:24 UTC (rev 868)
+++ pkg/FinancialInstrument/man/series_instrument.Rd	2011-12-10 20:43:41 UTC (rev 869)
@@ -6,16 +6,17 @@
 \usage{
   future_series(primary_id, root_id = NULL,
     suffix_id = NULL, first_traded = NULL, expires = NULL,
-    identifiers = NULL, ...)
+    identifiers = NULL, assign_i = TRUE, ...)
 
   option_series(primary_id, root_id = NULL,
     suffix_id = NULL, first_traded = NULL, expires = NULL,
     callput = c("call", "put"), strike = NULL,
-    identifiers = NULL, ...)
+    identifiers = NULL, assign_i = TRUE, ...)
 
   bond_series(primary_id, suffix_id, ...,
     first_traded = NULL, maturity = NULL,
-    identifiers = NULL, payment_schedule = NULL)
+    identifiers = NULL, payment_schedule = NULL,
+    assign_i = TRUE)
 }
 \arguments{
   \item{primary_id}{string describing the unique ID for the
@@ -49,6 +50,9 @@
   \item{identifiers}{named list of any other identifiers
   that should also be stored for this instrument}
 
+  \item{assign_i}{TRUE/FALSE. Should the instrument be
+  assigned in the \code{.instrument} environment?}
+
   \item{...}{any other passthru parameters}
 }
 \description{

Modified: pkg/FinancialInstrument/man/synthetic.instrument.Rd
===================================================================
--- pkg/FinancialInstrument/man/synthetic.instrument.Rd	2011-12-08 23:24:24 UTC (rev 868)
+++ pkg/FinancialInstrument/man/synthetic.instrument.Rd	2011-12-10 20:43:41 UTC (rev 869)
@@ -7,25 +7,26 @@
 \title{synthetic instrument constructors}
 \usage{
   synthetic(primary_id = NULL, currency = NULL,
-    multiplier = 1, identifiers = NULL, ...,
-    members = NULL, type = "synthetic")
+    multiplier = 1, identifiers = NULL, assign_i = TRUE,
+    ..., members = NULL, type = "synthetic")
 
   synthetic.instrument(primary_id, currency, members,
     memberratio, ..., multiplier = 1, tick_size = NULL,
-    identifiers = NULL,
+    identifiers = NULL, assign_i = TRUE,
     type = c("synthetic.instrument", "synthetic"))
 
   spread(primary_id = NULL, currency = NULL, members,
     memberratio, tick_size = NULL, ..., multiplier = 1,
-    identifiers = NULL)
+    identifiers = NULL, assign_i = TRUE)
 
   butterfly(primary_id = NULL, currency = NULL, members,
-    tick_size = NULL, identifiers = NULL, ...)
+    tick_size = NULL, identifiers = NULL, assign_i = TRUE,
+    ...)
 
   guaranteed_spread(primary_id = NULL, currency = NULL,
     root_id = NULL, suffix_id = NULL, members = NULL,
     memberratio = c(1, -1), ..., multiplier = NULL,
-    identifiers = NULL, tick_size = NULL)
+    identifiers = NULL, assign_i = TRUE, tick_size = NULL)
 }
 \arguments{
   \item{primary_id}{chr string of primary identifier of
@@ -48,6 +49,9 @@
 
   \item{identifiers}{identifiers}
 
+  \item{assign_i}{TRUE/FALSE. Should the instrument be
+  assigned in the \code{.instrument} environment?}
+
   \item{type}{type of instrument; wrappers do not require
   this.}
 



More information about the Blotter-commits mailing list