SCM

SCM Repository

[blotter] Diff of /pkg/quantstrat/demo/faberMC.R
ViewVC logotype

Diff of /pkg/quantstrat/demo/faberMC.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 450, Sat Nov 13 18:30:40 2010 UTC revision 621, Thu Jun 9 23:18:04 2011 UTC
# Line 46  Line 46 
46  require(quantstrat)  require(quantstrat)
47    
48  # Try to clean up in case the demo was run previously  # Try to clean up in case the demo was run previously
49  try(rm("account.faber","portfolio.faber",pos=.blotter),silent=TRUE)  suppressWarnings(rm("account.faber","account.faberMC","portfolio.faber","portfolio.combMC",
50  try(rm("ltaccount","ltportfolio","ClosePrice","CurrentDate","equity","stratFaber","initDate","initEq","Posn","UnitSize","verbose"),silent=TRUE)                          "portfolio.GDAXI", "portfolio.GSPC", "portfolio.N225",pos=.blotter))
51  try(rm("order_book.faber",pos=.strategy),silent=TRUE)  suppressWarnings(rm("ltaccount","ltportfolio","ClosePrice","CurrentDate","equity","stratFaber","initDate","initEq","Posn","UnitSize","verbose"))
52    suppressWarnings(rm("order_book.faber","order_book.combMC", "order_book.GDAXI", "order_book.GSPC", "order_book.N225", pos=.strategy))
53    
54  # Set initial values  # Set initial values
55  initDate='2007-01-01'  initDate='2000-01-01'
56  initEq=100000  initEq=100000
57    
58  # Set up instruments with FinancialInstruments package  # Set up instruments with FinancialInstruments package
59  symbols = c("SPX", "^N225", "^GDAXI")  symbols = c("^GSPC", "^N225", "^GDAXI")
60    
61  currency("USD")  currency("USD")
62  currency("JPY")  currency("JPY")
# Line 69  Line 70 
70    
71  getSymbols(symbols,from=initDate)  getSymbols(symbols,from=initDate)
72  #takes out the carat  #takes out the carat
73  symbols = c("SPX", "N225", "GDAXI")  symbols = c("GSPC", "N225", "GDAXI")
74    
75    
76  stock(symbols[1], currency="USD",multiplier=1)  stock(symbols[1], currency="USD",multiplier=1)

Legend:
Removed from v.450  
changed lines
  Added in v.621

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge