loss {Strategy} | R Documentation |
Get the losses of assets or portfolio over time.
Description
Losses over time of an assets or portfolio of an object of class Strategy
.
Usage
loss(object, V=100, method="full", of="portfolio"
, from=NULL, until=NULL, which=NULL
, include.weights=TRUE, include.costs=TRUE
, use.backtest=FALSE)
## S4 method for signature 'Strategy'
loss(object, V = 100, method = c("full", "linear"),
of = c("portfolio", "assets"), from = NULL, until = NULL,
which = NULL, include.weights = TRUE, include.costs = TRUE,
use.backtest = FALSE)
Arguments
object |
An object of class |
V |
Volume that is invested. The linear factor for the VaR calculation. Either a single value for portfolio or a vector for each asset. |
method |
Method of loss calculation. Use |
of |
Losses to be calculated for assets separately or the portfolio. |
from |
The date in character format |
until |
The date in character format |
which |
Names or number of assets that should be included in calculation. |
include.weights |
Only relevant if |
include.costs |
If |
use.backtest |
If |
Examples
## Not run:
# MA(200)-Strategy
params <- list(k=200)
myStrat.MA <- Strategy(assets=assets, strat="MA", strat.params=params)
# Get VaR of MA(200)-Strategy portfolio
myStrat.MA.losses <- loss(myStrat.MA, from="2015-01-01", until="2015-12-31")
## End(Not run)