All indicators

Hamming Windowed Volume Weighted Moving Average

Jul 23, 2018

Static chart image
Volume BasedSignalsMoving Averages

The Hamming Windowed Volume Weighted Moving Average indicator applies a Hamming window to volume data to create a smoothed, frequency-optimized moving average for trend identification. By weighting volume with a mathematical window, the script aims to reduce noise and provide a more stable filter compared to a standard Volume Weighted Moving Average (VWMA).

Usage

The Hamming Windowed Volume Weighted Moving Average (HWVWMA) can be used as a primary trend filter or a crossover signal. Because the Hamming window smooths the frequency response of the filter, it is particularly useful for traders looking to reduce "whipsaws" or false breakouts that often occur with standard moving averages.

  • Trend Identification: When the price is consistently above the HWVWMA, it suggests a bullish trend reinforced by windowed volume. Conversely, price below the HWVWMA suggests a bearish trend.
  • Crossover Signals: Users can monitor price crossings with the HWVWMA. Due to the smoothing characteristics of the Hamming window, this indicator tends to produce fewer "bad" crosses during consolidation phases compared to a classic VWMA, especially at higher period settings.
  • Mean Reversion: Large deviations from the HWVWMA may indicate overextended market conditions, suggesting a potential return to the average.

Details

The core concept behind this script is the application of a Hamming window—a taper function used in digital signal processing—to the volume components before they serve as weights for the close price.

In a standard VWMA, volume serves as a linear weight. In this version, the volume at each point in the lookback period is multiplied by the Hamming coefficient: $0.54 - 0.46 \times \cos(\frac{2\pi \times c}{L})$ (where $c$ is the current index and $L$ is the length).

Applying this window functions as a low-pass filter, smoothing the weights to minimize spectral leakage. This results in a moving average that is more reactive to significant volume clusters while remaining less susceptible to erratic price fluctuations. This implementation was originally conceptualized by Alex Grover and refactored for modern Pine Script standards.

Settings

  • Length: Determines the lookback period for the moving average calculation. Higher values increase smoothing and reduce the frequency of crossovers, while lower values make the indicator more responsive to recent price and volume changes.

FAQ

How do I interpret the Hamming Windowed Volume Weighted Moving Average?
The HWVWMA acts as a dynamic support and resistance level. If the price is above the line, the trend is generally considered bullish; if below, it is considered bearish. The windowed calculation ensures that the line is smoother and less prone to noise than a standard VWMA.

How does this differ from a regular VWMA?
A regular VWMA uses raw volume as a weight. The HWVWMA modifies that volume weight using a Hamming window, which smooths the frequency response. This typically results in fewer false signals during sideways markets.

How can I access this indicator?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.