All posts
Technical Analysis2026/06/11Updated: By Iven W.

Kaufman Adaptive Moving Average (KAMA): Formula & Settings

Calculate KAMA with a worked Efficiency Ratio example, understand its squared smoothing factor, and check TradingView settings and timeframe confirmation.

Kaufman's Adaptive Moving Average (KAMA) uses the Efficiency Ratio (ER) to adjust how much a moving average moves toward each new price. The calculation has three parts: measure the price path, square an interpolated smoothing factor, then update the previous KAMA value. The square matters: fast length 2 does not make KAMA identical to a 2-period EMA.

This guide works through the numbers, explains the 10/2/30 reference settings, and shows what to check when using KAMA in TradingView. KAMA measures price behavior; it does not predict the next candle or establish a profitable trading strategy.

KAMA Formula: Efficiency Ratio, Smoothing Factor and Update

Let P be your chosen price source, N the ER lookback, and f and s the fast and slow lengths. For a nonzero price path:

Net change = abs(P[t] - P[t-N])
Path length = sum(abs(P[i] - P[i-1]), over the last N changes)
ER = Net change / Path length

F = 2 / (f + 1)
S = 2 / (s + 1)
SC = [ER × (F - S) + S]²

KAMA[t] = KAMA[t-1] + SC × (P[t] - KAMA[t-1])

The official TradingView KAMA documentation describes this calculation and its input controls. Here, SC is the final update factor, after squaring.

ER uses absolute distances, so a straight downward move can have the same ER as a straight upward move. Direction comes from the price series and KAMA's slope, not the sign of ER.

Why ER Is Between Zero and One — Except for a Flat Path

For a positive path length, the endpoint distance cannot exceed the sum of the individual distances. Therefore 0 ≤ ER ≤ 1:

  • Closes 100, 101, 102, 103: net move 3, path 3, ER = 1.
  • Closes 100, 102, 99, 100: net move 0, path 6, ER = 0.
  • Closes 100, 100, 100, 100: both distances are 0, so the written formula is 0/0, not automatically ER = 0.

A spreadsheet or custom script needs a stated zero-denominator rule. When reproducing a platform's values, check its implementation rather than silently assigning your own fallback. Also remember that N changes require N + 1 source values.

Worked Example: KAMA(3, 2, 30) on Four Closes

Use a deliberately short ER window so every step fits on the page. These are illustrative prices, not a market result.

BarCloseAbsolute change from prior close
0100—
11022
21011
31032

For the last bar:

N = 3, fast length = 2, slow length = 30
Net change = |103 - 100| = 3
Path length = 2 + 1 + 2 = 5
ER = 3 / 5 = 0.6
F = 2 / 3
S = 2 / 31
SC = [0.6 × (2/3 - 2/31) + 2/31]²
   = (66/155)²
   = 4356/24025 ≈ 0.181311

Assume the previous KAMA state is 101. This is a supplied state for one recursive update, not a claim about how TradingView initializes the series:

New KAMA = 101 + (4356/24025) × (103 - 101)
         ≈ 101.362622

The line moves about 0.362622 toward a price that is 2 points above its previous state. Omitting the square would use about 0.425806 instead of 0.181311 and produce a different line. Keep full precision internally; round only the displayed result.

The Squared Factor: Fast 2 / Slow 30 Endpoints

Holding the two lengths fixed gives these exact boundaries:

ERFactor before squaringFinal SCFraction of price-to-KAMA gap closed this bar
02/314/961 ≈ 0.004162About 0.416%
0.534/931156/8649 ≈ 0.133657About 13.366%
12/34/9 ≈ 0.444444About 44.444%

At ER = 1, the final factor approaches (2/3)², not 2/3. At ER = 0, it approaches (2/31)², not 2/31. These are per-bar weights; they do not say how many candles a complete trading signal will lag.

Initialization and Warm-Up Can Change Early Values

A recursive calculation needs a starting value. StockCharts ChartSchool starts its illustrated calculation with an SMA. Do not assume every implementation uses that seed or the same warm-up history. To diagnose a mismatch, compare the same source, timestamps, lengths, initial state and available history before changing trading rules.

How to Add KAMA in TradingView

Open a chart, select Indicators, and search for Kaufman's Adaptive Moving Average. Choose the built-in indicator rather than assuming a similarly named community script has identical calculations. Open its settings and record the values you actually see.

ControlWhat to verify
SourceWhich price series feeds the calculation
ER lengthNumber of bar-to-bar changes used in ER
Fast / slow lengthsInputs to the two factors before squaring
TimeframeInterval of the indicator's source bars
Wait for timeframe closesWhether higher-timeframe values must be confirmed

What Do KAMA(10, 2, 30) Settings Mean?

