[Blotter-commits] r1273 - pkg/blotter/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Dec 4 19:48:35 CET 2012


Author: braverock
Date: 2012-12-04 19:48:35 +0100 (Tue, 04 Dec 2012)
New Revision: 1273

Modified:
   pkg/blotter/R/chart.Posn.R
Log:
- handle prefer argument if passed for non-OHLC data

Modified: pkg/blotter/R/chart.Posn.R
===================================================================
--- pkg/blotter/R/chart.Posn.R	2012-12-03 18:14:30 UTC (rev 1272)
+++ pkg/blotter/R/chart.Posn.R	2012-12-04 18:48:35 UTC (rev 1273)
@@ -18,7 +18,10 @@
 
     require(quantmod)
     Prices=get(Symbol)
-    if(!is.OHLC(Prices)) Prices=getPrice(Prices, ...=...)
+    if(!is.OHLC(Prices)) {
+        if(hasArg(prefer)) prefer=match.call(expand.dots=TRUE)$prefer else prefer=NULL
+        Prices=getPrice(Prices, prefer=prefer)
+    }
     freq = periodicity(Prices)
     switch(freq$scale,
             seconds = { mult=1 },
@@ -72,7 +75,7 @@
     # scope the Price data by Dates
     if(!is.null(Dates)) Prices=Prices[Dates]
     
-    chart_Series(Prices, name=Symbol, TA=TA, ...)
+    chart_Series(Prices, name=Symbol, TA=TA)
     if(!is.null(nrow(Buys)) && nrow(Buys) >=1 ) (add_TA(Buys,pch=2,type='p',col='green', on=1));
     if(!is.null(nrow(Sells)) && nrow(Sells) >= 1) (add_TA(Sells,pch=6,type='p',col='red', on=1));
     if(nrow(Position)>=1) {



More information about the Blotter-commits mailing list