Calculate the Kaufman Adaptive Moving Average (KAMA) for a given price series.

The Kaufman Adaptive Moving Average adjusts its own responsiveness to price changes based on how “efficiently” price is moving. It compares the net directional move over the window to the total (sum of absolute) movement over that same window - the Efficiency Ratio. When price trends strongly in one direction (an efficient move), the Efficiency Ratio is close to 1 and KAMA tracks price closely, behaving like a fast EMA. When price whipsaws sideways (an inefficient move), the Efficiency Ratio is close to 0 and KAMA flattens out, behaving like a slow EMA - reducing whipsaw signals in choppy markets while still reacting quickly during strong trends.

The formula is as follows:

\[\text{Change} = | \operatorname{Close}(t) - \operatorname{Close}(t - \text{window}) |\] \[\text{Volatility} = \operatorname{Sum}(| \operatorname{Close}(i) - \operatorname{Close}(i - 1) |,\; \text{window})\] \[\text{Efficiency Ratio} (\text{ER}) = \text{Change} / \text{Volatility}\] \[\text{Fastest SC} = 2 / (\text{fast\_window} + 1),\;\; \text{Slowest SC} = 2 / (\text{slow\_window} + 1)\] \[\text{Smoothing Constant} (\text{SC}) = \left[\text{ER} \cdot (\text{Fastest SC} - \text{Slowest SC}) + \text{Slowest SC}\right] ^{2}\] \[\operatorname{KAMA}(t) = \operatorname{KAMA}(t-1) + \text{SC} \cdot (\operatorname{Close}(t) - \operatorname{KAMA}(t-1))\]

Also known as: KAMA, Kaufman’s Adaptive Moving Average.

Kaufman Adaptive Moving Average (KAMA) in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_kaufman_adaptive_moving_average as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(
    tickers=["^STOXX50E"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.technicals.get_kaufman_adaptive_moving_average().tail(5)

Or, after setting up the Finance Toolkit MCP, ask:

How did the Kaufman adaptive moving average of the Euro Stoxx 50 move from 24 to 31 December 2025?

Which returns:

Date ^STOXX50E Benchmark
2025-12-24 5725.01 674.232
2025-12-26 5725.15 674.371
2025-12-29 5725.79 674.726
2025-12-30 5728.19 675.041
2025-12-31 5728.19 675.076

Parameters

get_kaufman_adaptive_moving_average accepts the following parameters.

ParameterTypeDescriptionExample
periodstrThe time period to consider for historical data. Can be “intraday”, “daily”, “weekly”, “monthly”, “quarterly” or “yearly”. Defaults to “daily”."weekly"
close_columnstrThe column name for closing prices in the historical data. Defaults to “Adj Close”."Close"
windowintNumber of periods over which the Efficiency Ratio is calculated. Defaults to 10.20
fast_windowintThe number of periods that corresponds to the fastest EMA constant used when the Efficiency Ratio is at its maximum (1.0). Defaults to 2.3
slow_windowintThe number of periods that corresponds to the slowest EMA constant used when the Efficiency Ratio is at its minimum (0.0). Defaults to 30.20
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise).2
growthboolWhether to calculate the growth of the KAMA. Defaults to False.True
lagint | list[int]The lag to use for the growth calculation. Defaults to 1.4
standardizeboolWhether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.True
Share