First and Second Derivatives from AMA Kaufman
The
Adaptive Moving Average
A dynamic and accurate indicator is such that makes a moving average more receptive to volatility changes.
The simplification of the market highs and lows into a more comprehensible trend followed by the even price data, are the true function of Moving Averages. However, the process of getting even data brings in lag: with a longer look-back period of a moving average, the average tracks behind the changes in the direction of price increases. Alike, with a shorter look-back period of a moving average, the response to price changes is quicker but, as the movement of minor prices change directions, a loss can be predictable.
The appropriate length of a moving average might not be seen every one, if this week it is showing an appropriate length, the next week’s length might be inappropriate, with the change in the market trend. But there is a potential way of dealing with this issue, use the moving average that can be adjusted with the volatility of the market by broadening the sideways movement of the market and going for a more choppy way of trading, thus making things less responsive, and when the market is seen to be trending, there is a cut that makes the market more responsive.
In the book Smarter Trading, by Perry Kaufman (Mcgraw-Hill, 1995), a thorough method of an adaptive moving average calculation has been stated that fits the role. Let us see how it works with the help of an example and also let us make a comparison between this and the Simple moving average or SMA. First, we take the two different look-back periods of two different SMAs. This will be compared and the attributes of each of these will be highlighted. Here, the price that is crossing the moving average is not of primary importance, rather, the identification if the trend is done with the help of the moving average’s direction.

Example- 1
The figure 1 shows a 30 min bar chart of the USDJPY pair with the help of five-bar SMA (red) and 30-bar SMA (blue).

The fig.2 also shows a similar price with an exception of an added adaptive moving average or AMA. The AMA tends to adapt to the volatility of the market and switches to short-term-look-back period when the market is showing an upward or a downward trend and with the sideways movement of the market the changes to a long-term-look-back period.
From exponential
AMA was designed by Kaufman to track the noise and its degree in the following trend. An example, if there is an advancement of the market with small and countered moves, with very less noise you would also want to closely track the moving average that has a shot look-back period.
But, the market shows a sideways movement and the closure tends to reverse from a period to the other, then you would like to have a longer look-back period with high noise; this will allow you to filter out the excess noise and also avoid wrong signals. The modification of the EMA is what Kaufman technique is meant to do. An algorithm is given to adjust the smoothing constant or SC of averages per the ratio of the market direction to its volatility.
The formula is:
EMA= SC* (close-EMA (-1)) + EMA -1
Here,
SC is the smoothing constant
Close is the closure bar.
EMA (-1) is the EMA reading of the previous bar/
The value of smoothing constant is either 0 or 1 and helps in determining the length of the EMA. The formula used for the conversion of SMA look-back period to an EMA smoothing constant is:
SC=2 / (n+1)
Here, n refers to the look-back period in SMA.
For example, an SMA of 10-period is equal to an EMA having 0.1818 smoothing constant, using the above mentioned formula sc= 2/ [10+1].
There is a point if difference between SMA and EMA. The EMA is calculated by taking out the difference between the EMA and the close. As such, if the close is higher than the EMA, for the first time, the difference will be positive and the EMA will rise up. Alike, if the lose is lower than the EMA, for the first time, the result is negative and the EMA will go down.
An SMA changes its direction not only because of its relationships but also because of the close being used in the average calculations. For an SMA of 10-period, the present close will be only one tenth of the total; 10 closes which are used to calculate the indicator. The result is that the SMA is not responsive ton the quick changes in price. The EMA are a better option to deal with these issues.
To adaptive
The AMA can make the EMA more responsive to volatility and trend, by building on it. The formula used is-
AMA= c* (closet-AMA (t-1)) + AMA (t-1)
The difference of the EMA and the AMA calculations is the adaptive part of SC and is denoted by “C”. First, we need to calculate the efficiency ratio, which is the price direction ratio to volatility of price.
Direction = close t – close t-n
Here,
Closet = current close
Close t-n = close n bars ago.
Volatility = SUM {absolute value (closet – close (t-1)), n}
This formula gives the sum of the absolute values of one-bar close-to-close differences of n bars. Kaufman says that n is equal to 10.
For example, if a currency pair has closed 10 bars up in a row, the ER would then be equal to 1 as the volatility and the direction are equal. If the market showed either upward or downward movement to close without any change after 10 bars, the ER would be equal to 0.therefore, it can be said that the more the market tends, the higher goes the ER, and the more the market makes a sideways movement, the smaller the value of ER.
The ratio can be used as scaling constant based on the trend and its degree, between 0 & 1, but not in case of trend that is moving up or down. We will preferably take an absolute value of volatility / direction, to avoid the direction from being a negative number. The ratio should not show a scale of -1 and 1.
The further step is to make a boundary for the AMAs length; the shortest length (fast) and the longest length (slow) of look-back periods will be reflected (these are technically unlimited). The formula mentioned below is used to make a range for the smoothing constant of an average (ssc)-
ssc = ER*( fast sc – slow sc )+ slow sc
Here,
ER is the efficiency ratio
fast sc is the fast EMA smoothing constant
slow sc is the slow EM smoothing constant
Call to mind the EMA SC using the formula 2 / (n+1) to derive an approximate number of bars in an SMA n bar. Kaufman has suggested a range of AMA from that of a fast two-bar-lock-back period to a slow 30-bar-lock-back period, thus giving smoothing constants as results-
fast = 2 / (2+1) = 0.6667
slow = 2 / (30+1) = 0.0645
Therefore, ssc = ER* (0.6667 – 0.0645) + 0.0645
If you note a trending market, then it is likely that the ER will be close to 1 and ssc will be subjective to the fast ssc. If the market shows a sideways, then the ER is close to 0 and the ssc will be subjective to the slow moving constant.
Finally, it was also noted by Kaufman that if the market shows a sideways trading movement, it would drive the AMA to perform like 30-day EMA, the AMA to be following the up and down edge. The effect can be reduced by squaring the ssc. Therefore:
C = ssc 2
And then finally,
AMA = C* (close t –AMA (t-1)) + AMA (t-1)
Flexibility and responsiveness
The strength of AMA lies in the fact that it can respond to the changes in the conditions o the market, which is an issue with studies using fixed-look-back periods.
While using a fixed look-back period it seems like we are fitting the market to a template. As the market tends keep on changing it is very difficult to settle down for a static approach. Adaptive studies and its usage is a very potential way of resolving such issues and improving results. Also, the AMA is ideally the best for the smoothing of other indicators.
First and Second Derivatives

