[Blotter-commits] r380 - in pkg/blotter: . tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Aug 23 19:45:00 CEST 2010


Author: braverock
Date: 2010-08-23 19:45:00 +0200 (Mon, 23 Aug 2010)
New Revision: 380

Removed:
   pkg/blotter/tests/txnFee.R
   pkg/blotter/tests/txnFee.Rout.save
Modified:
   pkg/blotter/DESCRIPTION
Log:
- increment version
- remove obsolete tests

Modified: pkg/blotter/DESCRIPTION
===================================================================
--- pkg/blotter/DESCRIPTION	2010-08-23 15:44:54 UTC (rev 379)
+++ pkg/blotter/DESCRIPTION	2010-08-23 17:45:00 UTC (rev 380)
@@ -1,7 +1,7 @@
 Package: blotter
 Type: Package
 Title: Tools for transaction-oriented trading systems development.
-Version: 0.6
+Version: 0.7
 Date: $Date$
 Author: Peter Carl, Brian G. Peterson, Joshua Ulrich
 Maintainer: Brian G. Peterson <brian at braverock.com>

Deleted: pkg/blotter/tests/txnFee.R
===================================================================
--- pkg/blotter/tests/txnFee.R	2010-08-23 15:44:54 UTC (rev 379)
+++ pkg/blotter/tests/txnFee.R	2010-08-23 17:45:00 UTC (rev 380)
@@ -1,30 +0,0 @@
-
-suppressMessages(library(blotter))	# to suppress the TZ noise from xts
-library(quantmod)
-Sys.setenv(TZ="America/Chicago")        # as the data set got save with this TZ
-options("width"=78)                     # to tie down the print() statement width
-verbose <- FALSE
-data(IBM)                               # data included in package
-symbols <- c("IBM")
-
-## simple portfolio with one transaction
-p1 <- initPortf(symbols=symbols)
-p1 <- addTxn(p1, "IBM", '2007-01-04', 100, 96.5, 0.05*100, verbose)
-p1 <- updatePortf(p1,'2007-01-03/2007-01-10')
-a1 <- initAcct(portfolios="p1")
-a1 <- updateAcct(a1,'2007-01')
-a1 <- updateEndEq(a1,'2007-01')
-
-## (really) simple transaction cost function
-fiveCents <- function(qty, prc) return(0.05*qty)
-p2 <- initPortf(symbols=symbols)
-p2 <- addTxn(p2, "IBM", '2007-01-04', 100, 96.5, fiveCents, verbose)
-p2 <- updatePortf(p2,'2007-01-03::2007-01-10')
-a2 <- initAcct(portfolios="p2")
-a2 <- updateAcct(a2,'2007-01')
-a2 <- updateEndEq(a2,'2007-01')
-
-print(a1)
-print(a2)
-#print(all.equal(a1, a2))	## cannot be equal because of names(): p1 != p2
-print(all.equal(p1, p2))

