How it is calculated
Three EMAs of the same length in a chain: e1 of the source, e2 of e1, e3 of e2. TEMA is 3 times e1 minus 3 times e2 plus e3. Each EMA is seeded with the simple average of its own first length inputs, so the first value needs 3 times length minus 2 bars, as TA-Lib's TEMA.
Reference: TA-Lib TEMA (Mulloy 1994)
How to read it
It hugs price and turns early; at sharp turns it overshoots, and in a sideways market it turns falsely often. It suits places where speed matters more than smoothness.
In a strategy
A fast trend line with its slope as signal, ctx.ind("tema", length=20), combined with a slow filter such as an SMA 200.
Inputs
| Input | Type | Default | Range or choices |
|---|---|---|---|
Lengthlength | Whole number | 20 | min 1, max 5000 |
Sourcesource | Price | "close" | close, open, high, low, hl2, hlc3, ohlc4, hlcc4 |
What it draws
| Line | Drawn as |
|---|---|
| TEMA | Line |
Used in
No strategy template reads it yet.