sigThreshold: generate a threshold signal

Description Usage Arguments

Description

Many strategies, including RSI or MACD styles, make trading decisions when an indicator is over or under a specific threshold. This function generates the appropriate signal based on such a threshold.

Usage

1
2
sigThreshold(label, data = mktdata, column, threshold = 0,
  relationship = c("gt", "lt", "eq", "gte", "lte"), cross = FALSE)

Arguments

label

text label to apply to the output

data

data to apply comparison to

column

named column to apply comparison to

threshold

numeric threshold to test for

relationship

one of c("gt","lt","eq","gte","lte") or reasonable alternatives

cross

if TRUE, will return TRUE only for the first observation to cross the threshold in a run


redmode/quantstrat documentation built on May 27, 2019, 4:04 a.m.