[Blotter-commits] r65 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Mar 11 15:22:19 CET 2009
Author: peter_carl
Date: 2009-03-11 15:22:19 +0100 (Wed, 11 Mar 2009)
New Revision: 65
Modified:
pkg/R/calcPortfAttr.R
Log:
- removed abs() from aggregation calcs where incorrect
Modified: pkg/R/calcPortfAttr.R
===================================================================
--- pkg/R/calcPortfAttr.R 2009-03-06 16:44:48 UTC (rev 64)
+++ pkg/R/calcPortfAttr.R 2009-03-11 14:22:19 UTC (rev 65)
@@ -16,22 +16,22 @@
},
Txn.Fees = {
table = getBySymbol(Portfolio = Portfolio, Attribute = 'Txn.Fees', Date = Date, Symbols = Symbols)
- result = xts(rowSums(abs(table)), Date)
+ result = xts(rowSums(table), Date)
colnames(result) = 'Txn.Fees'
},
Realized.PL = {
table = getBySymbol(Portfolio = Portfolio, Attribute = 'Realized.PL', Date = Date, Symbols = Symbols)
- result = xts(rowSums(abs(table)), Date)
+ result = xts(rowSums(table), Date)
colnames(result) = 'Realized.PL'
},
Unrealized.PL = {
table = getBySymbol(Portfolio = Portfolio, Attribute = 'Unrealized.PL', Date = Date, Symbols = Symbols)
- result = xts(rowSums(abs(table)), Date)
+ result = xts(rowSums(table), Date)
colnames(result) = 'Unrealized.PL'
},
Net.Value = {
table = getBySymbol(Portfolio = Portfolio, Attribute = 'Pos.Value', Date = Date, Symbols = Symbols)
- result = xts(rowSums(abs(table)), Date)
+ result = xts(rowSums(table), Date)
colnames(result) = 'Net.Value'
},
Gross.Value = {
@@ -42,13 +42,13 @@
Long.Value = {
table = getBySymbol(Portfolio = Portfolio, Attribute = 'Pos.Value', Date = Date, Symbols = Symbols)
table = apply(table,MARGIN=c(1,2),FUN=max,0)
- result = xts(rowSums(abs(table)), Date)
+ result = xts(rowSums(table), Date)
colnames(result) = 'Long.Value'
},
Short.Value = {
table = getBySymbol(Portfolio = Portfolio, Attribute = 'Pos.Value', Date = Date, Symbols = Symbols)
table = apply(table,MARGIN=c(1,2),FUN=min,0) # comes out a matrix
- result = xts(rowSums(abs(table)), Date)
+ result = xts(rowSums(table), Date)
colnames(result) = 'Short.Value'
}
)
More information about the Blotter-commits
mailing list