plotPerformance {Strategy} | R Documentation |
Plot Strategy Performance
Description
Plots performance of an object of class Strategy
.
Usage
plotPerformance(object, which = NULL, of = "portfolio", from = NULL,
until = NULL, use.backtest = FALSE, include.costs = TRUE,
plot.params = TRUE, plot.params.names = NULL, plot.params.first = TRUE,
...)
## S4 method for signature 'Strategy'
plotPerformance(object, which = NULL,
of = c("portfolio", "assets"), from = NULL, until = NULL,
use.backtest = FALSE, include.costs = TRUE, plot.params = TRUE,
plot.params.names = NULL, plot.params.first = TRUE, ...)
Arguments
object |
An object of class |
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. |
from |
The date in character format |
until |
The date in character format |
use.backtest |
If |
include.costs |
If |
plot.params |
If set to TRUE, the parameters used for the performance periods are plotted into the chart. Requires that use.backtest is set to |
plot.params.names |
New parameter names to be shown can be supplied. Requires that use.backtest is set to |
plot.params.first |
If |
... |
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
plotPerformance(myStrat.MA, from="2015-01-01", until="2015-12-31")
# Plot backtested MA(200)-Strategy
# plotPerformance(myStrat.MA, from="2015-01-01", until="2015-12-31", use.backtest=TRUE)
##End(Not run)