trend indicator
KAMA backtesting — Kaufman Adaptive Moving Average
The Kaufman Adaptive Moving Average (KAMA) is a trend line that automatically speeds up when price is trending efficiently and slows down when the market is choppy. It aims to solve the classic moving-average trade-off — lag versus noise — by adjusting itself, but whether that adaptation actually helps on a given market is still a backtesting question.
How KAMA works
KAMA starts from an efficiency ratio: the net distance price traveled over a window, divided by the total distance it wandered candle-to-candle. A ratio near 1 means price moved directly (an efficient trend), and KAMA speeds up toward its fast EMA constant; a ratio near 0 means price churned sideways, and KAMA slows toward its slow EMA constant. That adaptive smoothing constant is then applied like a standard EMA update. CandleTest’s KAMA follows TradingView-parity conventions for the efficiency-ratio and smoothing formulas. Traders use it as a trend filter — price crossing above or below the KAMA line, optionally combined with the line’s own slope — reacting faster in real trends and staying quieter in chop, both testable as no-code rules.
KAMA settings
The window used to measure the efficiency ratio — how directly price has been moving. Shorter windows make the adaptation react faster to regime changes; longer windows smooth the ratio itself.
The EMA constant KAMA converges toward when the efficiency ratio is high (trending, efficient price movement) — controls how fast the line can move at its most responsive.
The EMA constant KAMA converges toward when the efficiency ratio is low (choppy, inefficient price movement) — controls how slow and steady the line becomes in sideways markets.
Example KAMA strategies to backtest
Enter long when the close crosses above the KAMA line. Exit when the close crosses back below it.
Enter long when the close crosses above KAMA and KAMA is rising — the adaptive line itself confirming an efficient trend, not just a brief price poke through it. Exit when the close crosses back below KAMA, or when KAMA turns to falling.
Every rule above is buildable in the no-code strategy builder — pick conditions, press run, and get win rate, drawdown and equity curve on real exchange data with fees and leverage modeled.
KAMA FAQ
Is KAMA better than a regular moving average?
It is designed to reduce lag in trends and reduce whipsaws in chop at the same time, but that theoretical advantage does not automatically translate into a better backtest result on every pair. Compare KAMA against a plain EMA or SMA on the same rule and market before assuming it is an upgrade.
What do the efficiency ratio settings actually control?
The ER period sets how much history is used to judge whether price is trending or churning; the fast and slow periods set how responsive KAMA gets in each of those two regimes. Changing any of the three shifts the balance between reacting quickly and staying stable — an empirical trade-off best explored by sweeping settings in a backtest.
Does KAMA work well in sideways markets?
It is built to slow down and flatten out when price is inefficient, which should mean fewer false signals than a fixed-speed average in chop — but it can still lag real reversals. Backtesting a chop-heavy period on your market is the way to see how well the adaptation actually performs.