…to adaptive

Posted by Scriptaty | 5:24 AM

The AMA builds on the EMA by making it responsive to trend and volatility. The formula is:

AMA = C * (closet-AMA(t-1)) + AMA(t-1)

The difference between the AMA and EMA calculations is the adaptive aspect of the smoothing constant, which is designated in the formula by the letter “C.” There are a few steps involved to arriving at C. The first is calculating the efficiency ratio (ER), which is the ratio of price direction to price volatility.

1. Direction = closet - closet-n
where:

closet = current close

closet-n = close n bars ago.

2. Volatility = sum (absolute value (closet – close(t-1)),n)

(This formula sums the absolute values of the one-bar close-to-close differences over n bars. Kaufman suggested n equal 10.)

For example, if a currency closed up 10 bars in a row, the ER would equal 1 because the direction and the volatility would be equal. If the market moved up and down to close unchanged after 10 bars, the ER would equal zero.

Therefore, the more the market is trending, the higher the ER, and the more the market moves sideways, the smaller the ER value.

The ratio is used as a scaling constant based on the degree of trend between 0 and 1, but not trend in reference to up or down. Because direction could be a negative number, we will take the absolute value of direction/volatility to not have the ratio scale between -1 and 1.

The next step is to establish boundaries for the length of the AMA — i.e., the shortest (fast) and longest (slow) lookback periods it will reflect (since, technically, these could be unlimited). The following formula is used to create a range for the average’s smoothing constant (SSC):

SSC = ER * (FastSC – SlowSC) + SlowSC
where:

ER = efficiency ratio

FastSC = fast EMA smoothing constant

SlowSC = slow EMA smoothing constant

Recall the EMA smoothing constant uses the formula 2/(n+1) to approximate the number of bars in an n-bar SMA. Kaufman suggested the AMA range from a two-bar look-back period (fast) to a 30-bar look-back period (slow). In this case, the resulting smoothing constants would be:

Fast = 2/(2 + 1) = 0.6667

Slow = 2/(30 + 1) = 0.0645

Therefore, SSC = ER * (0.6667 - 0.0645) + 0.0645. If the market is trending, then the ER will be near 1 and the SSC will be weighted toward the fast smoothing constant.

If the market is moving sideways, then the ER will be near 0 and the SSC will be weighted toward the slow smoothing constant.

Finally, Kaufman noted if the market was trading sideways, which would push the AMA to behave like a 30-day EMA, the AMAwould still edge up and down. Squaring the smoothing constant reduces this effect. Therefore:

C = SSC2
and finally,

AMA = C * (closet-AMA(t-1) ) + AMA(t-1)

0 comments