1. Valmy
  2. Learn
  3. Indicator catalog
  4. T10

Which moving average reacts fastest, and what does speed cost?

Intermediate 18 min read

Short answerWith the same lookback, the Hull moving average (HMA) and the double exponential moving average (DEMA) react fastest to a turn, the weighted moving average (WMA) comes next, and the exponential (EMA) and simple (SMA) averages are slowest. Kaufman's adaptive moving average (KAMA) has no fixed speed: it moves fast when price moves cleanly in one direction and almost stops when price chops. On a 20-bar test series built for this lesson, the SMA peaked 7 bars after a top, the EMA 5, the WMA 4, the HMA and DEMA 2 and KAMA 0.

Speed is paid for in three ways. The fastest averages overshoot: they run past a turn and past the price itself. They also follow noise, so they cross price and each other more often in sideways markets. KAMA avoids most noise but can mistake a choppy uptrend for a range. Choosing a faster average therefore means accepting more wrong signals in exchange for fewer late ones.

Valmy noteValmy's v1 strategy language includes the simple moving average and no other indicator, so the WMA, HMA, KAMA and DEMA are taught here for reading charts (as of 26 November 2026).

Speed versus noise: how this lesson compares moving averages#

A fair comparison gives every average the same lookback and the same prices, then measures how late it is and how much noise it passes through. This lesson uses period 20 for the SMA, EMA, WMA, HMA and DEMA, and Kaufman's recommended settings 10, 2 and 30 for KAMA. A moving average here is any line that summarizes recent closes. Lag is how far behind price it runs. Overshoot is how far it travels beyond the price it is following.

The test series is synthetic, and its first part was built from straight lines so the numbers can be checked exactly:

  • Bars 1 to 51: price rises 0.50 USDT per bar from 100 to 125.
  • Bars 52 to 81: price falls 0.75 per bar to 102.5, then stays flat at 102.5 until bar 96.
  • Bars 97 to 141: a random sideways range between closes of 101.29 and 104.25.
  • Bars 142 to 181: a zigzag of +1.20 and −0.90 per bar, a choppy rise from 102.85 to 108.85.

Four measures come from this series:

Average Behind price on the rise (USDT) Bars from the top to its peak Overshoot below the flat (USDT) Travel in the range (USDT)
SMA(20) 4.75 7 none 1.36
EMA(20) 4.75 5 none 2.38
WMA(20) 3.17 4 none 2.35
DEMA(20) 0.00 2 1.74 4.36
HMA(20) 0.33 2 1.42 5.66
KAMA(10, 2, 30) 0.62 0 none 0.91

"Travel in the range" adds up every bar-to-bar move of the average over the last 40 bars of the range, from bar 101 to bar 141. Price itself traveled 17.25 there but changed by only 1.07 net, so most of that movement was noise. An average that travels more is passing more of that noise on to its reader.

Four small bar charts comparing SMA(20), EMA(20), WMA(20), DEMA(20), HMA(20) and KAMA(10,2,30) on one synthetic series. Behind price on a steady rise: 4.75, 4.75, 3.17, 0.00, 0.33, 0.62 USDT. Bars from the top to the average's peak: 7, 5, 4, 2, 2, 0. Overshoot below a flat price: only DEMA 1.74 and HMA 1.42. Travel in a sideways range: 1.36, 2.38, 2.35, 4.36, 5.66, 0.91 USDT, against 17.25 for price.
Figure 1. Synthetic data. The two fastest averages are the only ones that overshoot, and they travel the most in the range.

The pattern: less lag came with more overshoot and more travel in the range, except for KAMA, which was fast on straight lines and quiet in the range. KAMA's weakness shows up in the zigzag, covered in its own section below.

Weighted moving average (WMA): linear weights on recent closes#

The weighted moving average (WMA), also called the linearly weighted moving average, averages the last n closes with weights that rise in a straight line: the oldest close gets weight 1, the next weight 2, and the newest weight n. The weighted sum is divided by the total weight, n(n + 1)/2. Its input is usually the close and its unit is the chart's price unit. There is no standard lookback: TA-Lib's function defaults to 30 bars and this lesson uses 20. No single creator is credited. Because recent closes count more, an n-bar WMA has an average age of (n − 1)/3 bars instead of the SMA's (n − 1)/2, so WMA(20) is centered about 6.33 bars back rather than 9.5. This lesson uses TA-Lib's definition. Note that "weighted" here means weighted by position. The volume-weighted moving average is a different indicator.

Calculating the WMA step by step#

