add.stoplosssig: add a stop loss signal to a strategy

Description Usage Arguments Details Value

Description

Actually, it's a special kind rules build on normal rule function. It will apply after applyStoplossSig and add stop loss rules in the rule space.

Usage

1
2
3
4
add.stoplosssig(strategy, sigcol, arguments, parameters = NULL,
  label = NULL, type = c(NULL, "stopLimit", "stopPercent", "stopVolatility",
  "stopTargetperiod"), ..., enabled = TRUE, indexnum = NULL,
  store = FALSE)

Arguments

strategy

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

sigcol

name of the trade signal, must correspond to the signal lable

arguments

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

parameters

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

label

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

type

one of "stopLimit","stopPercent","stopVolatility","stopTargetperiod" ,for now "stopVolatility" is unavailable

...

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

store

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

Details

All stop rules depends on the trade signals.

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.