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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Dec 26 01:51:35 CET 2011


Author: gsee
Date: 2011-12-26 01:51:35 +0100 (Mon, 26 Dec 2011)
New Revision: 893

Modified:
   pkg/FinancialInstrument/R/instrument.R
Log:
 when instrument.auto makes a synthetic, it will define USD if it has to.

Modified: pkg/FinancialInstrument/R/instrument.R
===================================================================
--- pkg/FinancialInstrument/R/instrument.R	2011-12-26 00:42:19 UTC (rev 892)
+++ pkg/FinancialInstrument/R/instrument.R	2011-12-26 00:51:35 UTC (rev 893)
@@ -826,7 +826,7 @@
         if (!is.na(pid$format) && pid$format == 'yahooIndex') {
             if (is.null(currency)) {
                 if (!silent) warning('currency will be assumed to be USD because NULL is not a currency.')
-                currency <- 'USD'
+                currency <- currency('USD')
             }
             return(synthetic(gsub("\\^","",primary_id), currency=currency, multiplier=multiplier, 
                             identifiers=list(yahoo=primary_id), src=list(src='yahoo',name=primary_id),
@@ -837,7 +837,7 @@
                 #at least 1 member is not defined. So we have to assume this is an index (e.g. TICK-NYSE)
                 if (is.null(currency)) {
                     if (!silent) warning('currency will be assumed to be USD because NULL is not a currency.')
-                    currency <- 'USD'
+                    currency <- currency('USD')
                 }
                 return(synthetic(primary_id, currency=currency, multiplier=multiplier, 
                                 defined.by='auto', assign_i=assign_i, ...))



More information about the Blotter-commits mailing list