Summary
KeltnerChannel is RTTA's streaming modern Keltner channel: an EMA of close
surrounded by a multiple of Wilder ATR.
Update API
result = rtta.KeltnerChannel(
span=20.0,
window_atr=20.0,
fillna=False,
multiplier=2.0,
).update(close, high, low)
# result.middle, result.upper, result.lower
advance(...) consumes the same values without materializing a Python result.
See KeltnerChannelOriginal for Chester Keltner's
earlier typical-price formulation.
Theory Of Operation
The EMA supplies a responsive trend center. ATR measures recent true range, including overnight gaps, so the envelope expands and contracts with volatility.
Recurrence
Let \(s\), \(n\), and \(k\) denote span, window_atr, and multiplier, respectively.
ATR is initialized by the running mean of true range through its first \(n\) observations, then follows Wilder smoothing:
The channel is
With fillna=False, all three fields are NaN until
\(\max(\lfloor s\rfloor,\lfloor n\rfloor,1)\) observations have been consumed.
With fillna=True, partial EMA and ATR values are returned immediately.
Composed Primitives
Implementation Notes
The recurrence is implemented in src/rtta/indicator.cpp in
class KeltnerChannel.
