Description Usage Arguments Details Value Note Author(s) References See Also Examples
View source: R/DonchianChannel2.R
Donchian Channels were created by Richard Donchian and were used to generate buy and sell signals for the Turtle Trading system.
1 | DonchianChannel2(HL, n=10)
|
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 |
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:
high |
The highest high series. |
mid |
The average of |
low |
The lowest low series. |
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.
G See
The following site(s) were used to code/document this indicator:
https://www.investopedia.com/terms/d/donchianchannels.asp
See DonchianChannel
.
1 2 3 4 5 | ## Not run:
getSymbols(YHOO, adjust=TRUE)
dc <- DonchianChannel2(YHOO)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.