trading.signals: Discretize a set of values into a set of trading signals

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/trading.R

Description

This function transforms a set of numeric values into a set of trading signals according to two thresholds: one that establishes the limit above which any value will be transformed into a buy signal ('b'), and the other that sets the value below which we have a sell signal ('s'). Between the two thresholds we will have a hold signal ('h').

Usage

1
trading.signals(vs, b.t, s.t)

Arguments

vs

A vector with numeric values

b.t

A number representing the buy threshold

s.t

A number representing the sell threshold

Value

A factor with three possible values 'b' (buy), 's' (sell) or 'h' (hold)

Author(s)

Luis Torgo ltorgo@dcc.fc.up.pt

References

Torgo, L. (2016) Data Mining using R: learning with case studies, second edition, Chapman & Hall/CRC (ISBN-13: 978-1482234893).

http://ltorgo.github.io/DMwR2

See Also

trading.signals, tradingEvaluation, trading.simulator

Examples

1
trading.signals(rnorm(sd=0.5,100),b.t=0.1,s.t=-0.12)

DMwR2 documentation built on May 2, 2019, 1:42 p.m.