Static chart image
Signals
Cycle
Moving Averages

The kama indicator provides an adaptive moving average that adjusts its sensitivity based on market volatility and trend efficiency to filter noise and identify trends more effectively. By incorporating a Dominant Cycle calculation, this tool optimizes the lookback period dynamically, allowing it to stay close to price action during strong trends while flattening out during choppy market conditions.

Usage

The Usage section describes how the script can be used to identify market direction and potential entry points. The indicator primarily functions as a trend-following tool where the slope and color of the KAMA line indicate the current market bias.

  • Trend Identification: A green KAMA line moving upward suggests a bullish trend, while a red KAMA line moving downward suggests a bearish trend.
  • Hysteresis Band: The optional hysteresis bands provide a buffer zone around the moving average. This helps traders avoid "whipsaws" or false signals that occur when price fluctuates narrowly around the mean.
  • Bar Coloring: When enabled, the chart bars change color to match the KAMA trend, providing a visual confirmation of the current momentum.
  • Signals: Traders often look for price crossovers or changes in the KAMA direction as potential signals for long or short positions.

Details

The script implements Kaufman's Adaptive Moving Average (KAMA) but modifies the standard Efficiency Ratio (ER) calculation. While the original KAMA uses a fixed period for ER, this version utilizes John F. Ehlers' Dominant Cycle algorithm to determine the ideal lookback period.

The execution process follows these steps:

  1. Filtering: A High-Pass filter removes cyclic components shorter than the specified period, followed by a Super Smoother filter to reduce noise.
  2. Correlation: A Pearson correlation is applied across multiple lags to identify cyclical patterns in the data.
  3. Dominant Cycle: The script calculates the Center of Gravity of the spectrum to find the dominant market cycle, constrained between 8 and 14 periods.
  4. KAMA Smoothing: The Efficiency Ratio is derived using this dynamic cycle length. This ratio determines the smoothing constant, which scales between a "fast" and "slow" exponential moving average speed.

Settings

The settings are categorized to allow fine-tuning of the adaptive logic and visual output:

  • Length: Sets the maximum lookback period for the correlation calculations.
  • Fast Length: The period for the fastest EMA used in the smoothing constant calculation (usually 2).
  • Slow Length: The period for the slowest EMA used in the smoothing constant calculation (usually 30).
  • High-Pass Period: The cutoff period for the High-Pass filter to remove low-frequency noise.
  • Source: The price data used for calculations (default is ohlc4).
  • Hysteresis: Toggles the visibility of the buffer bands around the KAMA line.
  • Bar Color: Toggles whether the price bars should be colored based on the KAMA trend direction.

FAQ

How do I interpret the color changes in the KAMA line? A change from red to green indicates that the adaptive average has started sloping upward, suggesting a potential shift to a bullish trend. Conversely, a change from green to red suggests a bearish shift.

What is the benefit of using the Dominant Cycle instead of a fixed period? Market cycles are constantly changing; a fixed period may be too slow for fast markets or too reactive in slow ones. The Dominant Cycle allows the indicator to adapt its lookback period to the current rhythm of the market.

How can I access the kama indicator? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free access on the following platforms
tradingviewSymbolTradingView
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

ninjatraderNinjaTrader
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

metatrader4MetaTrader 4/5
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

thinkorswimThinkorswim
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

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.