[Blotter-commits] r1194 - pkg/quantstrat/demo

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Sep 23 13:48:26 CEST 2012


Author: braverock
Date: 2012-09-23 13:48:25 +0200 (Sun, 23 Sep 2012)
New Revision: 1194

Modified:
   pkg/quantstrat/demo/bbandParameters.R
   pkg/quantstrat/demo/bbands.R
   pkg/quantstrat/demo/faber.R
   pkg/quantstrat/demo/faberMC.R
   pkg/quantstrat/demo/maCross.R
   pkg/quantstrat/demo/macd.R
   pkg/quantstrat/demo/pair_trade.R
   pkg/quantstrat/demo/rsi.R
Log:
- update copyrights

Modified: pkg/quantstrat/demo/bbandParameters.R
===================================================================
--- pkg/quantstrat/demo/bbandParameters.R	2012-09-21 02:12:27 UTC (rev 1193)
+++ pkg/quantstrat/demo/bbandParameters.R	2012-09-23 11:48:25 UTC (rev 1194)
@@ -49,4 +49,16 @@
 
 testPackList<-applyParameter(strategy=stratBBands,portfolios=portfolio.st,parameterPool=tPD,method='random',sampleSize=2,parameterConstraints=pConstraint)
 
+###############################################################################
+# R (http://r-project.org/) Quantitative Strategy Model Framework
+#
+# Copyright (c) 2009-2012
+# Peter Carl, Dirk Eddelbuettel, Brian G. Peterson, Jeffrey Ryan, and Joshua Ulrich 
+#
+# This library is distributed under the terms of the GNU Public License (GPL)
+# for full details see the file COPYING
+#
+# $Id: bbands.R 1097 2012-07-01 00:30:39Z braverock $
+#
+###############################################################################
 

Modified: pkg/quantstrat/demo/bbands.R
===================================================================
--- pkg/quantstrat/demo/bbands.R	2012-09-21 02:12:27 UTC (rev 1193)
+++ pkg/quantstrat/demo/bbands.R	2012-09-23 11:48:25 UTC (rev 1194)
@@ -68,7 +68,7 @@
 ###############################################################################
 # R (http://r-project.org/) Quantitative Strategy Model Framework
 #
-# Copyright (c) 2009-2010
+# Copyright (c) 2009-2012
 # Peter Carl, Dirk Eddelbuettel, Brian G. Peterson, Jeffrey Ryan, and Joshua Ulrich 
 #
 # This library is distributed under the terms of the GNU Public License (GPL)

Modified: pkg/quantstrat/demo/faber.R
===================================================================
--- pkg/quantstrat/demo/faber.R	2012-09-21 02:12:27 UTC (rev 1193)
+++ pkg/quantstrat/demo/faber.R	2012-09-23 11:48:25 UTC (rev 1194)
@@ -145,7 +145,7 @@
 ###############################################################################
 # R (http://r-project.org/) Quantitative Strategy Model Framework
 #
-# Copyright (c) 2009-2010
+# Copyright (c) 2009-2012
 # Peter Carl, Dirk Eddelbuettel, Brian G. Peterson,
 # Jeffrey Ryan, Joshua Ulrich, and Garrett See
 #

Modified: pkg/quantstrat/demo/faberMC.R
===================================================================
--- pkg/quantstrat/demo/faberMC.R	2012-09-21 02:12:27 UTC (rev 1193)
+++ pkg/quantstrat/demo/faberMC.R	2012-09-23 11:48:25 UTC (rev 1194)
@@ -151,7 +151,7 @@
 ###############################################################################
 # R (http://r-project.org/) Quantitative Strategy Model Framework
 #
-# Copyright (c) 2009-2010
+# Copyright (c) 2009-2012
 # Peter Carl, Dirk Eddelbuettel, Brian G. Peterson, 
 # Jeffrey Ryan, Joshua Ulrich, and Garrett See
 #

Modified: pkg/quantstrat/demo/maCross.R
===================================================================
--- pkg/quantstrat/demo/maCross.R	2012-09-21 02:12:27 UTC (rev 1193)
+++ pkg/quantstrat/demo/maCross.R	2012-09-23 11:48:25 UTC (rev 1194)
@@ -11,7 +11,7 @@
 stock.str='AAPL' # what are we trying it on
 currency('USD')
 stock(stock.str,currency='USD',multiplier=1)
