SCM

SCM Repository

[blotter] Annotation of /pkg/quantstrat/demo/luxor.include.R
ViewVC logotype

Annotation of /pkg/quantstrat/demo/luxor.include.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1538 - (view) (download)

1 : opentrades 1457 ###
2 :    
3 :     options(width = 240)
4 : opentrades 1464 #options(warn=1)
5 :    
6 : opentrades 1457 Sys.setenv(TZ="UTC")
7 :    
8 :     ###
9 :    
10 :     initDate = '2002-10-21'
11 :    
12 :     .from=initDate
13 :    
14 : opentrades 1499 #.to='2008-07-04'
15 : opentrades 1461 .to='2002-10-31'
16 : opentrades 1457
17 :     ###
18 :    
19 :     strategy.st = 'luxor'
20 :     portfolio.st = 'forex'
21 : opentrades 1538 account.st = 'IB'
22 : opentrades 1457
23 :     ###
24 :    
25 :     .orderqty = 100000
26 :     .threshold = 0.0005
27 :     .txnfees = -6 # round-trip fee
28 :    
29 :     ### Distributions for paramset analysis
30 :    
31 :     .nsamples=80
32 :    
33 :     .FastSMA = (1:20)
34 :     .SlowSMA = (30:80)
35 :    
36 : opentrades 1467 .StopLoss = seq(0.05, 2.4, length.out=48)/100
37 :     .StopTrailing = seq(0.05, 2.4, length.out=48)/100
38 :     .TakeProfit = seq(0.1, 4.8, length.out=48)/100
39 : opentrades 1457
40 : opentrades 1464 .FastWFA = c(1, 3, 5, 7, 9)
41 :     .SlowWFA = c(42, 44, 46)
42 :    
43 : opentrades 1457 # generate 24x24h ISO8601 timespan vector
44 :    
45 :     .timespans.start<-paste(sprintf("T%02d",0:23),':00',sep='')
46 :     .timespans.stop<-paste(sprintf("T%02d",0:23),':59',sep='')
47 :    
48 :     .timespans<-outer(.timespans.start, .timespans.stop, FUN=paste, sep='/')
49 :    
50 :     # in order to run the full 24x24 hour scan above, comment out the following line:
51 :     .timespans<-c('T06:00/T10:00', 'T07:00/T11:00', 'T08:00/T12:00', 'T09:00/T13:00', 'T10:00/T14:00', 'T11:00/T15:00', 'T12:00/T16:00')
52 :    
53 :     ### Actual arameters
54 :    
55 :     .fast = 6
56 :     .slow = 44
57 :    
58 : opentrades 1467 #.timespan = 'T09:00/T13:00'
59 : opentrades 1499 #.timespan = 'T00:00/T23:59'
60 :     .timespan = NULL
61 : opentrades 1457
62 : opentrades 1467 .stoploss <- 0.40/100
63 :     .stoptrailing <- 0.8/100
64 :     .takeprofit <- 2.0/100
65 : opentrades 1457
66 : opentrades 1538 suppressWarnings(rm(list = c(paste("account", account.st, sep='.'), paste("portfolio", portfolio.st, sep='.')), pos=.blotter))
67 :     suppressWarnings(rm(list = c(strategy.st, paste("order_book", portfolio.st, sep='.')), pos=.strategy))

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