To calculate WMA(5), multiply the last five closes by 1, 2, 3, 4 and 5 (newest last), add the products and divide by 15. The closes are invented (synthetic data).

Bar Close Weighted sum (weights 1 to 5) WMA(5) SMA(5)
1 100
2 101
3 99
4 100
5 100 1×100 + 2×101 + 3×99 + 4×100 + 5×100 = 1,499 99.93 100.0
6 106 1×101 + 2×99 + 3×100 + 4×100 + 5×106 = 1,529 101.93 101.2
7 107 1×99 + 2×100 + 3×100 + 4×106 + 5×107 = 1,558 103.87 102.4
8 106 1×100 + 2×100 + 3×106 + 4×107 + 5×106 = 1,576 105.07 103.8

At bar 6 the jump to 106 gets weight 5, so the WMA moves from 99.93 to 1,529 ÷ 15 = 101.93, a rise of 2.00, while the SMA rises 1.2. By bar 8 the WMA (105.07) is 1.27 above the SMA (103.8). The weights also explain the average age: with n = 20, the weighted average of ages 0 to 19 is 19 ÷ 3 = 6.33 bars.

Reading the WMA on a chart#

Read the WMA like an SMA, with direction from its slope and position relative to price, and expect it to turn a few bars sooner. Figure 2 plots WMA(20) and SMA(20) on the test series (synthetic data). The lower panel shows price minus each average, so a positive value means the average is below price.

Synthetic test series with WMA(20) as a solid line and SMA(20) dashed. On the straight rise WMA trails price by 3.17 USDT and SMA by 4.75. After the top at bar 51 the WMA peaks 4 bars later and the SMA 7 bars later. A lower panel of price minus each average shows the two distances and the noisy range and zigzag.
Figure 2. Synthetic data. The WMA trails by less and turns sooner than the SMA, but it still trails and still turns late.
  1. On the rise, WMA(20) sits 3.17 below price, which is 6.33 bars × 0.50. The SMA sits 4.75 below.
  2. After the top at bar 51, the WMA peaks 4 bars later and the SMA 7 bars later. Both stay below the top price of 125: the WMA's peak is 2.30 lower and the SMA's is 3.00 lower.
  3. In the range, the WMA follows the noise a little more than the SMA: it traveled 2.35 against 1.36.

When the WMA misleads#

The WMA misleads when its smoother look is taken for a lag-free line. It is still an average of past closes with only positive weights, so it can never get ahead of price, and in a steady trend it trails by a fixed distance. In the zigzag at the end of the test series, it ended 0.45 below price. In a range its crossings come late in the same way as the SMA's. The WMA is a modest improvement in timing, not a different kind of tool.

Hull moving average (HMA): extrapolating to cut lag#

The Hull moving average (HMA), developed by Alan Hull in 2005, removes most of a weighted average's lag by extrapolating: it takes twice a half-length WMA minus a full-length WMA, which pushes the line ahead of the slower average, and then smooths the result with a short WMA. In Hull's notation the formula is HMA = WMA over √n bars of [2 × WMA(n/2) − WMA(n)], with n/2 and √n rounded down to whole numbers. Its input is usually the close and its unit is the chart's price unit. Hull's published code uses a default period of 20, as does this lesson: WMA(10), WMA(20) and a final WMA over 4 bars, since √20 ≈ 4.47 rounds down to 4. HMA(20) has no value until bar 23.

Calculating the HMA step by step#

To keep the example short, use HMA(4): n/2 = 2 and √4 = 2. At each bar, compute WMA(2) and WMA(4) of the closes, then raw = 2 × WMA(2) − WMA(4), and finally the HMA as WMA(2) of the raw values (synthetic data, same closes as above).

Bar Close WMA(2) WMA(4) Raw = 2 × WMA(2) − WMA(4) HMA(4) = WMA(2) of raw
4 100 99.67 99.9 99.43
5 100 100.00 99.9 100.10 99.88
6 106 104.00 102.3 105.70 103.83
7 107 106.67 104.6 108.73 107.72
8 106 106.33 105.7 106.97 107.56
  • WMA(2) at bar 6 = (1 × 100 + 2 × 106) ÷ 3 = 104.00. WMA(4) at bar 6 = (1 × 99 + 2 × 100 + 3 × 100 + 4 × 106) ÷ 10 = 102.3.
  • Raw at bar 6 = 2 × 104.00 − 102.3 = 105.70. The raw value projects the recent change forward.
  • HMA(4) at bar 7 = (1 × 105.70 + 2 × 108.73) ÷ 3 = 107.72.

