apply_position_sl: Apply Position Stop-Loss on xts Object Containing Weights

Description Usage Arguments Examples

Description

Apply Position Stop-Loss on xts Object Containing Weights

Usage

1
apply_position_sl(weights, prices, sl1, sl2, ma = c("ALMA"), n = 5)

Arguments

weights

xts object with portfolio weights

prices

price list of instruments in portfolio weights object

sl1

number indicating drawdown at which to initiate gradual stop loss

sl2

number indicating drawdown to which to extend gradual stop loss

ma

moving average type (SMA, EMA, ALMA or DEMA) to use for drawdown calculation

n

number of periods to use for moving average calculation

Examples

1
apply_position_sl(stock_weights, stock_prices, sl1 = -0.2, sl2 = -0.3, ma = "EMA", n = 3)

rengelke/tradr documentation built on Jan. 2, 2022, 2:03 p.m.