-initDate='1999-12-31'
+initDate='2005-12-31'
 initEq=1000000
 portfolio.st='macross'
 account.st='macross'
@@ -57,7 +57,7 @@
 ###############################################################################
 # R (http://r-project.org/) Quantitative Strategy Model Framework
 #
-# Copyright (c) 2009-2010
+# Copyright (c) 2009-2012
 # Peter Carl, Dirk Eddelbuettel, Brian G. Peterson,
 # Jeffrey Ryan, Joshua Ulrich, and Garrett See
 #

Modified: pkg/quantstrat/demo/macd.R
===================================================================
--- pkg/quantstrat/demo/macd.R	2012-09-21 02:12:27 UTC (rev 1193)
+++ pkg/quantstrat/demo/macd.R	2012-09-23 11:48:25 UTC (rev 1194)
@@ -72,7 +72,7 @@
 
 getSymbols(stock.str,from=initDate)
 start_t<-Sys.time()
-out<-try(applyStrategy(strat.st , portfolios=portfolio.st,parameters=list(nFast=fastMA, nSlow=slowMA, nSig=signalMA,maType=maType)))
+out<-applyStrategy(strat.st , portfolios=portfolio.st,parameters=list(nFast=fastMA, nSlow=slowMA, nSig=signalMA,maType=maType),verbose=TRUE)
 end_t<-Sys.time()
 print(end_t-start_t)
 
@@ -91,7 +91,7 @@
 ###############################################################################
 # R (http://r-project.org/) Quantitative Strategy Model Framework
 #
-# Copyright (c) 2009-2010
+# Copyright (c) 2009-2012
 # Peter Carl, Dirk Eddelbuettel, Brian G. Peterson, Jeffrey Ryan, and Joshua Ulrich 
 #
 # This library is distributed under the terms of the GNU Public License (GPL)

Modified: pkg/quantstrat/demo/pair_trade.R
===================================================================
--- pkg/quantstrat/demo/pair_trade.R	2012-09-21 02:12:27 UTC (rev 1193)
+++ pkg/quantstrat/demo/pair_trade.R	2012-09-23 11:48:25 UTC (rev 1194)
@@ -202,7 +202,7 @@
 ###############################################################################
 # R (http://r-project.org/) Quantitative Strategy Model Framework
 #
-# Package Copyright (c) 2009-2010
+# Package Copyright (c) 2009-2012
 # Peter Carl, Dirk Eddelbuettel, Brian G. Peterson, Jeffrey Ryan, and Joshua Ulrich 
 #
 # This library is distributed under the terms of the GNU Public License (GPL)

Modified: pkg/quantstrat/demo/rsi.R
===================================================================
--- pkg/quantstrat/demo/rsi.R	2012-09-21 02:12:27 UTC (rev 1193)
+++ pkg/quantstrat/demo/rsi.R	2012-09-23 11:48:25 UTC (rev 1194)
@@ -5,6 +5,8 @@
 # Initialize a strategy object
 stratRSI <- strategy("RSI")
 
+n=2
+
 # Add an indicator
 stratRSI <- add.indicator(strategy = stratRSI, name = "RSI", arguments = list(price = quote(getPrice(mktdata))), label="RSI")
 
@@ -79,10 +81,19 @@
     plot(add_RSI(n=2))
 }
 
+ret1 <- PortfReturns(account.st)
+ret1$total <- rowSums(ret1)
+#ret1
+
+if("package:PerformanceAnalytics" %in% search() || require("PerformanceAnalytics",quietly=TRUE)) {
+    dev.new()
+    charts.PerformanceSummary(ret1$total,geometric=FALSE,wealth.index=TRUE)
+}
+
 ###############################################################################
 # R (http://r-project.org/) Quantitative Strategy Model Framework
 #
-# Copyright (c) 2009-2010
+# Copyright (c) 2009-2012
 # Peter Carl, Dirk Eddelbuettel, Brian G. Peterson, Jeffrey Ryan, and Joshua Ulrich 
 #
 # This library is distributed under the terms of the GNU Public License (GPL)



More information about the Blotter-commits mailing list