hitratio {Strategy} | R Documentation |
Strategy Hit Ratio
Description
Gets the hitratio of the signals of an object of class Strategy
.
Usage
hitratio(object, of="portfolio"
, from=NULL, until=NULL, which=NULL
, type="per.signal", include.costs=TRUE
, use.backtest=FALSE)
## S4 method for signature 'Strategy'
hitratio(object, of = c("portfolio", "assets"),
from = NULL, until = NULL, which = NULL, type = c("per.signal",
"per.trade"), include.costs = TRUE, use.backtest = FALSE)
Arguments
object |
An object of class |
of |
Hit Ratio to be calculated for assets separately or the portfolio (weighted hit ratios according to average asset weights). |
from |
The date in character format |
until |
The date in character format |
which |
Names or number of assets that should be included in calculation. |
type |
If the hitratio shall be calculated per trade with |
include.costs |
If |
use.backtest |
If set to |
Examples
## Not run:
# MA(200)-Strategy
params <- list(k=200)
myStrat.MA <- Strategy(assets=assets, strat="MA", strat.params=params)
# Get hit ratio of MA(200)-Strategy portfolio
hitratio(myStrat.MA, from="2015-01-01", until="2015-12-31")
# Get hit ratio of MA(200)-Strategy (daily data = 252 trading days)
# hitratio(myStrat.MA, from="2015-01-01", until="2015-12-31", use.backtest=TRUE)
## End(Not run)