KAMA Strategy - Kaufman's Adaptive Moving Average
Feb 9, 2021

The KAMA Strategy indicator provides a comprehensive trading framework based on Kaufman's Adaptive Moving Average to identify trend direction while filtering market noise. By dynamically adjusting its sensitivity based on volatility, the tool aims to follow strong trends closely while remaining flat during choppy, non-trending periods.
Usage
The Usage section describes how the script can be used to identify market entries and manage exits. The core logic relies on the slope of the KAMA; a rising KAMA suggests a bullish trend, while a falling KAMA suggests a bearish trend.
- Entries: The strategy initiates a long position when the primary KAMA (KAMA 1) points upward and the magnitude of the move exceeds a volatility-based threshold (the KAMA Filter).
- Exits: Users can choose from multiple exit mechanisms to secure profits or limit losses. These can be used individually or in combination:
- KAMA Exit: Closes the position when the KAMA slope turns negative and exceeds the exit filter threshold.
- ATR Trailing Stop: A dynamic stop-loss that follows price at a distance determined by the Average True Range (ATR).
- PSAR Exit: Utilizes the Parabolic SAR to trigger exits when price crosses the SAR dots.
Details
The script is built around the efficiency ratio (ER), which represents the ratio of price direction to volatility. Kaufman's Adaptive Moving Average uses this ratio to adjust the smoothing constant between a "fast" and "slow" EMA.
- Adaptability: During trending markets, the ER is high, causing the KAMA to act like a fast EMA (e.g., 2-period). During sideways markets, the ER is low, and the KAMA acts like a slow EMA (e.g., 30-period).
- KAMA Filter: To reduce whipsaws, a filter is applied based on the standard deviation of the KAMA’s own changes. This ensures that the strategy only enters or exits when the KAMA movement is statistically significant relative to recent noise.
- Visual Ribbon: The script plots eight different KAMA lengths to create a ribbon effect, providing a visual representation of trend strength across multiple time horizons.
Settings
General Settings
- Source: Determines the price data used for KAMA calculations (e.g., Close, HL2).
Exits
- KAMA 1 Stop Loss: Enables/disables exits based on the primary KAMA slope.
- ATR Trailing Stop Loss: Enables/disables the volatility-based trailing stop.
- PSAR Stop Loss: Enables/disables exits based on Parabolic SAR crossovers.
KAMA Parameters
- Length: The lookback period used to calculate the efficiency ratio.
- Fast KAMA Length: The fastest possible smoothing length used during high efficiency.
- Slow KAMA Length: The slowest possible smoothing length used during low efficiency.
- KAMA 1 - 8: Eight sets of inputs allowing users to customize the lookback and smoothing bounds for each ribbon line.
KAMA Filter
- KAMA Entry Filter: Multiplier for the standard deviation filter to trigger entries.
- KAMA Exit Filter: Multiplier for the standard deviation filter to trigger exits.
Trailing ATR Stop
- Trailing ATR Lookback Period: The window for calculating ATR volatility.
- Trailing ATR Multiplier: Determines the distance of the stop loss from the price.
- Trail Mode: Choose between "Running" (constantly recalculating) or "Trailing" (only moves in the direction of the trade).
FAQ
How do I interpret the KAMA ribbon colors? Green lines indicate the KAMA is currently rising (bullish), while red lines indicate the KAMA is falling (bearish). Darker, thicker lines represent the faster KAMA settings, while lighter lines represent the slower, smoother settings.
Can I use this strategy for shorting? The current implementation of this script is optimized for long-only entries and exits. However, the KAMA values and filters can be used visually to identify bearish reversals.
How do I access the KAMA Strategy? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.
Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2026 LuxAlgo Global, LLC.

