Summary
ElderThermometer measures how far the current bar extends beyond the previous
bar's high or low. It returns the raw temperature, its ratio to a 22-period EMA
by default, and a flag for temperature above that average.
Update API
result = rtta.ElderThermometer(fillna=True).update(high, low)
result = rtta.ElderThermometer(window=22, fillna=True).update(high, low)
# result.ratio, result.hot, result.range
The overload with only fillna preserves the original constructor API.
window controls the EMA of temperature. If high < low, the inputs are
swapped.
Theory Of Operation
Elder's thermometer measures outward expansion, rather than the current bar's ordinary high-low range or its ratio to yesterday's range. A higher high is a positive upward extension; a lower low is a positive downward extension. An inside bar has zero temperature.
Recurrence
For \(t\ge1\):
Let \(A_t=EMA_n(T_t)\), with \(n=22\) by default. Then
The result field named range is retained for API compatibility, but contains
\(T_t\), the outward-extension temperature—not \(H_t-L_t\).
The first bar has no prior high/low. With fillna=True, it returns zeros; with
fillna=False, all fields are NaN. Strict mode remains NaN until window
temperature observations (and therefore window + 1 bars) have been consumed.
Implementation Notes
The recurrence is implemented in src/rtta/indicator.cpp in
class ElderThermometer. Result fields are ratio, hot, and the
backward-compatible range field.
