sigThreshold: generate a threshold signal

Description Usage Arguments

View source: R/signals.R

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


cloudcell/quantstrat documentation built on May 13, 2019, 8:03 p.m.