KAMA
A moving average that tracks price closely in clean trends and nearly freezes in sideways chop.
KAMA (Kaufman adaptive moving average) is a smoothed average of the close whose speed changes bar by bar. It measures efficiency: the net move over the last er_window bars divided by the total of all bar-to-bar moves in that span. That ratio is 1 when price moves in one straight line and near 0 when it zigzags. High efficiency makes the average chase price; low efficiency makes it nearly stop.
How to read it
- It is drawn on the price chart, on the same scale as the candles.
- A line that bends steadily with price on one side is a clean trend, and the line follows closely.
- A flat line that price keeps crossing is sideways chop; the average has stopped reacting.
- On SPY one-minute bars for September 2026 with defaults, the median value was 0.999997 of the close and the correlation with close was 0.999.
- The first er_window bars have no line, because the efficiency ratio needs that much history.
What it outputs
- KAMA
- Adaptive average of the close. Its smoothing speeds up when recent price moved in a straight line and slows when price chopped sideways.
Settings
- er_window
- Bars the efficiency ratio looks back over. Short windows make the speed jump bar to bar, so the line jitters. Long windows (30+) change speed only on sustained trends or chop. At 1 the ratio is almost always 1, so the line runs at fast speed.
- fast_sc
- Smoothing used when price moves in a straight line, set as 2/(fast_sc+1) then squared. Raising it makes the line lag trends more. At 1 the line equals price in a clean trend. Keep it below slow_sc.
- slow_sc
- Smoothing used in sideways chop, set as 2/(slow_sc+1) then squared. Raising it freezes the line in chop so swings are ignored. Lowering it lets the line chase every chop swing. Keep it above fast_sc.
Pitfalls
- At defaults it tracks the close almost exactly, so it reads like a second price line. Its speed differences show mainly in chop, where the slow end freezes it.
- fast_sc must stay below slow_sc. If they are inverted, the line speeds up in chop and slows in trends, the opposite of the design.
- The catalog text for this indicator describes an unrelated helper class, so this explainer follows the code, not that text.