[Blotter-commits] r181 - pkg/blotter/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Jan 18 20:03:34 CET 2010
Author: braverock
Date: 2010-01-18 20:03:34 +0100 (Mon, 18 Jan 2010)
New Revision: 181
Modified:
pkg/blotter/R/chart.Posn.R
Log:
- strip first dummy Buy/Sell
Modified: pkg/blotter/R/chart.Posn.R
===================================================================
--- pkg/blotter/R/chart.Posn.R 2010-01-18 18:29:49 UTC (rev 180)
+++ pkg/blotter/R/chart.Posn.R 2010-01-18 19:03:34 UTC (rev 181)
@@ -40,9 +40,9 @@
tzero = xts(0,order.by=index(Prices[1,]))
Trades = Portfolio[[Symbol]]$txn$Txn.Price*Portfolio[[Symbol]]$txn$Txn.Qty
Buys = Portfolio[[Symbol]]$txn$Txn.Price[which(Trades>0)]
- Buys = align.time(rbind(Buys,tzero),mult)[-1]
+ Buys = align.time(rbind(Buys,tzero),n)[-1]
Sells = Portfolio[[Symbol]]$txn$Txn.Price[which(Trades<0)]
- Sells = align.time(rbind(Sells,tzero),mult)[-1]
+ Sells = align.time(rbind(Sells,tzero),n)[-1]
#Position = Portfolio[[Symbol]]$posPL$Pos.Qty # use $txn instead, and make it match the prices index
Position = Portfolio[[Symbol]]$txn$Pos.Qty
Position = na.locf(merge(Position,index(Prices)))
More information about the Blotter-commits
mailing list