What Is the Kaufman Adaptive Moving Average?

Feb 25, 2021

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.

Wrapping Up

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!

Powered By

Development Platform

Forex VPS

FXVM Forex VPS

Popular Posts

Laguerre RSI Trend Following Strategy

The Laguerre RSI attempts to improve the responsiveness of the regular RSI, whilst keeping whipsaw trades to a minimum. Let’s see how well it detects short-term pullbacks for a trend following strategy!

read more

What is Fixed Ratio Money Management?

Have you heard of fixed ratio money management? How does it compare to the popular fixed fractional approach? Here I’ll explain how fixed ratio works, and see how it stacks up against fixed fractional money management.

read more

Build a Diversified Portfolio With QuantAnalyzer

The ability to efficiently trade a diversified portfolio of strategies is one of the biggest advantages of algorithmic trading. Here we will use QuantAnalyzer’s Portfolio Master to build a portfolio consisting of high performing, uncorrelated strategies.

read more

What Is the QQE Indicator?

The QQE is a mysterious indicator that sometimes pops up in trading forums. Does it deserve a place alongside the more traditional momentum indicators like the RSI and CCI? Let’s add it to a trend following strategy to find out!

read more

Make your money work for you!

Get promotions, trading ideas and strategy development tips delivered to your inbox!

Comments

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Trading Strategies

What’s the Best Time to Trade Forex?

What’s the Best Time to Trade Forex?

The forex markets are open 24/5, but not all hours are created equal. Here I dissect my broker data to determine the best time to trade forex.

Forex Weekend Gaps: Can You Exploit Them?

Forex Weekend Gaps: Can You Exploit Them?

Have you noticed that forex weekend gaps usually reverse within 3 days? Here I’ll program a mean reversion strategy to exploit gaps over the last 18 years!

Money Flow Index: An Improved RSI?

Money Flow Index: An Improved RSI?

The Money Flow Index is sometimes called the volume-weighted RSI. Can it outperform the RSI in this trend following strategy?

Automated Bollinger Bands Squeeze Forex Strategy

Automated Bollinger Bands Squeeze Forex Strategy

StrategyQuant’s BBWR indicator is the perfect tool to detect a Bollinger Bands squeeze. Here I explain how it’s calculated, and use it to program a breakout strategy for the AUDJPY!

Should You Use the Kelly Criterion for Forex Trading?

Should You Use the Kelly Criterion for Forex Trading?

The Kelly criterion is a famous mathematical formula that attempts to maximize your long-term capital growth. In this post, I’ll apply it to a EURUSD breakout strategy and explain some of its potential shortcomings when applied to forex trading.

Can a Trading Pause Improve Your Trend Following Results?

Can a Trading Pause Improve Your Trend Following Results?

A temporary trading pause can improve your win rate if you’re trend following a volatile market. Here I’ll program a trading pause into a simple breakout strategy, and test its effectiveness on the Widow Maker – the GBPJPY.

Laguerre RSI Trend Following Strategy

Laguerre RSI Trend Following Strategy

The Laguerre RSI attempts to improve the responsiveness of the regular RSI, whilst keeping whipsaw trades to a minimum. Let’s see how well it detects short-term pullbacks for a trend following strategy!

How to Use the Supertrend Indicator

How to Use the Supertrend Indicator

Despite its cool name, the Supertrend indicator often seems to slip under the radar. Here I explain how it’s calculated, and combine it with moving averages to produce a simple trend following strategy.

Strategy Development

Do You Know Your System Quality Number?

Do You Know Your System Quality Number?

The System Quality Number measures the profitability & consistency of your trading system. Here’s how to calculate your SQN and use it to improve your trading!

How to Get a Realistic Backtest Spread

How to Get a Realistic Backtest Spread

Your choice of backtest spread can certainly make or break a strategy. This post will show you how to study the intraday spread variations of your market, and suggest several ways to avoid paying ridiculous spreads.

Do You Know Your Strategy’s Optimization Profile?

Do You Know Your Strategy’s Optimization Profile?

Your strategy’s optimization profile often reveals its robustness, helping you select strategies that will remain profitable in live trading. Here I explain why an optimization profile is important, and how you can easily obtain one using StrategyQuant’s optimizer.

Which MT4 Backtest Report Metrics Should You Use?

Which MT4 Backtest Report Metrics Should You Use?

Understanding your backtest report is an essential part of being a successful strategy developer. Here I explain what the numbers mean, and how you can make use of each metric during strategy development.

Out-of-sample Testing Using Monte Carlo Simulations

Out-of-sample Testing Using Monte Carlo Simulations

Traders often use Monte Carlo simulations to estimate worst-case drawdowns, but did you know they can be used for out-of-sample testing too? This post demonstrates the use of StrategyQuant’s Monte Carlo simulator to randomize historical prices and strategy parameters, helping you select robust strategies for live trading.

How Many Trades Should Your Backtest Have?

How Many Trades Should Your Backtest Have?

We all want a large sample of trades in our backtests, but practical limitations such as data availability often get in the way. Here I’ll explain why 30 trades is insufficient, and how you can use standard error to quantify the uncertainty arising from a small sample size.

Build a Diversified Portfolio With QuantAnalyzer

Build a Diversified Portfolio With QuantAnalyzer

The ability to efficiently trade a diversified portfolio of strategies is one of the biggest advantages of algorithmic trading. Here we will use QuantAnalyzer’s Portfolio Master to build a portfolio consisting of high performing, uncorrelated strategies.

Strategy Optimization Using MT4

Strategy Optimization Using MT4

How do you improve your trading strategy in MT4? This post will show you how to optimize the entry and exit parameters for a moving average crossover strategy. Finally, an intraday time filter will be added to help avoid false breakouts.

Debugging & Backtesting Using MT4

Debugging & Backtesting Using MT4

With a fresh algorithm at your fingertips, how do you verify that it has been programmed correctly? This guide will show you how to use Metatrader 4’s visual backtester to debug and backtest your strategy.

Create Your Trading Algorithm in 15 Minutes (FREE)

Create Your Trading Algorithm in 15 Minutes (FREE)

Converting your trading idea into an algorithm is the first step towards reaping the benefits of automated trading. This guide will cover the creation of a simple moving average crossover algorithm, without any actual programming.

What Is Drawdown in Trading?

What Is Drawdown in Trading?

Are you getting a comprehensive assessment of your strategy’s downside? This post will discuss several methods to measure drawdowns, helping you build and select strategies that better suit your risk appetite.

Live Trading

What’s the Best Time to Trade Forex?

What’s the Best Time to Trade Forex?

The forex markets are open 24/5, but not all hours are created equal. Here I dissect my broker data to determine the best time to trade forex.

How to Find a Real Trading Guru

How to Find a Real Trading Guru

Every day I come across a trading guru offering educational content on the internet. Many of them speak of huge returns with minimal effort. Should these be trusted? Here’s some tips on how to separate the wheat from the chaff.

How to Enjoy Stress-Free Trading

How to Enjoy Stress-Free Trading

Trading is a great way to make some additional income, but not if you’re constantly pulling your hair out. Here I offer 7 tips to help make your trading profitable and stress-free.

How to Select the Best Forex VPS

How to Select the Best Forex VPS

A virtual private server (VPS) is a virtual computer that you can rent and access remotely. It provides a reliable platform on which to execute your forex strategies. This post will help you decide whether you need a VPS, and show you how to select an optimal VPS.

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Pin It on Pinterest

Share This