[Blotter-commits] r545 - pkg/blotter/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Jan 28 15:49:53 CET 2011
Author: braverock
Date: 2011-01-28 15:49:53 +0100 (Fri, 28 Jan 2011)
New Revision: 545
Modified:
pkg/blotter/R/tradeStats.R
Log:
- use last(Equity) for TotalNetProfit
Modified: pkg/blotter/R/tradeStats.R
===================================================================
--- pkg/blotter/R/tradeStats.R 2011-01-27 23:54:23 UTC (rev 544)
+++ pkg/blotter/R/tradeStats.R 2011-01-28 14:49:53 UTC (rev 545)
@@ -79,7 +79,6 @@
PL.lt0 <- txn$Net.Txn.Realized.PL[txn$Net.Txn.Realized.PL < 0]
PL.ne0 <- txn$Net.Txn.Realized.PL[txn$Net.Txn.Realized.PL != 0]
if(!nrow(PL.ne0))next()
- TotalNetProfit <- sum(txn$Net.Txn.Realized.PL)
GrossProfits <- sum(PL.gt0)
GrossLosses <- sum(PL.lt0)
@@ -111,7 +110,8 @@
StdDailyPL <- as.numeric(sd(DailyPL))
Equity <- cumsum(posPL$Net.Trading.PL)
- Equity.max <- cummax(Equity)
+ TotalNetProfit <- last(Equity)
+ Equity.max <- cummax(Equity)
maxEquity <- max(Equity)
minEquity <- min(Equity)
endEquity <- last(Equity)
More information about the Blotter-commits
mailing list