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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 23 23:59:52 CET 2014


Author: bodanker
Date: 2014-01-23 23:59:52 +0100 (Thu, 23 Jan 2014)
New Revision: 1584

Modified:
   pkg/blotter/R/chart.Posn.R
Log:
- Make chart.Posn work with only one transaction. Reported by Mark Knecht.


Modified: pkg/blotter/R/chart.Posn.R
===================================================================
--- pkg/blotter/R/chart.Posn.R	2014-01-16 12:36:14 UTC (rev 1583)
+++ pkg/blotter/R/chart.Posn.R	2014-01-23 22:59:52 UTC (rev 1584)
@@ -50,7 +50,7 @@
 
     Position = Portfolio$symbols[[Symbol]]$txn$Pos.Qty
 
-    if(!nrow(Position)>1) stop ('no transactions/positions to chart')
+    if(nrow(Position)<1) stop ('no transactions/positions to chart')
 
     if(as.POSIXct(first(index(Prices)))<as.POSIXct(first(index(Position)))) Position<-rbind(xts(0,order.by=first(index(Prices)-1)),Position)
     Positionfill = na.locf(merge(Position,index(Prices)))



More information about the Blotter-commits mailing list