Donchian Channels
Created by Richard Donchian, Donchian Channels, also called Price Channels, are price ranges derived from highest High and lowest Low values. [Discuss] 💬

// C# usage syntax
IEnumerable<DonchianResult> results =
quotes.GetDonchian(lookbackPeriods);
Parameters
lookbackPeriods int - Number of periods (N) for lookback period. Must be greater than 0 to calculate; however we suggest a larger value for an appropriate sample size. Default is 20.
Historical quotes requirements
You must have at least N+1 periods of quotes to cover the warmup periods.
quotes is a collection of generic TQuote historical price quotes. It should have a consistent frequency (day, hour, minute, etc). See the Guide for more information.
Response
IEnumerable<DonchianResult>
- This method returns a time series of all available indicator values for the
quotesprovided. - It always returns the same number of elements as there are in the historical quotes.
- It does not return a single incremental indicator value.
- The first
Nperiods will havenullvalues since there’s not enough data to calculate.
DonchianResult
Date DateTime - Date from evaluated TQuote
UpperBand decimal - Upper line is the highest High over N periods
Centerline decimal - Simple average of Upper and Lower bands
LowerBand decimal - Lower line is the lowest Low over N periods
Width decimal - Width as percent of Centerline price. (UpperBand-LowerBand)/Centerline
Utilities
See Utilities and helpers for more information.
Chaining
This indicator is not chain-enabled and must be generated from quotes. It cannot be used for further processing by other chain-enabled indicators.