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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Sep 22 16:31:23 CEST 2011


Author: gsee
Date: 2011-09-22 16:31:23 +0200 (Thu, 22 Sep 2011)
New Revision: 786

Modified:
   pkg/FinancialInstrument/R/synthetic.R
Log:
 if else syntax mistake

Modified: pkg/FinancialInstrument/R/synthetic.R
===================================================================
--- pkg/FinancialInstrument/R/synthetic.R	2011-09-22 14:23:34 UTC (rev 785)
+++ pkg/FinancialInstrument/R/synthetic.R	2011-09-22 14:31:23 UTC (rev 786)
@@ -17,10 +17,12 @@
 {
     if (missing(primary_id) || (is.null(primary_id))) primary_id <- make_spread_id(members)
     if (missing(currency) || (is.null(currency))) {
-        if (is.null(members)) stop("'currency' is a required argument") 
-    } else {
-        instr <- try(getInstrument(members[[1]],silent=TRUE))
-        if (is.instrument(instr)) currency <- instr$currency
+        if (is.null(members)) {
+            stop("'currency' is a required argument") 
+        } else {
+            instr <- try(getInstrument(members[[1]],silent=TRUE))
+            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 )
 }



More information about the Blotter-commits mailing list