is.outperformance.plot {matiming}R Documentation

Plots the trading strategies rolling outperformance

Description

This function plots the trading strategies rolling outperformance

Usage

is.outperformance.plot(results, start.date, split.date, end.date, FUN=Sharpe)

Arguments

results

the results of the back-test or simulation of a trading strategy or multiple trading strategies. The former is the result returned by function back.test. The latter is the result returned by function sim.mom.strategy, sim.mac.strategy, sim.cdir.strategy, sim.macd.strategy, or sim.results.merge

start.date

the start of the first rolling period

split.date

the end of the first rolling period

end.date

the end of the total period

FUN

the function that computes the performance of a trading strategy. The function FUN is either Excret, Sharpe, or Sortino.

Value

None

Note

The argument results contains the dates vector that defines the historical period over which the trading strategies are simulated. The function FUN is only used if results is the result of simulation. The outperformance is defined as the difference between the performance of a trading strategy and the performance of the corresponding passive strategy. The number of plotted strategies is limited by 5.

See Also

Other plotting functions: oos.outperformance.plot()

Examples

## Not run: 
library(matiming)
library(zoo)
# access the data
data <- sp500.monthly
dates <- index(data)
data <- coredata(data)
capret <- data[,"CAP"]
totret <- data[,"TOT"]
rfret <- data[,"RF"]
# simulate the SMA(10) strategy
tc <- 0.0025
fast <- 1
slow <- 10
shorts <- F
results <- sim.mac.strategy(totret=totret, rfret=rfret, dates=dates,
                         capret=capret, tc=tc, shorts=shorts, fast=fast, slow=slow, FUN=SMA)
# plot the rolling outperformance
start.date <- as.Date("1920-01-01", format="%Y-%m-%d")
split.date <- as.Date("1929-12-31", format="%Y-%m-%d")
end.date <- as.Date("2015-12-31", format="%Y-%m-%d")
is.outperformance.plot(results, start.date=start.date, split.date=split.date,
 end.date=end.date, FUN=Sharpe)

## End(Not run)

[Package matiming version 1.0 Index]