First Derivative show velocity of moving (AMA Kaufman) change
Second Derivative show acceleration of moving (AMA Kaufman) change
We have developed First and Second Derivatives for AMA Kaufman Metatrader Indicators
BJF Trading Group
http://iticsoftware.com
and © kroufr
A dynamic and accurate indicator is such that makes a moving average more receptive to volatility changes.
The simplification of the market highs and lows into a more comprehensible trend followed by the even price data, are the true function of Moving Averages. However, the process of getting even data brings in lag: with a longer look-back period of a moving average, the average tracks behind the changes in the direction of price increases. Alike, with a shorter look-back period of a moving average, the response to price changes is quicker but, as the movement of minor prices change directions, a loss can be predictable.
The appropriate length of a moving average might not be seen every one, if this week it is showing an appropriate length, the next week’s length might be inappropriate, with the change in the market trend. But there is a potential way of dealing with this issue, use the moving average that can be adjusted with the volatility of the market by broadening the sideways movement of the market and going for a more choppy way of trading, thus making things less responsive, and when the market is seen to be trending, there is a cut that makes the market more responsive.
In the book Smarter Trading, by Perry Kaufman (Mcgraw-Hill, 1995), a thorough method of an adaptive moving average calculation has been stated that fits the role. Let us see how it works with the help of an example and also let us make a comparison between this and the Simple moving average or SMA. First, we take the two different look-back periods of two different SMAs. This will be compared and the attributes of each of these will be highlighted. Here, the price that is crossing the moving average is not of primary importance, rather, the identification if the trend is done with the help of the moving average’s direction.

Example- 1
The figure 1 shows a 30 min bar chart of the USDJPY pair with the help of five-bar SMA (red) and 30-bar SMA (blue).

