Learn R Programming

quantstrat (version 0.8.2)

sigCrossover: generate a crossover signal

Description

This will generate a crossover signal, which is a dimension-reduced version of a comparison signal sigComparison.

Usage

sigCrossover(label, data = mktdata, columns, relationship = c("gt", "lt", "eq", "gte", "lte"), offset1 = 0, offset2 = 0)

Arguments

label
text label to apply to the output
data
data to apply crossover to
columns
named columns to apply crossover of the first against the second
relationship
one of c("gt","lt","eq","gte","lte") or reasonable alternatives
offset1
numeric offset to be added to the first column prior to comparison
offset2
numeric offset to be added to the second column prior to comparison

Details

It will return TRUE on the period in which there is a crossover in the direction specified by relationship, and NA otherwise.

If you want all the information, use a comparison instead.