find.pivots: Find supports and resitance for a time series

Description Usage Arguments Value Examples

View source: R/supports.R

Description

Find supports and resitance for a time series

Usage

1
2
find.pivots(x, type = c("SR", "FIB"), tolerance = 0.02, strength = 3,
  maxline = 10, lookback = 20)

Arguments

x

xts object, or vector, representing a time series

type

either FIB (Fibonacci) or SR. SR is based on best fit lines of multiple peaks and troughs

tolerance

threshold for percentage change or vol multiple for extreme points

strength

minimum number of extreme points defining a support

maxline

maximum number of support/ resistance lines to return

lookback

Used for volatility dependent adaptive threshold

Value

support/ resistance object (object of class supports)

Examples

1
2
3
4
5
6
7
8
x <- quantmod::getSymbols("^GSPC", auto.assign = FALSE)
x <- x["2015/"]
sups <- find.pivots(x, type = "FIB")
summary(sups)
sups <- find.pivots(x, type = "SR", strength = 5)
summary(sups)
quantmod::chart_Series(x)
quantmod::add_TA(sups$lines[[1]],on=1, lty=2)

prodipta/techchart documentation built on Sept. 13, 2020, 2:51 p.m.