Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

edits to quantstrat-rank-backtest.R

  • Loading branch information...
commit 436cbcef884f0592e473a040e7557e9552d4aa10 1 parent 6ef0643
rbresearch authored

Showing 1 changed file with 5 additions and 5 deletions. Show diff stats Hide diff stats

  1. +5 5 quantstrat-rank-backtest.R
10 quantstrat-rank-backtest.R
... ... @@ -1,4 +1,4 @@
1   -# quantstrat-rank.R
  1 +# quantstrat-rank-backtest.R
2 2
3 3 rm(list=ls())
4 4
@@ -20,7 +20,7 @@ symbols <- c("XLY", "XLP", "XLE", "AGG", "IVV")
20 20 stock(symbols, currency="USD")
21 21
22 22 # get data for the symbols
23   -getSymbols(symbols, from="2012-01-01", to="2012-12-31")
  23 +getSymbols(symbols, from="2005-01-01", to="2012-12-31")
24 24
25 25 # create an xts object of monthly adjusted close prices
26 26 symbols.close <- monthlyPrices(symbols)
@@ -51,13 +51,13 @@ for(i in 1:length(symbols)) {
51 51
52 52 # run the backtest
53 53 bt <- qstratRank(symbols=symbols, init.equity=100000, top.N=2,
54   - max.size=1000, max.levels=1)
  54 + max.size=1000, max.levels=2)
55 55
56 56 # get trade stats
57   -bt.stats <- <-bt$stats
  57 +bt.stats <- bt$stats
58 58
59 59 # chart of returns
60   -charts.PerformanceSummary(bt1$returns[,"total"], geometric=FALSE,
  60 +charts.PerformanceSummary(bt$returns[,"total"], geometric=FALSE,
61 61 wealth.index=TRUE, main="Total Performance")
62 62
63 63

0 comments on commit 436cbce

Please sign in to comment.
Something went wrong with that request. Please try again.