StockCharts identifies 10/2/30 as Kaufman's reference configuration: 10 for the ER window, 2 for the fast factor and 30 for the slow factor. It is a useful reproducible starting configuration, not a universally best setup for scalping, forex or crypto.

Defaults differ between implementations. TA-Lib's KAMA documentation lists an ER-period default of 30 and documents fixed fast/slow factors of 2/3 and 2/31. A TA-Lib call with period 30 therefore should not be compared with a 10/2/30 chart as if only the software changed. TradingView's help page lists the controls; verify numeric defaults in your own dialog.

Does KAMA Repaint? Check the Source Timeframe

Separate these situations:

SituationWhat can change?
KAMA uses the chart interval, current candle unfinishedThe current price and KAMA value can update before that candle closes
One-hour KAMA on a five-minute chart, hourly candle unfinishedClosing a five-minute candle does not confirm the hourly input
Higher-timeframe KAMA with Wait for timeframe closes checkedNew higher-timeframe values arrive after the source candle closes

TradingView's multi-timeframe documentation explains that confirmed higher-timeframe points are connected visually, with no actual indicator values between those points. With the wait option unchecked, real-time higher-timeframe values can remain unconfirmed and change.

For a decision log, write down both intervals and the confirmation setting. A line that looks continuous is not proof that every lower-timeframe bar had a confirmed value available. A custom script needs its own inspection; a blanket “KAMA never repaints” label is insufficient.

KAMA vs EMA: Compare Rules, Not a Speed Ranking

An EMA uses a fixed update factor for a given length. KAMA changes its factor with ER. Neither design guarantees fewer losing trades, faster reversal detection or better returns on your instrument.

KAMA can slow down when the path zigzags, yet a flat line is not proof that the entire market is ranging. Its position also depends on the previous recursive state. A sharp reversal can cross the line before the efficiency estimate reflects the new path. Test the actual entry and exit rule rather than assigning “best in trends” from the indicator name.

For a broader selection guide, use the moving averages comparison hub. This article stays focused on KAMA's calculation and implementation.

A KAMA Settings Test You Can Repeat

Use a chart or replay environment where KAMA is available and the source data is known. Before revealing the next candles:

  1. Fix the sample. Choose an instrument, interval and starting date in advance. Reserve a later segment for testing; do not select only reversals you already know.
  2. Record the implementation. Note source, ER/fast/slow lengths, seed or warm-up information, and confirmation setting. Start with a documented configuration such as 10/2/30.
  3. Write one rule. For example, record a candidate signal only after a confirmed source close crosses KAMA. Define entry timing, exit and invalidation before running the sample. This is a test hypothesis, not a recommended strategy.
  4. Change one input. Compare two ER windows while keeping other inputs fixed, or compare two fast lengths at one ER window. Changing all three together makes the cause hard to diagnose.
  5. Count costs and errors. Log signals, whipsaws, missed moves, spread, commissions and slippage assumptions. A smoother line can delay useful signals too.
  6. Run the held-out segment. Keep the chosen settings and rules fixed. Report both periods, including failed signals; do not present the visually nicest segment as evidence of an edge.

For a separate exercise in deciding before the next price bar, use ChartMini forex replay or ChartMini crypto replay, which advance historical five-minute bars. Daily Replay for stocks advances daily bars. Keep KAMA overlay comparisons in the environment where you verified the indicator and data; record decision-practice results separately.

FAQ

Is KAMA a leading or lagging indicator?

KAMA is lagging: it uses current and past prices. A high Efficiency Ratio increases its update factor, but does not make it predictive or universally faster than an EMA.

What are the default KAMA settings in TradingView?

KAMA(10, 2, 30) is the common StockCharts reference configuration. TradingView documents ER, fast and slow length inputs; check the actual values in your indicator dialog. Defaults are not universal: TA-Lib documents an ER period of 30.

Is KAMA better than EMA?

Neither is universally better. EMA has a fixed update factor; KAMA changes its factor with price efficiency. Compare identical data, explicit settings and the same trading rules on a separate test sample.

What is the Efficiency Ratio telling me?

ER compares the absolute net move with the total absolute bar-to-bar move. It measures path efficiency, not bullish or bearish direction. A flat path has a zero denominator and needs an explicit implementation rule.

Can I use KAMA for crypto trading?

Yes, with an implementation that supports your crypto price series. Record the exchange, source, interval and settings; test on unseen data with realistic costs. The formula alone does not establish a profitable crypto strategy.

Does KAMA repaint in TradingView?

An unfinished source bar can change. With a higher indicator timeframe, a closed chart bar can still contain an unconfirmed higher-timeframe value. Check Wait for timeframe closes and evaluate signals only when the chosen source timeframe is confirmed.

What should I change first if KAMA isn't working as expected?

First verify the price source, timeframe, confirmation setting and implementation. Then change one length at a time on a fixed sample. There is no universal rule that ER length has the largest effect or that lowering it improves results.

Sources