[Blotter-commits] r276 - pkg/blotter/demo

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Mar 1 17:07:56 CET 2010


Author: braverock
Date: 2010-03-01 17:07:56 +0100 (Mon, 01 Mar 2010)
New Revision: 276

Modified:
   pkg/blotter/demo/amzn_test.R
   pkg/blotter/demo/longtrend.R
   pkg/blotter/demo/turtles.R
Log:
- set initEq in demos, props to Mark Breman for the patch

Modified: pkg/blotter/demo/amzn_test.R
===================================================================
--- pkg/blotter/demo/amzn_test.R	2010-03-01 13:17:36 UTC (rev 275)
+++ pkg/blotter/demo/amzn_test.R	2010-03-01 16:07:56 UTC (rev 276)
@@ -9,7 +9,7 @@
 stock("amzn",currency="USD",multiplier=1)
 # Initialize the Portfolio
 initPortf("amzn_port",symbols="amzn",initDate="2010-01-14")
-initAcct("amzn_acct",portfolios="amzn_port",initDate="2010-01-14")
+initAcct("amzn_acct",portfolios="amzn_port",initDate="2010-01-14", initEq=10000)
 # look at the transactions data
 amzn.trades
 # Add the transactions to the portfolio

Modified: pkg/blotter/demo/longtrend.R
===================================================================
--- pkg/blotter/demo/longtrend.R	2010-03-01 13:17:36 UTC (rev 275)
+++ pkg/blotter/demo/longtrend.R	2010-03-01 16:07:56 UTC (rev 276)
@@ -71,8 +71,9 @@
 print("Initializing portfolio and account structure")
 ltportfolio='longtrend'
 ltaccount='longtrend'
+
 initPortf(ltportfolio,'GSPC', initDate=initDate)
-initAcct(ltaccount,portfolios='longtrend', initDate=initDate)
+initAcct(ltaccount,portfolios='longtrend', initDate=initDate, initEq=initEq)
 verbose=TRUE
 
 # Create trades

Modified: pkg/blotter/demo/turtles.R
===================================================================
--- pkg/blotter/demo/turtles.R	2010-03-01 13:17:36 UTC (rev 275)
+++ pkg/blotter/demo/turtles.R	2010-03-01 16:07:56 UTC (rev 276)
@@ -50,7 +50,7 @@
 portfolio = "turtles" 
 initPortf(name=portfolio,symbols, initDate=initDate)
 account = "turtles"
-initAcct(name=account,portfolios="turtles", initDate=initDate)
+initAcct(name=account,portfolios="turtles", initDate=initDate, initEq=initEq)
 
 # This table stores transaction-related information relative to the strategy
 # Placing it into the portfolio object, sure why not?



More information about the Blotter-commits mailing list