add.stoplossrule: add a stop loss rule to a strategy

Description Usage Arguments Value

Description

add a stop loss rule to a strategy

Usage

1
2
3
add.stoplossrule(strategy, name, arguments, parameters = NULL, label = NULL,
  parent = NULL, type = "exit", ..., enabled = TRUE, indexnum = NULL,
  path.dep = TRUE, timespan = NULL, store = FALSE, storefun = TRUE)

Arguments

strategy

an object of type 'strategy' to add the rule to

name

name of the stop loss rule, must correspond to an R function

arguments

named list of default arguments to be passed to an rule function when executed

parameters

vector of strings naming parameters to be saved for apply-time definition

label

arbitrary text label for rule output, NULL default will be converted to '<name>.rule'

parent

the label of the parent rule for a chain rule, unavailable

type

should be exit, and it is default

...

any other passthru parameters

enabled

TRUE/FALSE whether the rule is enabled for use in applying the strategy, default TRUE

indexnum

if you are updating a specific rule, the index number in the $rules[type] list to update

path.dep

TRUE/FALSE whether rule is path dependent, default TRUE, see Details

timespan

an xts/ISO-8601 style time subset, like "T08:00/T15:00", see Details

store

TRUE/FALSE whether to store the strategy in the .strategy environment, or return it. default FALSE

storefun

TRUE/FALSE whether to store the function in the rule, default TRUE. setting this option to FALSE may slow the backtest, but makes debug usable

Value

if strategy was the name of a strategy, the name. It it was a strategy, the updated strategy.


Chen-Chaozong/extraquantstrat documentation built on May 6, 2019, 10:10 a.m.