[Blotter-commits] r1515 - pkg/quantstrat/R pkg/quantstrat/demo pkg/quantstrat/inst/extdata www www/data www/data/ES

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Oct 3 10:11:21 CEST 2013


Author: erastus
Date: 2013-10-03 10:11:20 +0200 (Thu, 03 Oct 2013)
New Revision: 1515

Added:
   pkg/quantstrat/inst/extdata/luxor.RData
   www/data/
   www/data/ES/
   www/data/ES/2011.01.02.ES.rda
   www/data/ES/2011.01.03.ES.rda
   www/data/ES/2011.01.04.ES.rda
   www/data/ES/2011.01.05.ES.rda
   www/data/ES/2011.01.06.ES.rda
   www/data/ES/2011.01.07.ES.rda
   www/data/ES/2011.01.09.ES.rda
   www/data/ES/2011.01.10.ES.rda
   www/data/ES/2011.01.11.ES.rda
   www/data/ES/2011.01.12.ES.rda
   www/data/ES/2011.01.13.ES.rda
   www/data/ES/2011.01.14.ES.rda
   www/data/ES/2011.01.16.ES.rda
   www/data/ES/2011.01.17.ES.rda
   www/data/ES/2011.01.18.ES.rda
   www/data/ES/2011.01.19.ES.rda
   www/data/ES/2011.01.20.ES.rda
   www/data/ES/2011.01.21.ES.rda
   www/data/ES/2011.01.23.ES.rda
   www/data/ES/2011.01.24.ES.rda
   www/data/ES/2011.01.25.ES.rda
   www/data/ES/2011.01.26.ES.rda
   www/data/ES/2011.01.27.ES.rda
   www/data/ES/2011.01.28.ES.rda
   www/data/ES/2011.01.30.ES.rda
   www/data/ES/2011.01.31.ES.rda
Modified:
   pkg/quantstrat/R/walk.forward.R
   pkg/quantstrat/demo/luxor.1.strategy.basic.R
   pkg/quantstrat/demo/luxor.2.add.paramsets.R
   pkg/quantstrat/demo/luxor.3.paramset.sma.R
   pkg/quantstrat/demo/luxor.4.paramset.timespan.R
   pkg/quantstrat/demo/luxor.5.strategy.ordersets.R
   pkg/quantstrat/demo/luxor.6.paramset.stoploss.R
   pkg/quantstrat/demo/luxor.6.paramset.stoptrailing.R
   pkg/quantstrat/demo/luxor.6.paramset.takeprofit.R
   pkg/quantstrat/demo/luxor.7.exit+risk.R
   pkg/quantstrat/demo/luxor.sample.tradeGraphs.sma.R
   pkg/quantstrat/demo/luxor.sample.tradeGraphs.timespan.R
   pkg/quantstrat/demo/pair_trade.R
Log:
- luxor source/load path wrangling, moved ES data for forthcoming load()ing via http, other small fixes

Modified: pkg/quantstrat/R/walk.forward.R
===================================================================
--- pkg/quantstrat/R/walk.forward.R	2013-10-01 19:58:39 UTC (rev 1514)
+++ pkg/quantstrat/R/walk.forward.R	2013-10-03 08:11:20 UTC (rev 1515)
@@ -69,7 +69,7 @@
     results <- list()
 
     # assuming that timespans for all portfolio symbols are same, so ok to use 1st symbol to calculate end points
-    symbol.st <- names(portfolio$symbols)[1]
+    symbol.st <- first(ls(portfolio$symbols))
     symbol <- get(symbol.st)
 
     ep <- endpoints(symbol, on=period)

Modified: pkg/quantstrat/demo/luxor.1.strategy.basic.R
===================================================================
--- pkg/quantstrat/demo/luxor.1.strategy.basic.R	2013-10-01 19:58:39 UTC (rev 1514)
+++ pkg/quantstrat/demo/luxor.1.strategy.basic.R	2013-10-03 08:11:20 UTC (rev 1515)
@@ -8,6 +8,10 @@
 #
 # Paragraph 3.2: luxor with slippage and transaction costs
 