At bar 7 the HMA (107.72) is 0.72 above the highest close so far (107). No ordinary average can do that, because it only mixes closes that happened. The HMA can, because of the minus sign in its formula. This is the overshoot that comes with its speed.

Reading the HMA on a chart#

Read the HMA mainly by its turning points: when it changes direction, the recent change in price has reversed. Hull's own guidance is to use those turning points rather than crossovers, since crossover signals depend on lag. Figure 3 plots HMA(20) and SMA(20) on the test series (synthetic data).

Synthetic test series with HMA(20) solid and SMA(20) dashed. HMA follows the straight rise 0.33 below price, peaks 2 bars after the top at 125.18, 0.18 above the top close, and falls to 101.08 while price is flat at 102.5, an overshoot of 1.42. In the range and the zigzag it swings with price. The lower panel shows price minus HMA spiking at the flat.
Figure 3. Synthetic data. The HMA turns 2 bars after the top but runs past price at both turns.
  1. On the rise, HMA(20) sits only 0.33 below price, two thirds of a bar of lag.
  2. At the top, it peaks 2 bars later at 125.18, which is 0.18 above the highest close of 125.
  3. At the flat, price stops at 102.5 but the HMA keeps falling for 5 more bars, to 101.08 at bar 86: 1.42 below a price that is not moving.

When the HMA misleads: overshoot and noise#

The HMA misleads when its overshoot is read as price information. At bar 86 of the test series it pointed down and sat 1.42 below a flat price, so a trader watching only the HMA would have seen a decline that was not happening. The same extrapolation makes it follow noise: in the sideways range it traveled 5.66, about four times the SMA's 1.36, and it changed direction many times. In the zigzag it ended 0.41 above price, because it projects each up-and-down swing forward. A turning HMA is a quick sign that the recent change has reversed, not a guarantee that a new trend has begun.

Kaufman adaptive moving average (KAMA): speed set by the efficiency ratio#

The Kaufman adaptive moving average (KAMA), developed by Perry Kaufman and described in his 1995 book Smarter Trading, adjusts its own speed bar by bar. It measures how efficiently price has moved with the efficiency ratio (ER): the net change over the last n bars divided by the sum of the absolute bar-to-bar changes over those bars. ER is 1 when every bar moved the same way and near 0 when price went back and forth and ended where it started. KAMA then moves toward the latest close by a smoothing constant, SC = [ER × (2/3 − 2/31) + 2/31]², which ranges from (2/3)² = 0.444 when ER is 1 to (2/31)² = 0.0042 when ER is 0. Squaring makes KAMA slow down sharply when price chops. The recommended settings attributed to Kaufman are 10, 2 and 30: a 10-bar ER, a fast constant from 2 bars and a slow one from 30 bars. The input is usually the close and the unit is the chart's price unit. Platforms differ in the details: TA-Lib starts KAMA from the previous close and its KAMA function defaults the ER period to 30, so set it to 10 to match. StockCharts starts from a simple average.

Calculating KAMA step by step#

To keep the table short, use a 3-bar ER (with the usual 2 and 30). The fast constant is 2/3 = 0.6667 and the slow constant is 2/31 = 0.0645. Following TA-Lib, KAMA starts at bar 3 from that bar's close, 99 (synthetic data, same closes as above).

Bar Close Net change over 3 bars Sum of bar changes ER SC KAMA
3 99 99.00 (start)
4 100 |100 − 100| = 0 1 + 2 + 1 = 4 0.00 0.0042 99.00
5 100 |100 − 101| = 1 2 + 1 + 0 = 3 0.33 0.0703 99.07
6 106 |106 − 99| = 7 1 + 0 + 6 = 7 1.00 0.4444 102.15
7 107 |107 − 100| = 7 0 + 6 + 1 = 7 1.00 0.4444 104.31
8 106 |106 − 100| = 6 6 + 1 + 1 = 8 0.75 0.2664 104.76
  • Bar 4: price went up 1, down 2 and up 1, ending where it started, so ER = 0 and SC = 0.0645² = 0.0042. KAMA moves only 0.0042 × (100 − 99) = 0.0042, to 99.0042.
  • Bar 6: all three moves since bar 3 added to the rise, so ER = 1 and SC = 0.6667² = 0.4444. KAMA moves 0.4444 × (106 − 99.07) = 3.08, to 102.15.
  • Bar 8: ER = 6 ÷ 8 = 0.75, SC = (0.75 × 0.6022 + 0.0645)² = 0.2664, and KAMA = 104.31 + 0.2664 × (106 − 104.31) = 104.76.

