Learn R Programming

TTR (version 0.23-2)

DonchianChannel: Donchian Channel

Description

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

Usage

DonchianChannel(HL, n = 10, include.lag = FALSE)

Arguments

HL

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

n

Number of periods for moving average.

include.lag

Should values be lagged so that today's prices are not included in the calculation? See Note.

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.

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.

References

The following site(s) were used to code/document this indicator: https://www.linnsoft.com/techind/donchian-channels

See Also

See BBands.

Examples

Run this code
# NOT RUN {
data(ttrc)
dc <- DonchianChannel( ttrc[,c("High","Low")] )

# }

Run the code above in your browser using DataLab