DonchianChannel | R Documentation |
Donchian Channels were created by Richard Donchian and were used to generate buy and sell signals for the Turtle Trading system.
DonchianChannel(HL, n = 10, include.lag = FALSE)
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. |
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.
A object of the same class as HL
or a matrix (if
try.xts
fails) containing the columns:
The highest high series.
The average of high
and low
.
The lowest low series.
The default of include.lag=FALSE
makes DonchainChannel
consistent with other TTR functions, in that it includes the current
period in the calculation.
The default is different than the original calculation, which would calculate
the indicator using periods t-1 through t-n. Setting include.lag=TRUE
will return the result of the original calculation.
The default of this argument may change in the future.
Joshua Ulrich
The following site(s) were used to code/document this
indicator:
https://www.linnsoft.com/techind/donchian-channels
See BBands
.
data(ttrc)
dc <- DonchianChannel( ttrc[,c("High","Low")] )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.