During the chop of bars 4 and 5, KAMA barely moved. When price moved cleanly, it covered nearly half the distance in one bar.

Reading KAMA on a chart#

Read KAMA together with its efficiency ratio: a rising or falling KAMA with a high ER says price is moving cleanly in one direction, and a flat KAMA with a low ER says price is churning. Figure 4 plots KAMA(10, 2, 30) and SMA(20) on the test series, with the 10-bar ER below (synthetic data).

Synthetic test series with KAMA(10,2,30) solid and SMA(20) dashed, and a lower panel of the 10-bar efficiency ratio. ER is 1.00 on the straight rise and fall and KAMA stays 0.62 below price on the rise. In the range ER averages 0.18 and KAMA is nearly flat. In the zigzag ER is 0.14 and KAMA ends 3.56 below price.
Figure 4. Synthetic data. KAMA hugs clean moves, goes flat in the range and falls behind in the choppy rise.
  1. On the straight rise and fall, ER is 1.00, SC is 0.4444 and KAMA trails by only 0.62, which is (1 − 4/9) ÷ (4/9) × 0.50 = 0.625. It peaks at the same bar as price, so the "bars from the top" measure is 0.
  2. In the range, ER averages 0.18 over the last 40 bars and KAMA traveled only 0.91, less than any other average.
  3. In the zigzag, ER stays at 1.5 ÷ 10.5 = 0.14 and KAMA falls behind, as the next subsection shows.

When KAMA misleads: a choppy trend looks like a range#

KAMA misleads when a trend is real but noisy. The efficiency ratio cannot tell a choppy rise from a range, because both have a lot of back-and-forth movement for a small net change. In the zigzag at bars 142 to 181, price rose +1.20, fell −0.90, and so on, gaining 6.00 over 40 bars. The ER was 0.14, giving a smoothing constant of 0.023, about the same as a plain EMA with a period of 87 bars. KAMA rose only 2.79 and ended 3.56 below price. SMA(20) rose 5.41 and ended 0.90 below. A reader who took the flat-looking KAMA to mean "no trend" would have missed most of the move.

The second trap is the setting. TA-Lib's KAMA function defaults its ER period to 30 bars, not Kaufman's 10, and the starting value differs between platforms. Two charts labeled "KAMA" can show different lines unless the period and the starting rule match.

Double exponential moving average (DEMA): EMA plus a lag correction#

The double exponential moving average (DEMA), introduced by Patrick Mulloy in Technical Analysis of Stocks & Commodities in January 1994, cancels most of an EMA's lag by adding back an estimate of it. The formula is DEMA = 2 × EMA(n) − EMA(EMA(n)): the EMA of the EMA lags about twice as much as the EMA, so their difference estimates the lag, and adding it once more moves the line ahead. Despite the name, it is not an EMA applied twice, which would lag more. Its input is usually the close and its unit is the chart's price unit. Each EMA uses α = 2 ÷ (n + 1). TA-Lib's function defaults to 30 bars, and this lesson uses 20. Because the second EMA needs n values of the first, TA-Lib's DEMA(20) has no value until bar 39.

Calculating DEMA step by step#

To keep the numbers simple, use DEMA(3), where α = 2 ÷ 4 = 0.5: each EMA moves halfway toward its input. Following TA-Lib, the first EMA starts at bar 3 from the average of the first three closes, and the EMA of the EMA starts at bar 5 from the average of the first three EMA values (synthetic data, same closes as above).

Bar Close EMA(3) EMA of EMA(3) DEMA(3) = 2 × EMA − EMA of EMA
3 99 100.0 (start)
4 100 100.0
5 100 100.0 100.0 (start) 100.0
6 106 103.0 101.5 104.5
7 107 105.0 103.25 106.75
8 106 105.5 104.375 106.625
  • EMA(3) at bar 6 = 100 + 0.5 × (106 − 100) = 103.0. The EMA of the EMA = 100 + 0.5 × (103 − 100) = 101.5.
  • DEMA at bar 6 = 2 × 103.0 − 101.5 = 104.5, already 1.5 above the EMA.
  • At bar 8, DEMA = 2 × 105.5 − 104.375 = 106.625, while the EMA reads 105.5.

Reading DEMA on a chart#

Read DEMA as a faster EMA: in a steady trend it sits close to price, and its turns come soon after price turns. Figure 5 plots DEMA(20) and EMA(20) on the test series (synthetic data).

