Appends three columns; each is undefined for the first period − 1
rows. Reads high and low (no close), each named by an option defaulting
to its DEFAULT_OHLCV column.
Definition
There is only one: upper is exactly what rollingMax gives over
high and lower what rollingMin gives over low — this study
is those two edges in one rolling scan (via highestLowestValues,
the kernel it shares with stochastic and williamsR), plus
the midpoint. Verified against pandas rolling(n).max() / .min() in the
oracle fixture; TA-Lib has no Donchian to compare with.
Edges
In the units of the price, like atr: scaling every price
scales the channel with it. It does not normalise.
A missing high or low is skipped, not propagated: the edge is the
extreme of the cells the window does hold, and only a window with none
reads undefined. This is core's reducer policy and the same contract
rollingMax / rollingMin already ship — including over another
study's output, where the channel starts on that study's first bar with
whatever the window holds by then, rather than period − 1 bars later.
upper and lower bound close by construction only when
low ≤ close ≤ high holds on the input bars; the study does not check
that, and a close outside its own bar's range will sit outside the
channel too.
Donchian channel (Richard Donchian) — the highest high and lowest low of the trailing
periodbars, and their midpoint:Appends three columns; each is
undefinedfor the firstperiod − 1rows. Reads high and low (no close), each named by an option defaulting to itsDEFAULT_OHLCVcolumn.Definition
There is only one:
upperis exactly what rollingMax gives overhighandlowerwhat rollingMin gives overlow— this study is those two edges in onerollingscan (via highestLowestValues, the kernel it shares with stochastic and williamsR), plus the midpoint. Verified against pandasrolling(n).max()/.min()in the oracle fixture; TA-Lib has no Donchian to compare with.Edges
highorlowis skipped, not propagated: the edge is the extreme of the cells the window does hold, and only a window with none readsundefined. This is core's reducer policy and the same contractrollingMax/rollingMinalready ship — including over another study's output, where the channel starts on that study's first bar with whatever the window holds by then, rather thanperiod − 1bars later.upperandlowerboundcloseby construction only whenlow ≤ close ≤ highholds on the input bars; the study does not check that, and a close outside its own bar's range will sit outside the channel too.