The weighted average gives each value in the window a weight by its age: the oldest carries weight 1, the next weight 2, and the newest carries a weight equal to the number of values in the window. The weighted sum is divided by the sum of the weights, count * (count + 1) / 2, so the result is an average that leans toward recent prices.
The study keeps the weighted sum and the plain sum as running totals. While the window is still filling it averages whatever has arrived, so the line starts on the first bar. Once the window is full, each new bar subtracts the plain sum from the weighted sum, which lowers every weight by one and removes the departing value, then adds the new value at the top weight. A missing source value counts as zero.
How to read Weighted Average (WAVG)
Read it as a moving average that responds faster than a simple one of the same length, because the latest bars count most. Price above a rising line points to an uptrend and price below a falling line to a downtrend. A turn in the line arrives sooner than in a simple average, with a little more noise.
On the first bars the window is short and the line follows price closely; it settles into its full smoothing once a full period has passed.
Settings
- Source
- The series being averaged, usually the close.
- Period
- How many bars the window holds. A longer period gives a smoother line that lags more.
Frequently asked questions
How does it differ from a simple moving average?
A simple average weighs every bar in the window equally. Here the newest bar carries the most weight and the oldest the least, so the line reacts sooner to a change in price.
Why is there a value on the first bar?
While the window is filling the study averages the values that have arrived so far with weights 1 up to the count, rather than waiting for a full period.
