azguer

Adaptive Moving Average (AMA)

The Adaptive Moving Average (AMA), also known as Kaufman's Adaptive Moving Average (KAMA), is a trend-following indicator that adapts to market volatility. It was developed by Perry Kaufman in 1972 to improve upon traditional moving averages by making the smoothing period dynamic based on market conditions.

The AMA aims to:

- Smooth out price data to reduce noise, similar to other moving averages.
- Adapt its smoothing based on market volatility and trend strength.

Here's how the Adaptive Moving Average (AMA) works:

1. Calculate the Efficiency Ratio (ER): The AMA begins by calculating the Efficiency Ratio (ER), which measures the efficiency of a price trend. It's calculated as the absolute change in closing prices over a period (`PeriodEfficiencyRatio`) divided by the sum of absolute changes in closing prices over the same period. The ER value ranges from 0 to 1, with higher values indicating a stronger trend.

2. Determine the Smoothing Constant (sc): Using the ER, the AMA calculates the smoothing constant (sc). This constant ranges between a predefined slow EMA (exponential moving average) and fast EMA, depending on the ER.

3. Compute the AMA value: The AMA is then calculated using the smoothing constant (sc) and the previous AMA value, as well as the current close price. This allows the AMA to adapt its smoothing based on the market's volatility.

4. Plot the AMA: The AMA is plotted on the chart, usually as a line, which follows the price action more closely in periods of strong trends and provides more smoothing in periods of lower volatility.

Usage and Interpretation:

- The Adaptive Moving Average can be used to identify trends and potential entry and exit points.
- When the price is above the AMA line, it may indicate an uptrend, and when the price is below the AMA line, it may indicate a downtrend.
- Crossovers of the price with the AMA line can signal potential buy or sell opportunities.
- The adaptability of the AMA makes it more responsive in trending markets and smoother in range-bound markets, providing an advantage over traditional moving averages.

Parameters:

- Period for EfficiencyRatio calculation (`PeriodEfficiencyRatio`):** The period over which the Efficiency Ratio is calculated.
- Fast EMA Length (`fastLength`) and Slow EMA Length (`slowLength`):** These parameters define the range for the smoothing constant. A shorter fast length makes the AMA more responsive, while a longer slow length makes it smoother.

The AMA can be a useful tool in a trader's toolkit for analyzing market trends and making informed trading decisions. Adjusting the parameters can fine-tune the AMA for different trading styles and market conditions.
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?