DonchianChannel2: Donchian Channel

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

View source: R/DonchianChannel2.R

Description

Donchian Channels were created by Richard Donchian and were used to generate buy and sell signals for the Turtle Trading system.

Usage

1
  DonchianChannel2(HL, n=10)

Arguments

HL

Object that is coercible to xts or matrix and contains High and Low prices or Close prices.

n

Number of periods to include in price band calculation

Details

Donchian Channels consist of two (sometimes three) lines:

The top line is the highest high of the past n periods. The bottom line is the lowest low of the past n periods. The middle line is the average of the top and bottom lines.

Value

A object of the same class as HL or a matrix (if try.xts fails) containing the columns:

high

The highest high series.

mid

The average of high and low.

low

The lowest low series.

Note

The DonchianChannel function in the package TTR includes the current price bar for the channel calculation. In contrary, this DonchianChannel2 function calculates the price bands on the previous n price bars.

Author(s)

G See

References

The following site(s) were used to code/document this indicator:
https://www.investopedia.com/terms/d/donchianchannels.asp

See Also

See DonchianChannel.

Examples

1
2
3
4
5
## Not run: 
  getSymbols(YHOO, adjust=TRUE)
  dc <- DonchianChannel2(YHOO)

## End(Not run)

candlesticks documentation built on Feb. 2, 2020, 3:01 a.m.