[Blotter-commits] r221 - in pkg/blotter: R demo

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Feb 1 14:10:00 CET 2010


Author: peter_carl
Date: 2010-02-01 14:10:00 +0100 (Mon, 01 Feb 2010)
New Revision: 221

Modified:
   pkg/blotter/R/chart.Posn.R
   pkg/blotter/demo/longtrend.R
   pkg/blotter/demo/turtles.R
Log:
- cleaned up graphs


Modified: pkg/blotter/R/chart.Posn.R
===================================================================
--- pkg/blotter/R/chart.Posn.R	2010-01-30 13:30:29 UTC (rev 220)
+++ pkg/blotter/R/chart.Posn.R	2010-02-01 13:10:00 UTC (rev 221)
@@ -60,7 +60,7 @@
     chartSeries(Prices, TA=NULL,...)
     plot(addTA(Buys,pch=2,type='p',col='green', on=1));
     plot(addTA(Sells,pch=6,type='p',col='red', on=1));
-    plot(addTA(Position,type='b',col='blue', lwd=2));
+    plot(addTA(Position,type='h',col='blue', lwd=2));
     if(!is.null(CumPL))  plot(addTA(CumPL, col='darkgreen', lwd=2))
 }
 

Modified: pkg/blotter/demo/longtrend.R
===================================================================
--- pkg/blotter/demo/longtrend.R	2010-01-30 13:30:29 UTC (rev 220)
+++ pkg/blotter/demo/longtrend.R	2010-02-01 13:10:00 UTC (rev 221)
@@ -111,7 +111,7 @@
 cat('\n')
 
 # Chart results with quantmod
-chart.Posn(ltportfolio, Symbol = 'GSPC', Dates = '1998::',theme='white')
+chart.Posn(ltportfolio, Symbol = 'GSPC', Dates = '1998::',theme=chartTheme('white', up.col='lightgreen', dn.col='pink'), type='bar')
 plot(addSMA(n=10,col='darkgreen', on=1))
 
 getTxns(Portfolio="longtrend", Symbol="GSPC", Date="2000::2004")

Modified: pkg/blotter/demo/turtles.R
===================================================================
--- pkg/blotter/demo/turtles.R	2010-01-30 13:30:29 UTC (rev 220)
+++ pkg/blotter/demo/turtles.R	2010-02-01 13:10:00 UTC (rev 221)
@@ -174,7 +174,7 @@
   Sells = Portfolio[["XLF"]]$txn$Txn.Price*(Portfolio[["XLF"]]$txn[,'Txn.Qty']<0)
   Position = Portfolio[["XLF"]]$posPL[,'Pos.Qty']
   CumPL = cumsum(Portfolio[["XLF"]]$posPL[,'Trading.PL'])
-  chartSeries(XLF['2008::2009',], TA=NULL, type='bar', theme=chartTheme('white',up.col='lightgreen',dn.col='pink'))
+  chartSeries(XLF['2008::2009',], TA=NULL, type='bar', theme=chartTheme("white",up.col='lightgreen',dn.col='pink'))
   plot(addTA(Buys['2008::2009',],pch=2,type='p',col='darkgreen', on=1));
   plot(addTA(Sells['2008::2009',],pch=6,type='p',col='darkred', on=1));
   plot(addTA(Position['2008::2009',],type='h',col='blue', lwd=2));



More information about the Blotter-commits mailing list