Description Usage Arguments Examples
Gets the hitratio of the signals of an object of class Strategy
.
1 2 3 4 5 6 7 8 9 | 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)
|
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 |
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## 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)
|
Portfolio
0.4975342
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.