+require(quantstrat)
+
+require(quantstrat)
+
 ##### PLACE DEMO AND TEST DATES HERE #################
 #
 #if(isTRUE(options('in_test')$in_test))
@@ -19,11 +23,11 @@
 #  {initDate="1999-12-31"
 #  endDate=Sys.Date()}
 
-source('luxor.include.R')
+source(paste0(path.package("quantstrat"),"/demo/luxor.include.R"))
 .fast = 10
 .slow = 30
 
-source('luxor.getSymbols.R')
+source(paste0(path.package("quantstrat"),"/demo/luxor.getSymbols.R"))
 
 ### blotter
 

Modified: pkg/quantstrat/demo/luxor.2.add.paramsets.R
===================================================================
--- pkg/quantstrat/demo/luxor.2.add.paramsets.R	2013-10-01 19:58:39 UTC (rev 1514)
+++ pkg/quantstrat/demo/luxor.2.add.paramsets.R	2013-10-03 08:11:20 UTC (rev 1515)
@@ -19,7 +19,7 @@
 #  {initDate="1999-12-31"
 #  endDate=Sys.Date()}
 
-source('luxor.include.R')
+source(paste0(path.package("quantstrat"),"/demo/luxor.include.R"))
 
 ###
 

Modified: pkg/quantstrat/demo/luxor.3.paramset.sma.R
===================================================================
--- pkg/quantstrat/demo/luxor.3.paramset.sma.R	2013-10-01 19:58:39 UTC (rev 1514)
+++ pkg/quantstrat/demo/luxor.3.paramset.sma.R	2013-10-03 08:11:20 UTC (rev 1515)
@@ -9,9 +9,10 @@
 # Paragraph 3.3: luxor SMA paramset optimization
 
 ###
+require(quantstrat)
 
-source('luxor.include.R')
-source('luxor.getSymbols.R')
+source(paste0(path.package("quantstrat"),"/demo/luxor.include.R"))
+source(paste0(path.package("quantstrat"),"/demo/luxor.getSymbols.R"))
 
 ### blotter
 
@@ -25,7 +26,9 @@
 load.strategy(strategy.st)
 
 ### doMC
-
+if (!"doMC" %in% installed.packages()[,1]) {
+    install.packages("doMC")
+} 
 require(doMC)
 registerDoMC(cores=8)
 

Modified: pkg/quantstrat/demo/luxor.4.paramset.timespan.R
===================================================================
--- pkg/quantstrat/demo/luxor.4.paramset.timespan.R	2013-10-01 19:58:39 UTC (rev 1514)
+++ pkg/quantstrat/demo/luxor.4.paramset.timespan.R	2013-10-03 08:11:20 UTC (rev 1515)
@@ -10,9 +10,11 @@
 
 stop('#### DEMO BROKEN - BEING FIXED ###')
 
-source('luxor.include.R')
-source('luxor.getSymbols.R')
+require(quantstrat)
 
+source(paste0(path.package("quantstrat"),"/demo/luxor.include.R"))
+source(paste0(path.package("quantstrat"),"/demo/luxor.getSymbols.R"))
+
 ### blotter
 
 initPortf(portfolio.st, symbols='GBPUSD', initDate=initDate, currency='USD')
@@ -25,7 +27,9 @@
 load.strategy(strategy.st)
 
 ### doMC
-
+if (!"doMC" %in% installed.packages()[,1]) {
+    install.packages("doMC")
+}
 require(doMC)
 registerDoMC(cores=8)
 

Modified: pkg/quantstrat/demo/luxor.5.strategy.ordersets.R
===================================================================
--- pkg/quantstrat/demo/luxor.5.strategy.ordersets.R	2013-10-01 19:58:39 UTC (rev 1514)
+++ pkg/quantstrat/demo/luxor.5.strategy.ordersets.R	2013-10-03 08:11:20 UTC (rev 1515)
@@ -21,7 +21,7 @@
 #  {initDate="1999-12-31"
 #  endDate=Sys.Date()}
 
-source('luxor.include.R')
+source(paste0(path.package("quantstrat"),"/demo/luxor.include.R"))
 
 ### define strategy
 

