performance {Strategy}R Documentation

Get Strategy Performance

Description

Gets the performance of an object of class Strategy.

Usage

performance(object, of = "portfolio", type = "performance", from = NULL,
  until = NULL, which = NULL, use.backtest = FALSE,
  include.costs = TRUE)

## S4 method for signature 'Strategy'
performance(object, of = c("portfolio", "assets"),
  type = c("performance", "logReturns", "returns"), from = NULL,
  until = NULL, which = NULL, use.backtest = FALSE,
  include.costs = TRUE)

Arguments

object

An object of class Strategy.

of

Performance to be extracted from assets separately or the portfolio performance.

type

Which type of performance shall be returned. performance is the cumulative performance starting at 1, logReturns to get logarithmic returns or returns for arithmetic returns.

from

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

until

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

which

Names or number of assets that should be included in performance. If a portfolio performance from only a subset of the assets is calculated, the weights are scaled accordingly.

use.backtest

If TRUE, the signals from the backtesting output are considered for performance calculation. If FALSE, the signals from the initial strategy execution are used.

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.

Examples

## Not run:

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

# Get performance of MA(200)-Strategy
performance(myStrat.MA, from="2015-01-01", until="2015-12-31")

# Get backtest performance of MA(200)-Strategy
# performance(myStrat.MA, from="2015-01-01", until="2015-12-31"
# , use.backtest=TRUE, type="logReturns")

## End(Not run)

[Package Strategy version 1.0.1 Index]