Synthetic test series with DEMA(20) solid and EMA(20) dashed. During the straight rise DEMA sits exactly on price while EMA trails by 4.75. DEMA peaks 2 bars after the top at 125.35, 0.35 above the top close, and falls to 100.76 at bar 94 while price is flat at 102.5, an overshoot of 1.74. The lower panel shows price minus each average.
Figure 5. Synthetic data. DEMA removes the EMA's lag on a straight line, then overshoots when the line bends.
  1. On the rise, DEMA(20) sits exactly on price: the lag correction is exact for a straight line. EMA(20) trails by 4.75.
  2. At the top, DEMA peaks 2 bars later at 125.35, 0.35 above the top close.
  3. At the flat, DEMA keeps falling for 13 bars after price stops, to 100.76 at bar 94, which is 1.74 below the flat price.

When DEMA misleads: overshoot and a long warm-up#

DEMA misleads around turns and at the start of the data. Its lag correction assumes the recent trend continues, so when price bends it overshoots and then takes many bars to settle: at the flat it was still drifting below price 13 bars after price had stopped. In the sideways range it traveled 4.36, three times the SMA's 1.36. It also needs a longer warm-up than an EMA of the same period, and because it is built from two EMAs, its early values depend on how each EMA is started. Mulloy's article proposed DEMA as a faster input for other indicators such as MACD, which shows the trade-off clearly: a faster input makes those indicators turn sooner and also signal more often.

What could change the comparison#

The ranking above holds for one series and one period. Three things can change it.

  • The period. Any average gets faster with a shorter lookback. SMA(9) has the same average age, 4 bars, as WMA(13) or EMA(9). Comparing a 20-bar HMA with a 20-bar SMA mixes two choices: the type of average and how much history it uses. A fair test also tries the slower averages with shorter periods.
  • The market. Straight lines make lag and overshoot exact, but real prices bend gradually. On real data the HMA and DEMA overshoot by amounts that depend on how sharp the turn is, and KAMA's speed depends on how noisy the trend is.
  • Gaps between sessions. These averages count bars. On a US stock chart, an overnight gap enters as one large bar-to-bar change, which an extrapolating average projects forward and KAMA's efficiency ratio counts as directional movement. Crypto pairs trade continuously, so gaps are rarer, but large single-bar moves have the same effect.

In Valmy v1 the only average a strategy can use is the SMA, so the practical lever is its period: a shorter SMA reacts sooner and whipsaws more, as What does a moving average actually measure? shows with a five-minute crossover.

Check your understanding: four faster averages#

Part 1, WMA. The last three closes were 20, 21 and 23 USDT. What are WMA(3) and SMA(3), and why does the WMA read higher?

Part 2, HMA. For an HMA(16), the raw values 2 × WMA(8) − WMA(16) on the last four bars were 50.2, 50.6, 51.0 and 51.4. What is the HMA? The highest close over those bars was 50.9. How can the HMA be above it?

Part 3, KAMA. Over the last 10 bars price rose 2.00 net, but the bar-to-bar changes added up to 8.00. The previous KAMA (10, 2, 30) was 100.00 and the latest close is 101.00. What is the new KAMA? What would it be if every bar had moved up?

Part 4, DEMA. EMA(10) of the closes is 52.0 and the EMA of that EMA is 51.4. The latest close is 52.3. What is DEMA(10), and what does its position relative to price suggest?

Show the answers

Answer.

  1. WMA(3) = (1 × 20 + 2 × 21 + 3 × 23) ÷ 6 = 131 ÷ 6 = 21.83. SMA(3) = 64 ÷ 3 = 21.33. The newest close, 23, carries half of the WMA's weight (3 of 6), so the WMA sits closer to it.
  2. The outer average has √16 = 4 bars: HMA = (1 × 50.2 + 2 × 50.6 + 3 × 51.0 + 4 × 51.4) ÷ 10 = 510.0 ÷ 10 = 51.0. The raw values extrapolate the recent change: twice the faster WMA minus the slower one projects price beyond its latest level, so the HMA can sit above every recent close. That is overshoot, not a forecast.
  3. ER = 2.00 ÷ 8.00 = 0.25. SC = (0.25 × (0.6667 − 0.0645) + 0.0645)² = 0.2151² = 0.0462. New KAMA = 100.00 + 0.0462 × (101.00 − 100.00) = 100.05. If every bar had moved up, ER = 1, SC = 0.6667² = 0.4444 and KAMA = 100.44. The choppier the path, the less KAMA moves.
  4. DEMA = 2 × 52.0 − 51.4 = 52.6, which is 0.30 above the latest close of 52.3. A DEMA above price after a rise is a sign that it is projecting the earlier trend forward. If price has stalled, the DEMA is likely overshooting, as at the top and the flat in Figure 5.