Modified: pkg/quantstrat/demo/luxor.6.paramset.stoploss.R
===================================================================
--- pkg/quantstrat/demo/luxor.6.paramset.stoploss.R	2013-10-01 19:58:39 UTC (rev 1514)
+++ pkg/quantstrat/demo/luxor.6.paramset.stoploss.R	2013-10-03 08:11:20 UTC (rev 1515)
@@ -21,8 +21,8 @@
 #  {initDate="1999-12-31"
 #  endDate=Sys.Date()}
 
-source('luxor.include.R')
-source('luxor.getSymbols.R')
+source(paste0(path.package("quantstrat"),"/demo/luxor.include.R"))
+source(paste0(path.package("quantstrat"),"/demo/luxor.getSymbols.R"))
 
 ###
 
@@ -48,10 +48,12 @@
 #enable.rule('luxor', 'chain', 'TakeProfit')
 
 ### END uncomment lines to activate StopLoss and/or StopTrailing and/or TakeProfit rules
-
 require(foreach)
 #registerDoSEQ()
 
+if (!"doMC" %in% installed.packages()[,1]) {
+    install.packages("doMC")
+}
 require(doMC)
 registerDoMC(cores=8)
 

Modified: pkg/quantstrat/demo/luxor.6.paramset.stoptrailing.R
===================================================================
--- pkg/quantstrat/demo/luxor.6.paramset.stoptrailing.R	2013-10-01 19:58:39 UTC (rev 1514)
+++ pkg/quantstrat/demo/luxor.6.paramset.stoptrailing.R	2013-10-03 08:11:20 UTC (rev 1515)
@@ -21,8 +21,8 @@
 #  {initDate="1999-12-31"
 #  endDate=Sys.Date()}
 
-source('luxor.include.R')
-source('luxor.getSymbols.R')
+source(paste0(path.package("quantstrat"),"/demo/luxor.include.R"))
+source(paste0(path.package("quantstrat"),"/demo/luxor.getSymbols.R"))
 
 ###
 
@@ -48,10 +48,12 @@
 #enable.rule('luxor', 'chain', 'TakeProfit')
 
 ### END uncomment lines to activate StopLoss and/or StopTrailing and/or TakeProfit rules
-
 require(foreach)
 #registerDoSEQ()
 
+if (!"doMC" %in% installed.packages()[,1]) {
+    install.packages("doMC")
+}
 require(doMC)
 registerDoMC(cores=2)
 

Modified: pkg/quantstrat/demo/luxor.6.paramset.takeprofit.R
===================================================================
--- pkg/quantstrat/demo/luxor.6.paramset.takeprofit.R	2013-10-01 19:58:39 UTC (rev 1514)
+++ pkg/quantstrat/demo/luxor.6.paramset.takeprofit.R	2013-10-03 08:11:20 UTC (rev 1515)
@@ -21,8 +21,8 @@
 #  {initDate="1999-12-31"
 #  endDate=Sys.Date()}
 
-source('luxor.include.R')
-source('luxor.getSymbols.R')
+source(paste0(path.package("quantstrat"),"/demo/luxor.include.R"))
+source(paste0(path.package("quantstrat"),"/demo/luxor.getSymbols.R"))
 
 ###
 
@@ -48,10 +48,12 @@
 enable.rule('luxor', 'chain', 'TakeProfit')
 
 ### END uncomment lines to activate StopLoss and/or StopTrailing and/or TakeProfit rules
-
 require(foreach)
 #registerDoSEQ()
 
+if (!"doMC" %in% installed.packages()[,1]) {
+    install.packages("doMC")
+}
 require(doMC)
 registerDoMC(cores=8)
 

Modified: pkg/quantstrat/demo/luxor.7.exit+risk.R
===================================================================
--- pkg/quantstrat/demo/luxor.7.exit+risk.R	2013-10-01 19:58:39 UTC (rev 1514)
+++ pkg/quantstrat/demo/luxor.7.exit+risk.R	2013-10-03 08:11:20 UTC (rev 1515)
@@ -8,8 +8,10 @@
 #
 # Paragraph 3.5: determination of appropriate exit and risk management
 
