[Blotter-commits] r540 - pkg/blotter/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Jan 24 21:41:57 CET 2011
Author: braverock
Date: 2011-01-24 21:41:56 +0100 (Mon, 24 Jan 2011)
New Revision: 540
Modified:
pkg/blotter/R/tradeStats.R
Log:
- add total number of days, winning/losing days
Modified: pkg/blotter/R/tradeStats.R
===================================================================
--- pkg/blotter/R/tradeStats.R 2011-01-24 20:28:15 UTC (rev 539)
+++ pkg/blotter/R/tradeStats.R 2011-01-24 20:41:56 UTC (rev 540)
@@ -286,7 +286,8 @@
StdDayPL <- as.numeric(sd(PL.ne0))
#NumberOfDays <- nrow(txn)
-
+ WinDays <-length(PL.gt0)
+ LossDays<-length(PL.ne0)
PercentPositive <- (length(PL.gt0)/length(PL.ne0))*100
PercentNegative <- (length(PL.lt0)/length(PL.ne0))*100
@@ -315,6 +316,9 @@
tmpret <- data.frame(
Total.Net.Profit=TotalNetProfit,
+ Total.Days=length(x),
+ Winning.Days=WinDays,
+ Losing.Days=LossDays,
Avg.Day.PL=AvgDayPL,
Med.Day.PL=MedDayPL,
Largest.Winner=MaxWin,
More information about the Blotter-commits
mailing list