sim.mom.strategy {matiming}R Documentation

Simulates the returns to the Momentum (MOM) strategy

Description

This function simulates the returns to the MOM strategy

Usage

sim.mom.strategy(totret, rfret, dates, capret=NULL, tc=0,
                        shorts = FALSE, winsize=200)

Arguments

totret

the vector of total returns

rfret

the vector of risk-free returns

dates

the vector of dates

capret

the vector of capital gain returns

tc

the amount of one-way transaction costs (a scalar)

shorts

a logical value indicating the type of the strategy when a Sell signal is generated. If shorts=FALSE, money is just invested in cash; otherwise, the asset is sold short

winsize

a vector or a scalar that determines the size of the window used to compute the MOM

Value

An object to be used by other functions. This object contains the returns to the simulated strategies and the description of each strategy

Note

The trading signal is computed using the vector of capital gain returns capret. If capret=NULL, then the trading signal is computed using the vector of total returns totret. If winsize is a vector, then the function simulates a number of trading strategies for all window sizes such that winsize >1

See Also

Other strategy simulation functions: sim.cdir.strategy(), sim.mac.strategy(), sim.macd.strategy(), sim.mae.strategy()

Examples

## Not run: 
data <- djia.monthly # use the monthly data for DJIA index
dates <- index(data)
data <- coredata(data)
capret <- data[,"CAP"]
totret <- data[,"TOT"]
rfret <- data[,"RF"]
tc <- 0.0025 # this defines 0.25% one-way transaction costs
winsize <- 2:15
shorts <- FALSE
results <- sim.mom.strategy(totret=totret, rfret=rfret, dates=dates,
                            capret=capret, tc=tc, shorts=shorts, winsize=winsize)

## End(Not run)

[Package matiming version 1.0 Index]