All indicators

Kaufman Adaptive Moving Average (KAMA) Strategy

May 22, 2024

Static chart image
SignalsMoving Averages

The Kaufman Adaptive Moving Average (KAMA) Strategy indicator tool provides a trend-following system that dynamically adjusts to market volatility to identify entries and exits while minimizing noise.

Usage

The Usage section describes how the script can be used to automate trend-following decisions based on the adaptive nature of KAMA. The strategy focuses on capturing sustained momentum while ignoring minor price fluctuations during sideways markets.

  • Long Entries: A buy signal is generated when the KAMA line rises consecutively for a user-defined period (default is 10 bars).
  • Short Entries: A sell signal is generated when the KAMA line falls consecutively for a user-defined period (default is 10 bars).
  • Position Management: The strategy can be configured to trade only longs, only shorts, or both directions. It automatically closes existing positions when a reversal signal occurs or when the specific rising/falling period conditions are no longer met.

Details

The KAMA is an advanced moving average that modifies the standard Exponential Moving Average (EMA) by incorporating an Efficiency Ratio (ER). This allows the indicator to "speed up" during strong trends and "slow down" when the market is choppy.

The construction follows these core components:

  1. Efficiency Ratio (ER): Calculated by dividing the absolute net price change over a period by the sum of absolute price changes for each bar. A value of 1 represents a perfect trend, while 0 represents high noise.
  2. Smoothing Constant (SC): This utilizes the ER to scale between a "fastest" EMA rate (typically 2 periods) and a "slowest" EMA rate (typically 30 or 50 periods).
  3. Adaptive Calculation: The resulting constant is squared to emphasize the difference between trending and non-trending periods, ensuring the KAMA remains flat during consolidation and tracks closely during breakouts.

Settings

KAMA

  • Length: The lookback period used to calculate the Efficiency Ratio (ER).
  • KAMA Source: The price source used for the calculation (e.g., Close, Open, HL2).
  • Fast MA Length: The smoothing period used for the fastest possible KAMA response.
  • Slow MA Length: The smoothing period used for the slowest possible KAMA response.

Strategy

  • Order Direction: Determines the trade types allowed (Long, Short, or Both).
  • Rising Period: The number of consecutive bars the KAMA must increase to trigger a long entry.
  • Falling Period: The number of consecutive bars the KAMA must decrease to trigger a short entry.

FAQ

How does KAMA differ from a standard SMA?
Unlike the Simple Moving Average (SMA) which applies equal weight to all data points, KAMA adjusts its sensitivity based on market noise. It remains flat during volatile, non-directional periods and reacts quickly during strong price moves.

Can I use this strategy on any timeframe?
Yes, the adaptive nature of the Kaufman Moving Average allows it to function across various timeframes, though users should optimize the Rising/Falling period settings to match the specific volatility of the chosen interval.

How do I get access to the Kaufman Adaptive Moving Average (KAMA) Strategy?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.