[Blotter-commits] r1253 - in pkg/blotter: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Nov 19 21:13:56 CET 2012


Author: braverock
Date: 2012-11-19 21:13:55 +0100 (Mon, 19 Nov 2012)
New Revision: 1253

Modified:
   pkg/blotter/R/chart.Posn.R
   pkg/blotter/man/chart.Posn.Rd
Log:
- add explicit passing of TA arg to chart_Series in chart.Posn

Modified: pkg/blotter/R/chart.Posn.R
===================================================================
--- pkg/blotter/R/chart.Posn.R	2012-11-18 23:39:54 UTC (rev 1252)
+++ pkg/blotter/R/chart.Posn.R	2012-11-19 20:13:55 UTC (rev 1253)
@@ -7,8 +7,9 @@
 #' @param Symbol string identifying the symbol to chart. If missing, the first symbol found in the \code{Portfolio} portfolio will be used
 #' @param Dates xts ISO 8601 style subsetting
 #' @param \dots any other passthru parameters to \code{\link[quantmod]{chart_Series}}
+#' @param TA a string defining a technical indicator function that will be applied to the chart, using \code{\link{eval}}
 #' @export
-chart.Posn <- function(Portfolio, Symbol, Dates = NULL, ...)
+chart.Posn <- function(Portfolio, Symbol, Dates = NULL, ...,TA=NULL)
 { # @author Peter Carl, Brian Peterson
     pname<-Portfolio
     Portfolio<-getPortfolio(pname)
@@ -71,7 +72,7 @@
     # scope the Price data by Dates
     if(!is.null(Dates)) Prices=Prices[Dates]
     
-    chart_Series(Prices, name=Symbol, TA=NULL, ...)
+    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) {

Modified: pkg/blotter/man/chart.Posn.Rd
===================================================================
--- pkg/blotter/man/chart.Posn.Rd	2012-11-18 23:39:54 UTC (rev 1252)
+++ pkg/blotter/man/chart.Posn.Rd	2012-11-19 20:13:55 UTC (rev 1253)
@@ -2,7 +2,8 @@
 \alias{chart.Posn}
 \title{Chart trades against market data, position through time, and cumulative P\&L}
 \usage{
-  chart.Posn(Portfolio, Symbol, Dates = NULL, ...)
+  chart.Posn(Portfolio, Symbol, Dates = NULL, ...,
+    TA = NULL)
 }
 \arguments{
   \item{Portfolio}{string identifying the portfolio to
@@ -16,6 +17,10 @@
 
   \item{\dots}{any other passthru parameters to
   \code{\link[quantmod]{chart_Series}}}
+
+  \item{TA}{a string defining a technical indicator
+  function that will be applied to the chart, using
+  \code{\link{eval}}}
 }
 \description{
   Produces a three-panel chart of time series charts that



More information about the Blotter-commits mailing list