[Blotter-commits] r87 - pkg/demo

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon May 11 02:42:10 CEST 2009


Author: peter_carl
Date: 2009-05-11 02:42:10 +0200 (Mon, 11 May 2009)
New Revision: 87

Modified:
   pkg/demo/turtles.R
Log:
- changed the interface for updatePortf, thanks Josh Ulrich


Modified: pkg/demo/turtles.R
===================================================================
--- pkg/demo/turtles.R	2009-04-15 03:40:47 UTC (rev 86)
+++ pkg/demo/turtles.R	2009-05-11 00:42:10 UTC (rev 87)
@@ -37,10 +37,10 @@
 print("Initializing portfolio and account structure")
 # Assemble a small portfolio of three stocks
 symbols = c("XLY", "XLP", "XLE", "XLF", "XLV", "XLI", "XLB", "XLK", "XLU")
-getSymbols(symbols, from=initDate, source="yahoo")
+# getSymbols(symbols, from=initDate, source="yahoo")
 
 # Set up a portfolio object and an account object
-portfolio = initPortf(symbols)
+portfolio = initPortf(symbols, initDate=initDate)
 account = initAcct(portfolios="portfolio", initDate=initDate)
 
 # This table stores transaction-related information relative to the strategy
@@ -147,7 +147,7 @@
     # Maintain Position
   } # End symbol loop
   # Now that we've updated all of our trades, its time to mark the book
-  portfolio = updatePortf(Portfolio = portfolio, StartDate = CurrentDate, EndDate = CurrentDate)
+  portfolio = updatePortf(Portfolio = portfolio, Dates = CurrentDate)
   account = updateAcct(Account = account, Dates = CurrentDate)
   account = updateEndEq(Account = account, Dates = CurrentDate)
 } # End dates loop



More information about the Blotter-commits mailing list