-source('luxor.include.R')
+require(quantstrat)
 
+source(paste0(path.package("quantstrat"),"/demo/luxor.include.R"))
+
 ##### PLACE DEMO AND TEST DATES HERE #################
 #
 #if(isTRUE(options('in_test')$in_test))
@@ -21,7 +23,7 @@
 #  {initDate="1999-12-31"
 #  endDate=Sys.Date()}
 
-source('luxor.getSymbols.R')
+source(paste0(path.package("quantstrat"),"/demo/luxor.getSymbols.R"))
 
 ### blotter
 

Modified: pkg/quantstrat/demo/luxor.sample.tradeGraphs.sma.R
===================================================================
--- pkg/quantstrat/demo/luxor.sample.tradeGraphs.sma.R	2013-10-01 19:58:39 UTC (rev 1514)
+++ pkg/quantstrat/demo/luxor.sample.tradeGraphs.sma.R	2013-10-03 08:11:20 UTC (rev 1515)
@@ -12,7 +12,10 @@
 
 ### load 'stats' back into .GlobalEnv
 
-load('../data/luxor.parameters.1-10.30-55.RData')
+load(paste0(
+	path.package('quantstrat'),
+	'/data/luxor.parameters.2-10.30-55.RData')
+)
 
 ### show trade graphs from stats
 

Modified: pkg/quantstrat/demo/luxor.sample.tradeGraphs.timespan.R
===================================================================
--- pkg/quantstrat/demo/luxor.sample.tradeGraphs.timespan.R	2013-10-01 19:58:39 UTC (rev 1514)
+++ pkg/quantstrat/demo/luxor.sample.tradeGraphs.timespan.R	2013-10-03 08:11:20 UTC (rev 1515)
@@ -10,7 +10,10 @@
 
 require(quantstrat)
 
-load('../data/luxor.timespan.24x24.2002-2008.RData')
+load(paste0(
+        path.package('quantstrat'),
+        '/data/luxor.timespan.24x24.2002-2008.RData')
+)
 
 names(stats)[names(stats)=='testPackListPRL[[k]]$parameters']<-'timespan'
 

Modified: pkg/quantstrat/demo/pair_trade.R
===================================================================
--- pkg/quantstrat/demo/pair_trade.R	2013-10-01 19:58:39 UTC (rev 1514)
+++ pkg/quantstrat/demo/pair_trade.R	2013-10-03 08:11:20 UTC (rev 1515)
@@ -18,16 +18,14 @@
 # The Qty of Stock A that it buys (sells) = MaxPos / lvls
 # The Qty of Stock B that is sells (buys) = MaxPos * Ratio / lvls  
 
+require(quantstrat)
+
 suppressWarnings(rm("order_book.pair1",pos=.strategy))
 suppressWarnings(rm("account.pairs", "portfolio.pair1", pos=.blotter))
 suppressWarnings(rm("initDate", "endDate", "startDate", "initEq", "SD", "N", 
                     "symb1", "symb2", "portfolio1.st", "account.st", 
                     "pairStrat", "out1"))
 
-require(quantstrat)
-
-
-
 ##### PLACE DEMO AND TEST DATES HERE #################
 #
 #if(isTRUE(options('in_test')$in_test))

Added: pkg/quantstrat/inst/extdata/luxor.RData
===================================================================
(Binary files differ)


Property changes on: pkg/quantstrat/inst/extdata/luxor.RData
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.02.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.02.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.03.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.03.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.04.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.04.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.05.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.05.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.06.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.06.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.07.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.07.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.09.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.09.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.10.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.10.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.11.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.11.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.12.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.12.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.13.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.13.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.14.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.14.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.16.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.16.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.17.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.17.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.18.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.18.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.19.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.19.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.20.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.20.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.21.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.21.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.23.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.23.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.24.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.24.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.25.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.25.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.26.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.26.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.27.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.27.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.28.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.28.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.30.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.30.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: www/data/ES/2011.01.31.ES.rda
===================================================================
(Binary files differ)


Property changes on: www/data/ES/2011.01.31.ES.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream



More information about the Blotter-commits mailing list