MovAvgAdaptive

Description

The Adaptive Moving Average (AMA) is a moving average that changes its sensitivity to price moves depending on the calculated volatility. It becomes more sensitive during periods when the price is moving smoothly in a certain direction and becomes less sensitive when the price is volatile. This is done by calculating the Efficiency Ratio (ER), a measure of relative trend strength.

There are two modes of calculation of the Adaptive Moving Average, which are different in how the ER is calculated: KAMA (Kaufman Adaptive Moving Average) and AMA (Adaptive Moving Average). In KAMA, the ER is calculated as the ratio of directional value (the absolute value of momentum) to volatility (calculated here as the sum of absolute values of price changes on the bar-by-bar basis over a certain time period). In AMA, the ER accounts for the location of the close price relative to the high-low range. The default period for the ER calculation in either mode is 10 bars.

Based on the ER value, the indicator selects a smoothing coefficient for the exponential moving average to be applied to the price data. By default, the maximum possible value of the ER (perfect trending conditions) corresponds to the smoothing coefficient of a 30-period EMA, while the minimum possible ER value (conditions of extreme volatility) corresponds to that of a 2-period EMA. ER values in between correspond to smoothing constants derived from a quadratic equation proposed by Perry Kaufman.

Input Parameters

Parameter Description

price

The price with which the Adaptive Moving Average will be calculated.

fast length

The length of the EMA that corresponds to the minimum possible Efficiency Ratio coefficent, conditions of extreme volatility. 

slow length

The length of the EMA that corresponds to the maximum possible Efficiency Ratio coefficient, trending conditions of extreme strength.

eff ratio length

The period over which the Efficiency Ratio will be calculated.

mode

Defines the mode of calculation of the indicator: KAMA or AMA.

Plots

Plot Description

MovAvgAdaptive

The Adaptive Moving Average plot.

Further Reading

1."Adaptive Moving Averages" by Vitali Apirine. Technical Analysis of Stocks & Commodities, April 2018.

Example*

*For illustrative purposes only. Not a recommendation of a specific security or investment strategy.

  Past performance is no guarantee of future performance.

You may also like
MomentumPercentDiff
The Momentum Percent Diff is a momentum-based technical indicator. Unlike the regular Momentum ...
WilliamsAD
The Williams Accumulation/Distribution study is used to determine either the marketplace is ...
ATR
The Average True Range (ATR) study calculates the average true price range over a time period. ...