SCM

SCM Repository

[blotter] View of /pkg/quantstrat/demo/luxor.4.paramset.timespan.R
ViewVC logotype

View of /pkg/quantstrat/demo/luxor.4.paramset.timespan.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1565 - (download) (annotate)
Mon Nov 4 20:15:00 2013 UTC (5 years, 8 months ago) by opentrades
File size: 1214 byte(s)
- fixed single paramset distribution
- fixed luxor demo 4 timespans
- small output file name adjustment for luxor.3 and luxor.4 demos

#!/usr/bin/Rscript --vanilla
#
# Jan Humme (@opentrades) - August 2012, revised April 2013
#
# Tested and found to work correctly using blotter r1457
#
# After Jaekle & Tamasini: A new approach to system development and portfolio optimisation (ISBN 978-1-905641-79-6)
#
# Paragraph 3.4: luxor timespan paramset optimization

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')
initAcct(account.st, portfolios=portfolio.st, initDate=initDate, currency='USD')

### quantstrat

initOrders(portfolio.st, initDate=initDate)

load.strategy(strategy.st)

### doMC
if (!"doMC" %in% installed.packages()[,1]) {
    install.packages("doMC")
}
require(doMC)
registerDoMC(cores=8)

#require(doParallel)
#registerDoParallel(cores=2)

#require(doRedis)
#registerDoRedis('jobs')

results <- apply.paramset(strategy.st, paramset.label='Timespan', portfolio.st=portfolio.st, account.st=account.st, nsamples=.nsamples, verbose=TRUE)

###

stats <- results$tradeStats

print(stats)

save(stats, file='luxor.4.paramset.timespan.RData')


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