Charts See the terminal

Moving Average Hamming

A very smooth average that weights the middle of its window most and both ends least, useful when a clean line matters more than speed.

Moving Average Add to chart

Live Hamming Moving Average preview · BTC/USDT · Binance

What is Hamming Moving Average?

The Hamming moving average is a weighted average that borrows its weights from the Hamming window used in signal processing. The weights form a symmetric hill across the window, peaking in the middle and falling to a small value at both ends. The result is a line that is noticeably smoother than a simple average of the same length.

Unlike a weighted or exponential average, it does not favour the newest bar. It smooths price heavily and lags by about half its window. It does not turn early, confirm trend strength or predict future prices.

How to use Hamming Moving Average

  • Price above or below the line. Price holding above the line is read as context for an uptrend, below it for a downtrend.
  • The slope. Because the line is so smooth, a change in slope is easier to see than on a noisier average. It also shows up later.
  • As a slow line next to a faster one. The Hamming average works as a calm reference line beside a faster average such as an EMA, where the gap between the two shows how far recent prices have moved from the smoothed centre.
  • Period length. Longer windows are smoother and later. Because the line already lags about half the window, the length is the main lever on how late it is.

These are ways to read the line, not entry signals on their own.

Settings

SettingDefaultWhat it changes
Length10 Bars in the window. Higher is smoother and later. Minimum 2, because the weights need at least two bars to form.
SourceClose Which price each bar contributes. Open, high, low and the averaged sources such as hl2 and hlc3 are also available.

Adjust the window length and price source in the indicator settings.

Calculation

Each bar in the window gets a weight from the Hamming window, where k counts back from the current bar (k = 0) to the oldest (k = length - 1):

weight(k) = 0.54 - 0.46 * cos(2 * pi * k / (length - 1))
Hamming = sum(weight(k) * price(k)) / sum(weight(k))

The weights are 0.08 for the newest and oldest bars and 1.0 at the exact centre, so the bars around the middle of the window carry the most weight. Because the shape is symmetric, it makes no difference which end is counted as the start. With the default length of 10, the middle bars carry more than ten times the weight of the current bar.

The line is first drawn once a full window of bars is available, so with a length of 10 the first value is on the tenth bar.

Limitations

  • It lags by about half its window. The newest bar carries almost no weight, so the line reacts to a turn only once the turn has worked its way into the middle of the window.
  • Smoothness is not accuracy. A clean line can look more reliable than it is. It is still an average of past prices.
  • Sideways markets produce repeated crossings. With no trend to follow, price crosses the line again and again.
  • The live candle moves. The current bar's value changes until that bar closes, though with so little weight on the newest bar the change is small.
  • It is not a strategy. On its own it carries no risk management, sizing or exit.

Frequently asked questions

It is a weighted moving average whose weights follow the Hamming window, a symmetric curve that is highest in the middle of the window and lowest at both ends. That makes it very smooth, at the cost of lagging by about half its length.

A weighted moving average gives the newest bar the largest weight and the oldest the smallest, so it leans towards recent prices. The Hamming average gives the middle of the window the largest weight and treats the newest and oldest bars alike, so it does not lean towards recent prices at all.

The default is 10. A longer window is smoother and later; a shorter one follows price more closely but loses some of the smoothness that is the reason to use it. Test the length on the timeframe you trade.

Yes. The indicator declares two inputs: Length, default 10 with a minimum of 2, and Source, default close. Open the indicator's settings on the chart to change them.

No. Each value uses a fixed window of bars, so values on closed bars are not revised. The current candle's value moves while that candle is still live and settles when it closes.

Use the Add to chart button at the top of this page. It opens BTC/USDT on Binance in the Altrady Charts terminal with the built-in Moving Average Hamming already applied. On any other market, open the indicator picker on the chart and choose Moving Average Hamming from the Moving Average group.

Add to chart