Triple exponential moving average
All indicators

LibraryTrend

Indicator

Triple exponential moving average

Patrick Mulloy's triple exponential average, with even less lag than DEMA.

TrendOn the price2 inputsTEMA

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

InputTypeDefaultRange or choices
LengthlengthWhole number20min 1, max 5000
SourcesourcePrice"close"close, open, high, low, hl2, hlc3, ohlc4, hlcc4

What it draws

LineDrawn as
TEMALine

Used in

No strategy template reads it yet.

OrionQuant