[Blotter-commits] r576 - pkg/FinancialInstrument/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Mar 15 14:52:54 CET 2011


Author: braverock
Date: 2011-03-15 14:52:54 +0100 (Tue, 15 Mar 2011)
New Revision: 576

Modified:
   pkg/FinancialInstrument/R/instrument.R
Log:
- allow NULL tick_size, if not NULL, require a single number, as previously

Modified: pkg/FinancialInstrument/R/instrument.R
===================================================================
--- pkg/FinancialInstrument/R/instrument.R	2011-03-14 04:05:47 UTC (rev 575)
+++ pkg/FinancialInstrument/R/instrument.R	2011-03-15 13:52:54 UTC (rev 576)
@@ -97,7 +97,6 @@
           targ<-arg[['...']]
           arg[['...']]<-NULL
           arg<-c(arg,targ)
-      }
   } 
   #check for identifiers we recognize 
   ident_str<-c("X.RIC","RIC","CUSIP","SEDOL","OSI","Bloomberg","Reuters","ISIN","CQG","TT","Yahoo","Google")
@@ -113,7 +112,7 @@
   
   ## TODO note that multiplier could be a time series, probably add code here to check
   if(!is.numeric(multiplier) | length(multiplier) > 1) stop("multiplier must be a single number")
-  if(!is.numeric(tick_size) | length(tick_size) > 1) stop("tick_size must be a single number")
+  if(!is.null(tick_size) && !is.numeric(tick_size) | length(tick_size) > 1) stop("tick_size must be NULL or a single number")
   
   if(is.null(type)) tclass="instrument" else tclass = c(type,"instrument")
 



More information about the Blotter-commits mailing list