fun_RelErrMom: Relative Error Adjusted based Momentum

Description Usage Arguments Value

Description

Returns a plot and statistics for a relative momentum based on error adjusted ranking OBS! Objects with only NA's values will be removed under calculations

Usage

1
2
3
4
5
fun_RelErrMom(listData, period = c("days", "weeks", "months", "quarters",
  "years"), lookback = c(3, 6, 12), dateStart = NULL,
  weights = c(1/6, 2/3, 1/6), NumAssets = 8, size = NULL,
  UseTC = TRUE, TCmin = 30, TCrate = 0.001, savePlot = NULL,
  name = NULL, width = 8, height = 6, SMAperiod = 10)

Arguments

listData

Data from Yahoo in form OHLCAV. The adjusted prices is used s these must be present

period

Period at which one want to obtain data. Can be "days", "weeks", "months", "quarters" or "years"

lookback

Lookback periods used to rank assets

dateStart

Date at which the strategy shall start. The lookback period is looking before this date so it is the start date of the strategy. The form should be ex: "2018/", "2018-01/" or "2018-01-01/"

weights

weights when using a weighted momentum. Vector which should have lenth three and sum to one

NumAssets

Number of assets in optimal portfolio

size

Number of asset one buy (or sell) in each transaction. Default is one

UseTC

Logical if one want to use transaction cast

TCmin

Minimum transactionamount

TCrate

Rate in which the transaction cost is calculated. This is only used if it is over the minimal amount

savePlot

Outdir if one want to save plot

name

Used on graph. If savePlot !is.null then the name (OBS: also _MOM_period is appended)

width

If savePlot !is.null then the width of plot

height

If savePlot !is.null then the height of plot

SMAperiod

int Period one is using to calculate errors. These are calcualted on daily frequency and not the period specified

Value

list

name plotCumReturn

ggplot of cumreturns for different assets

name StatTable

Table of statistics

name xtable_StatTable

LateX code for above table of statistics


3schwartz/IPAmomentumSmallMidCap documentation built on May 15, 2019, 12:50 p.m.