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, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.

Хотите использовать этот скрипт на графике?