compare: Compare performance of 'Strategy'-objects.

Description Usage Arguments Examples

Description

Compare the portfolio performance indicators of an arbitrary number of objects of class Strategy.

Usage

1
2
3
4
5
6
7
8
compare(..., from=NULL, until=NULL, which=NULL
       , scaling.periods=NULL, include.costs=TRUE
       , use.backtest=FALSE, include.params=FALSE)

## S4 method for signature 'Strategy'
compare(..., from = NULL, until = NULL, which = NULL,
  scaling.periods = NULL, include.costs = TRUE, use.backtest = FALSE,
  include.params = FALSE)

Arguments

...

Objects of class Strategy.

from

The date in character format "yyyy-MM-dd" or as date-object from which performance shall be considered. If NULL, no restriction is made.

until

The date in character format "yyyy-MM-dd" or as date-object until which performance shall be considered. If NULL, no restriction is made.

which

Names or number of assets that should be included in calculation.

scaling.periods

Vector with annualization factors for calculation. Default is 252, 52, 12, 4, 1 for daily, weekly, monthly, quarterly and yearly data respectively.

include.costs

If FALSE, the fixed and relative trading costs are NOT considered for performance calculation. Default value is TRUE. As default values for costs are 0, this argument is obsolete if no costs are given.

use.backtest

If TRUE, the performance of the backtesting output is considered for performance indicator calculation. If FALSE, the performance of the initial strategy execution are used.

include.params

If TRUE the parameters of the strategies are included in their names. E.g. MA(k=200) instead of MA as strategy name for moving average.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
##Not run:

# MA(200)-Strategy
params <- list(k=200)
myStrat.MA <- Strategy(assets=assets, strat="MA", strat.params=params)

# EWMA(0.05)-Strategy
params <- list(lambda=0.05)
myStrat.EWMA <- Strategy(assets=assets, strat="EWMA", strat.params=params)

# Compare annualized performance of MA(200) and EWMA(0.05)
# compare(myStrat.MA, myStrat.EWMA, use.backtest=TRUE, scaling.periods=252)

##End(Not run)

Strategy documentation built on May 2, 2019, 2:09 a.m.