[blackcat] L2 Perry Kaufman Adaptive MA (KAMA)

Background
Kaufman’s Adaptive Moving Average (KAMA) was developed by American quantitative financial theorist Perry J. Kaufman in 1998. The technique began in 1972 but Kaufman officially presented it to the public much later through his book, “Trading Systems and Methods.” Unlike other moving averages, Kaufman’s Adaptive Moving Average accounts not only for price action but also for market volatility. KAMA is a moving average that takes into account market noise or volatility. KAMA will closely track prices when price fluctuations are relatively small and noise is low. KAMA will adapt to increasing price fluctuations and track prices from a greater distance. This trend following indicator can be used to identify the overall trend, time turning points and to filter price movements.
Function
You can use KAMA like any other trend-following indicator, such as a moving average. You can look for price crosses, directional changes and filtered signals. First, a cross above or below KAMA indicates directional changes in prices. As with any moving average, a simple crossover system will generate lots of signals and lots of whipsaws. Second, You can use the direction of KAMA to define the overall trend for a security. This may require a parameter adjustment to smooth the indicator further. You can change the fastline and slowline parameters to smooth KAMA and look for directional changes. The trend is down as long as KAMA is falling and forging lower lows. The trend is up as long as KAMA is rising and forging higher highs. Finally, You can combine signals and techniques. You can use a longer-term KAMA to define the bigger trend and a shorter-term KAMA for trading signals.
I have included in the indicator an input named "EnableSmooth" that allows you to determine if the KAMA line should be smoothed or not. A "True" as the input value smoothes the calculation. An "False" simply plots the raw KAMA line. When market volatility is low, Kaufman’s Adaptive Moving Average remains near the current market price, but when volatility increases, it will lag behind. What the KAMA indicator aims to do is filter out “market noise” – insignificant, temporary surges in price action. One of the primary weaknesses of traditional moving averages is that when used for trading signals, they tend to generate many false signals. The KAMA indicator seeks to lessen this tendency – generate fewer false signals – by not responding to short-term, insignificant price movements. Traders generally use the moving average indicator to identify market trends and reversals.
Key Signal
AMAValF --> KAMA Fast Line.
AMAValS --> KAMA Slow Line.
Remarks
This is a Level 2 free and open source indicator.
Feedbacks are appreciated.
This script implements the Perry Kaufman Adaptive Moving Average (KAMA) indicator, developed by blackcat1402. It provides traders with two customizable AMA lines: a fast and a slow line, which can be used to identify potential entry and exit points in the market. The indicator adapts its sensitivity based on market volatility, making it particularly useful during both trending and ranging conditions.
FEATURES
• Adaptive Moving Average (AMA) calculation with customizable periods
• Optional smoothing functionality for more refined signals
• Visual representation through colored AMA lines and fill areas
• Real-time trading signals with BUY/SELL labels
• Alert notifications for trading opportunities
HOW TO USE
Configure Parameters:
Set the Price Source (default: Close price)
Adjust Fast Period (default: 13)
Modify Slow Period (default: 55)
Toggle Smoothing option as needed
Interpret Signals:
Look for crossovers between fast and slow AMA lines
Green BUY signals appear when fast AMA crosses above slow AMA
Red SELL signals occur when fast AMA crosses below slow AMA
Visual Analysis:
Yellow line represents Fast AMA
Fuchsia line indicates Slow AMA
Colored fill area highlights potential trend direction
LIMITATIONS
• Indicator performance may vary across different timeframes and asset classes
• Best results achieved when combined with other technical analysis tools
• May generate false signals during high-volatility periods
NOTES
• Script requires minimum 5000 bars of historical data
• Compatible with TradingView's Pine Script v5
• Open-source code available under Mozilla Public License 2.0
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.
Penafian
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.