The fig.2 also shows a similar price with an exception of an added adaptive moving average or AMA. The AMA tends to adapt to the volatility of the market and switches to short-term-look-back period when the market is showing an upward or a downward trend and with the sideways movement of the market the changes to a long-term-look-back period.
From exponential
AMA was designed by Kaufman to track the noise and its degree in the following trend. An example, if there is an advancement of the market with small and countered moves, with very less noise you would also want to closely track the moving average that has a shot look-back period.
But, the market shows a sideways movement and the closure tends to reverse from a period to the other, then you would like to have a longer look-back period with high noise; this will allow you to filter out the excess noise and also avoid wrong signals. The modification of the EMA is what Kaufman technique is meant to do. An algorithm is given to adjust the smoothing constant or SC of averages per the ratio of the market direction to its volatility.
The formula is:
EMA= SC* (close-EMA (-1)) + EMA -1
Here,
SC is the smoothing constant
Close is the closure bar.
EMA (-1) is the EMA reading of the previous bar/
The value of smoothing constant is either 0 or 1 and helps in determining the length of the EMA. The formula used for the conversion of SMA look-back period to an EMA smoothing constant is:
SC=2 / (n+1)
Here, n refers to the look-back period in SMA.
For example, an SMA of 10-period is equal to an EMA having 0.1818 smoothing constant, using the above mentioned formula sc= 2/ [10+1].
There is a point if difference between SMA and EMA. The EMA is calculated by taking out the difference between the EMA and the close. As such, if the close is higher than the EMA, for the first time, the difference will be positive and the EMA will rise up. Alike, if the lose is lower than the EMA, for the first time, the result is negative and the EMA will go down.
An SMA changes its direction not only because of its relationships but also because of the close being used in the average calculations. For an SMA of 10-period, the present close will be only one tenth of the total; 10 closes which are used to calculate the indicator. The result is that the SMA is not responsive ton the quick changes in price. The EMA are a better option to deal with these issues.
To adaptive
The AMA can make the EMA more responsive to volatility and trend, by building on it. The formula used is-
AMA= c* (closet-AMA (t-1)) + AMA (t-1)
The difference of the EMA and the AMA calculations is the adaptive part of SC and is denoted by “C”. First, we need to calculate the efficiency ratio, which is the price direction ratio to volatility of price.
Direction = close t – close t-n
Here,
Closet = current close
Close t-n = close n bars ago.
Volatility = SUM {absolute value (closet – close (t-1)), n}
This formula gives the sum of the absolute values of one-bar close-to-close differences of n bars. Kaufman says that n is equal to 10.
For example, if a currency pair has closed 10 bars up in a row, the ER would then be equal to 1 as the volatility and the direction are equal. If the market showed either upward or downward movement to close without any change after 10 bars, the ER would be equal to 0.therefore, it can be said that the more the market tends, the higher goes the ER, and the more the market makes a sideways movement, the smaller the value of ER.
The ratio can be used as scaling constant based on the trend and its degree, between 0 & 1, but not in case of trend that is moving up or down. We will preferably take an absolute value of volatility / direction, to avoid the direction from being a negative number. The ratio should not show a scale of -1 and 1.
The further step is to make a boundary for the AMAs length; the shortest length (fast) and the longest length (slow) of look-back periods will be reflected (these are technically unlimited). The formula mentioned below is used to make a range for the smoothing constant of an average (ssc)-
ssc = ER*( fast sc – slow sc )+ slow sc
Here,
ER is the efficiency ratio
fast sc is the fast EMA smoothing constant
slow sc is the slow EM smoothing constant
Call to mind the EMA SC using the formula 2 / (n+1) to derive an approximate number of bars in an SMA n bar. Kaufman has suggested a range of AMA from that of a fast two-bar-lock-back period to a slow 30-bar-lock-back period, thus giving smoothing constants as results-
fast = 2 / (2+1) = 0.6667
slow = 2 / (30+1) = 0.0645
Therefore, ssc = ER* (0.6667 – 0.0645) + 0.0645
If you note a trending market, then it is likely that the ER will be close to 1 and ssc will be subjective to the fast ssc. If the market shows a sideways, then the ER is close to 0 and the ssc will be subjective to the slow moving constant.
Finally, it was also noted by Kaufman that if the market shows a sideways trading movement, it would drive the AMA to perform like 30-day EMA, the AMA to be following the up and down edge. The effect can be reduced by squaring the ssc. Therefore:
C = ssc 2
And then finally,
AMA = C* (close t –AMA (t-1)) + AMA (t-1)
Flexibility and responsiveness
The strength of AMA lies in the fact that it can respond to the changes in the conditions o the market, which is an issue with studies using fixed-look-back periods.
While using a fixed look-back period it seems like we are fitting the market to a template. As the market tends keep on changing it is very difficult to settle down for a static approach. Adaptive studies and its usage is a very potential way of resolving such issues and improving results. Also, the AMA is ideally the best for the smoothing of other indicators.
First and Second Derivatives

First Derivative show velocity of moving (AMA Kaufman) change
Second Derivative show acceleration of moving (AMA Kaufman) change
We have developed First and Second Derivatives for AMA Kaufman Metatrader Indicators
BJF Trading Group
http://iticsoftware.com
and © kroufr





Comments