The Kaufman Adaptive Moving Average is a unique indicator that automatically adapts to the market’s noise.
Here I explain its inner workings and show you how to build a trend following strategy around it.
The complete strategy can be downloaded in the Free Strategies section.
Moving averages are among the most common technical indicators in the trading world.
In general, they produce reliable entry signals in trending markets, but struggle during periods of consolidation.
What if we could have a moving average that adapts to the market?
Kaufman to the Rescue
In 1972, legendary trader Perry Kaufman started developing the Kaufman Adaptive Moving Average (KAMA).
The KAMA adapts in accordance with the market’s noise level. Noise is the erratic price movement within a trend or consolidation period.
The chart below is an example of a noisy market. There is plenty of price movement, but little net change in price.
The KAMA reacts slowly in noisy, sideways markets. This increases the distance between prices and the KAMA, and minimizes unwanted price penetrations caused by erratic movement.
Conversely, the KAMA reacts quickly in low-noise, trending markets. For such markets, the KAMA can afford to be positioned closer to prices, because there are few false changes of direction.
Here’s how the KAMA looks like when overlaid on a chart.
Notice how the KAMA tracks prices closely when the market is trending. When the market begins to consolidate, however, the KAMA becomes relatively unresponsive and stays almost horizontal.
Kaufman Adaptive Moving Average Calculation
Due to its adaptive nature, the KAMA is more tedious to calculate. Let’s go through each step of the calculation.
1. Efficiency Ratio
The first step is to calculate the market’s efficiency ratio.
The efficiency ratio (ER) is defined as the absolute net change in price divided by the absolute sum of the individual price changes over that period.
The ER is a measure of a market’s noise level, and oscillates between 0 and 1.
The chart below shows the ER plotted with prices.
Notice how markets that are trending smoothly have a large ER.
Conversely, noisy sideways markets produce a small ER.
The ER’s variation in accordance with the market noise is the reason for the KAMA’s adaptive nature.
To allow the KAMA to adapt quickly to changing markets, Kaufman recommended using a smaller lookback period for the ER. A 10-period ER is used by default.
The selected lookback period should not exceed the longest run of consecutive price moves. For example, if prices rarely close higher/lower for more than 10 consecutive bars, a 10-period ER should be used.
2. Smoothing Constant
With the ER, the smoothing constant (SC) can now be calculated. The SC is calculated for each period, as follows:
By default, the fastest moving average period is set to 2, while the slowest moving average period is set to 30.
These boundary values define the fastest and slowest speeds at which the KAMA will react to prices.
For example, if you want the KAMA to be less sensitive to prices, set the fastest moving average period to be greater than 2.
Together with the ER, this smoothing constant controls the reactiveness of the KAMA.
Noisy markets produce small SC values, and the resulting KAMA becomes more unresponsive to prices.
Smooth trending markets produce larger SC values, and the KAMA will follow prices closely.
3. Current KAMA
Like an exponential moving average, the current KAMA is finally calculated as follows:
Trading the Kaufman Adaptive Moving Average
In a trend following context, Kaufman recommended buying when the KAMA is rising, and selling when the KAMA is falling.
Obviously, these rules are extremely relaxed and will produce a large number of false signals. Even in its least responsive state, the KAMA exhibits frequent direction changes.
Nonetheless, let’s use the above rules as a starting point and try to build a tradeable strategy for the M30 USDCHF. We’ll use the default parameters for the efficiency ratio and smoothing constant.
Selecting Sustainable Trends
As with all trend strategies, the challenge lies with identifying genuine, sustainable trends. Let’s consider a trend to be sustainable when the KAMA has been rising/falling for 10 consecutive bars.
Therefore, we will only buy when the KAMA has been rising for 10 consecutive bars, and sell when the KAMA has been falling for 10 consecutive bars.
I’ll throw in a 100-pip stop loss and trailing stop for trade management.
As usual, AlgoWizard satisfied my programming needs.
A 10-year backtest was done on the 30-minute USDCHF.
Not too bad for a first pass. The strategy is still pretty simple at this point; let’s fine-tune it a little.
Adding a Pullback Filter
Pullbacks offer traders the opportunity to jump onboard a trend at a ‘discount.’ Pullbacks are a naturally occurring feature of every trend, so why not make use of them?
A while ago, I built a dual Commodity Channel Index (CCI) trend following strategy, where the CCI was used for both trend and pullback detection. All you have to do is vary the CCI’s lookback period.
Let’s once again use a 5-period CCI to detect pullbacks. The following pullback filter conditions will be added:
Buy when the CCI(5) is below -100
Sell when the CCI(5) is above +100
With this additional condition, there is a narrow window where entries can be triggered. In the chart below, the pullback brings the CCI below -100, but almost causes the KAMA to turn down as well.
I added the pullback filter condition and reran the backtest.
That’s quite an improvement in consistency! With a 1.44 profit factor, I wouldn’t mind trading this strategy as part of a diversified portfolio.
The CCI pullback filter only caused a 9% drop in the number of trades. I was actually expecting the narrow entry window illustrated above to cut off more trades.
Yes it’s yet another moving average, but the Kaufman Adaptive Moving Average deserves your consideration.
The KAMA’s calculation is more involved, but it can applied in the same manner as conventional moving averages like the SMA, EMA etc.
I know what you’re thinking: How does the KAMA stack up against the other moving averages?
Since markets are always evolving, using adaptive strategy elements like the KAMA certainly makes a whole lot of sense.
However, from a practical standpoint, the only way to find out would be to exhaustively backtest the various moving averages across all markets of interest. Establishing equivalency between the KAMA and other moving averages may be a little challenging, since the KAMA does not use a single integer value for its lookback period.
Assuming the backtests produced roughly equal results, I’d personally prefer to use the KAMA. Its adaptive qualities give me confidence that the strategy can weather changing market conditions.
As usual, the completely strategy can be downloaded in the Free Strategies section.
Have you found success using adaptive strategy elements? Let me know what works for you!