Deleted: pkg/blotter/tests/txnFee.Rout.save
===================================================================
--- pkg/blotter/tests/txnFee.Rout.save	2010-08-23 15:44:54 UTC (rev 379)
+++ pkg/blotter/tests/txnFee.Rout.save	2010-08-23 17:45:00 UTC (rev 380)
@@ -1,127 +0,0 @@
-
-R version 2.9.0 Under development (unstable) (2009-03-02 r48041)
-Copyright (C) 2009 The R Foundation for Statistical Computing
-ISBN 3-900051-07-0
-
-R is free software and comes with ABSOLUTELY NO WARRANTY.
-You are welcome to redistribute it under certain conditions.
-Type 'license()' or 'licence()' for distribution details.
-
-R is a collaborative project with many contributors.
-Type 'contributors()' for more information and
-'citation()' on how to cite R or R packages in publications.
-
-Type 'demo()' for some demos, 'help()' for on-line help, or
-'help.start()' for an HTML browser interface to help.
-Type 'q()' to quit R.
-
-> 
-> suppressMessages(library(blotter))	# to suppress the TZ noise from xts
-> library(quantmod)
-Loading required package: Defaults
-quantmod: Quantitative Financial Modelling Framework
-
-Version 0.3-7, Revision 461
-http://www.quantmod.com
-
-> Sys.setenv(TZ="America/Chicago")        # as the data set got save with this TZ
-> options("width"=78)                     # to tie down the print() statement width
-> verbose <- FALSE
-> data(IBM)                               # data included in package
-> symbols <- c("IBM")
-> 
-> ## simple portfolio with one transaction
-> p1 <- initPortf(symbols=symbols)
-> p1 <- addTxn(p1, "IBM", '2007-01-04', 100, 96.5, 0.05*100, verbose)
-> p1 <- updatePortf(p1,'2007-01-03','2007-01-10')
-> a1 <- initAcct(portfolios="p1")
-> a1 <- updateAcct(a1,'2007-01')
-> a1 <- updateEndEq(a1,'2007-01')
-> 
-> ## (really) simple transaction cost function
-> fiveCents <- function(qty, prc) return(0.05*qty)
-> p2 <- initPortf(symbols=symbols)
-> p2 <- addTxn(p2, "IBM", '2007-01-04', 100, 96.5, fiveCents, verbose)
-> p2 <- updatePortf(p2,'2007-01-03','2007-01-10')
-> a2 <- initAcct(portfolios="p2")
-> a2 <- updateAcct(a2,'2007-01')
-> a2 <- updateEndEq(a2,'2007-01')
-> 
-> print(a1)
-$TOTAL
-           Additions Withdrawals Txn.Fees Realized.PL Unrealized.PL
-1950-01-01         0           0        0           0             0
-2007-01-03         0           0        0           0             0
-2007-01-04         0           0        5           0           186
-2007-01-05         0           0        0           0           -89
-2007-01-08         0           0        0           0           148
-2007-01-09         0           0        0           0           117
-2007-01-10         0           0        0           0          -118
-           Int.Income Trading.PL Advisory.Fees Net.Performance End.Eq
-1950-01-01          0          0             0               0 100000
-2007-01-03          0          0             0               0 100000
-2007-01-04          0        186             0             186 100186
-2007-01-05          0        -89             0             -89 100097
-2007-01-08          0        148             0             148 100245
-2007-01-09          0        117             0             117 100362
-2007-01-10          0       -118             0            -118 100244
-
-$p1
-           Long.Value Short.Value Net.Value Gross.Value Txn.Fees Realized.PL
-1950-01-01          0           0         0           0        0           0
-2007-01-03          0           0         0           0        0           0
-2007-01-04       9831           0      9831        9831        5           0
-2007-01-05       9742           0      9742        9742        0           0
-2007-01-08       9890           0      9890        9890        0           0
-2007-01-09      10007           0     10007       10007        0           0
-2007-01-10       9889           0      9889        9889        0           0
-           Unrealized.PL Trading.PL
-1950-01-01             0          0
-2007-01-03             0          0
-2007-01-04           186        186
-2007-01-05           -89        -89
-2007-01-08           148        148
-2007-01-09           117        117
-2007-01-10          -118       -118
-
-> print(a2)
-$TOTAL
-           Additions Withdrawals Txn.Fees Realized.PL Unrealized.PL
-1950-01-01         0           0        0           0             0
-2007-01-03         0           0        0           0             0
-2007-01-04         0           0        5           0           186
-2007-01-05         0           0        0           0           -89
-2007-01-08         0           0        0           0           148
-2007-01-09         0           0        0           0           117
-2007-01-10         0           0        0           0          -118
-           Int.Income Trading.PL Advisory.Fees Net.Performance End.Eq
-1950-01-01          0          0             0               0 100000
-2007-01-03          0          0             0               0 100000
-2007-01-04          0        186             0             186 100186
-2007-01-05          0        -89             0             -89 100097
-2007-01-08          0        148             0             148 100245
-2007-01-09          0        117             0             117 100362
-2007-01-10          0       -118             0            -118 100244
-
-$p2
-           Long.Value Short.Value Net.Value Gross.Value Txn.Fees Realized.PL
-1950-01-01          0           0         0           0        0           0
-2007-01-03          0           0         0           0        0           0
-2007-01-04       9831           0      9831        9831        5           0
-2007-01-05       9742           0      9742        9742        0           0
-2007-01-08       9890           0      9890        9890        0           0
-2007-01-09      10007           0     10007       10007        0           0
-2007-01-10       9889           0      9889        9889        0           0
-           Unrealized.PL Trading.PL
-1950-01-01             0          0
-2007-01-03             0          0
-2007-01-04           186        186
-2007-01-05           -89        -89
-2007-01-08           148        148
-2007-01-09           117        117
-2007-01-10          -118       -118
-
-> #print(all.equal(a1, a2))	## cannot be equal because of names(): p1 != p2
-> print(all.equal(p1, p2))
-[1] TRUE
-> 



More information about the Blotter-commits mailing list