Learn R Programming

FRAPO (version 0.3-7)

trdbinary: Binary Trend

Description

Calculation of the Binary Trend as a technical trading indicator.

Usage

trdbinary(y)

Arguments

y
Objects of classes: numeric, matrix, data.frame, ts, mts, timeSeries, zoo and xts are supported.

Value

  • An object of the same class as y, containing the computed Binary trend values.

concept

  • Binary
  • Trend
  • Binary Trend

Details

The Binary trend is calculated according to the formula: $$z = sign(y) \times \min(|4 / \pi \arctan(y)|, 1)$$

See Also

trdbilson, trdes, trdhp, trdsma, trdwma, capser

Examples

Run this code
data(StockIndex)
y <- StockIndex[, "SP500"]
yret <- diff(log(y))
binary <- trdbinary(yret)
head(binary)

Run the code above in your browser using DataLab