plotDrawdowns {Strategy}R Documentation

Plot Strategy Drawdowns

Description

Plots drawdowns of the performance of an object of class Strategy.

Usage

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

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

Arguments

object

An object of class Strategy.

from

The date in character format "yyyy-MM-dd" or as date-object from which drawdowns shall be plotted. If NULL, the start date of the performances is used.

until

The date in character format "yyyy-MM-dd" or as date-object until which drawdowns shall be plotted. If NULL, the end date of the performances is used.

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.

of

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

type

If the absolute or relative drawdown of the performance shall be returned.

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 redundant if no costs are given.

use.backtest

If TRUE, the signals from the backtesting output are considered for drawdowns calculation. If FALSE, the signals from the normal strategy execution with the initial parameters are used.

returnValues

If TRUE, the drawdown values are returned.

...

Further arguments that can be passed to the underlying plot()-function.

Examples

##Not run:

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

# Plot MA(200)-Strategy drawdowns
plotDrawdowns(myStrat.MA, from="2015-01-01", until="2015-12-31")

# Plot backtested MA(200)-Strategy drawdowns
# plotDrawdowns(myStrat.MA, from="2015-01-01", until="2015-12-31", use.backtest=TRUE)

##End(Not run)

[Package Strategy version 1.0.1 Index]