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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jun 28 15:20:55 CEST 2012


Author: opentrades
Date: 2012-06-28 15:20:55 +0200 (Thu, 28 Jun 2012)
New Revision: 1084

Modified:
   pkg/quantstrat/demo/luxor.p3_2.R
Log:
updated luxor demo, now correctly running using latest quantstrat svn r1082



Modified: pkg/quantstrat/demo/luxor.p3_2.R
===================================================================
--- pkg/quantstrat/demo/luxor.p3_2.R	2012-06-28 12:23:27 UTC (rev 1083)
+++ pkg/quantstrat/demo/luxor.p3_2.R	2012-06-28 13:20:55 UTC (rev 1084)
@@ -2,36 +2,39 @@
 #
 # Jan Humme (@opentrades) - June 2012
 #
+# Tested and found to work correctly using blotter r1082
+#
 # From Jaekle & Tamasini: A new approach to system development and portfolio optimisation (ISBN 978-1-905641-79-6)
 #
-# Paragraph 3.2: luxor without any optimizations
+# Paragraph 3.2: luxor without any optimizations, but with $30 tnx costs + slippage
 
 .qty=100000
 .th=0.0005
-.txn=-6
-.txn=0
+.txn=-30
+#.txn=0
 
 initDate = '2002-10-21'
 .from='2002-10-21'
-#.to='2008-07-04'
-.to='2002-10-31'
+.to='2008-07-04'
 
-options(width = 240)
-
 ####
 
 p = 'forex'
 a = 'IB1'
 
+options(width = 240)
+#Sys.setenv(TZ="GMT")
+
 ###
 
 require(quantstrat)
 
 currency(c('GBP', 'USD'))
+
 exchange_rate(c('GBPUSD'), tick_size=0.0001)
-#setSymbolLookup.FI('~/R.symbols/', 'GBPUSD')
-setSymbolLookup.FI('../sandbox/', 'GBPUSD')
 
+setSymbolLookup.FI('~/R.symbols/', 'GBPUSD')
+
 ###
 
 getSymbols('GBPUSD', from=.from, to=.to, verbose=FALSE)
@@ -91,7 +94,7 @@
 
 s <- add.rule(s, 'ruleSignal',
 	arguments=list(sigcol='long' , sigval=TRUE,
-		replace=FALSE,
+		replace=TRUE,
 		orderside='short',
 		ordertype='market',
 		TxnFees=.txn,
@@ -104,7 +107,7 @@
 
 s <- add.rule(s, 'ruleSignal',
 	arguments=list(sigcol='short', sigval=TRUE,
-		replace=FALSE,
+		replace=TRUE,
 		orderside='long' ,
 		ordertype='market',
 		TxnFees=.txn,
@@ -121,7 +124,7 @@
 		ordertype='stoplimit',
 		prefer='High',
 		threshold=.th,
-		TxnFees=.txn,
+		TxnFees=0,
 		orderqty=+.qty,
 		orderset='ocolong'
 	),
@@ -136,7 +139,7 @@
 		ordertype='stoplimit',
 		prefer='Low',
 		threshold=-.th,
-		TxnFees=.txn,
+		TxnFees=0,
 		orderqty=-.qty,
 		orderset='ocoshort'
 	),



More information about the Blotter-commits mailing list