[Blotter-commits] r1626 - pkg/blotter/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Jul 27 10:31:43 CEST 2014
Author: bodanker
Date: 2014-07-27 10:31:43 +0200 (Sun, 27 Jul 2014)
New Revision: 1626
Modified:
pkg/blotter/R/perTradeStats.R
Log:
- Fix bug in perTradeStats introduced during r1597 refactor
Modified: pkg/blotter/R/perTradeStats.R
===================================================================
--- pkg/blotter/R/perTradeStats.R 2014-07-27 00:54:14 UTC (rev 1625)
+++ pkg/blotter/R/perTradeStats.R 2014-07-27 08:31:43 UTC (rev 1626)
@@ -123,7 +123,7 @@
Pos.PL <- trade[,"Pos.Value"]-Pos.Cost.Basis
Pct.PL <- Pos.PL/abs(Pos.Cost.Basis) # broken for last timestamp (fixed below)
Tick.PL <- Pos.PL/abs(Pos.Qty)/tick_value # broken for last timestamp (fixed below)
- Max.Pos.Qty.loc <- which.max(Pos.Qty) # find max position quantity location
+ Max.Pos.Qty.loc <- which.max(abs(Pos.Qty)) # find max position quantity location
# position sizes
trades$Init.Pos[i] <- Pos.Qty[1]
More information about the Blotter-commits
mailing list