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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Oct 17 23:52:44 CEST 2012


Author: braverock
Date: 2012-10-17 23:52:44 +0200 (Wed, 17 Oct 2012)
New Revision: 1224

Modified:
   pkg/blotter/R/chart.ME.R
Log:
- take first arguments if user doesn't specify
- add Symbol name to chart name

Modified: pkg/blotter/R/chart.ME.R
===================================================================
--- pkg/blotter/R/chart.ME.R	2012-10-17 13:35:18 UTC (rev 1223)
+++ pkg/blotter/R/chart.ME.R	2012-10-17 21:52:44 UTC (rev 1224)
@@ -17,6 +17,9 @@
 chart.ME <- function(Portfolio, Symbol, type=c('MAE','MFE'), scale=c('cash','percent','tick'), ...)
 {   # @author Jan Humme
 
+    type=type[1]
+    scale=scale[1] # can only take the first if the user doesn't specify
+    
     trades <- perTradeStats(Portfolio, Symbol, ...)
     
     #multiply Pcct numbers for prettier charting
@@ -74,6 +77,8 @@
         }
     )
 
+    .main<-paste(Symbol,.main)
+    
     plot(abs(trades[, .cols]), type='n', xlab=.xlab, ylab=.ylab, main=.main)
 
     grid()



More information about the Blotter-commits mailing list