Moving Average Calculator: Simple, Weighted and Exponential
A moving average is worked out by taking a fixed count of the most recent prices, giving each one a weight, adding the weighted prices and dividing by the total weight. On the Nakshatra unit's six year record, a twelve month window read at December 2024 gives Rs 196.8859/- the simple way, Rs 182.2555/- the weighted way and Rs 186.7689/- the exponential way. The calculator runs all three at once.
Three answers, one window, one set of twelve prices, and not a single mistake among them. Three right answers from one set of prices is the situation the calculator makes reproducible by hand. Underneath every reading below sits the same short run of arithmetic: choosing how many months to look at, deciding what each of those months is worth, multiplying, adding, dividing. Nothing is fitted, nothing is estimated and nothing is looked up anywhere.
The Nakshatra unit is an invented traded object written for teaching, and its six year record is one invented list of 72 monthly prices running from the month ending 31 January 2019 to the month ending 31 December 2024, against an opening markThe starting figure a record is measured from, set before the first observation. Here it is Rs 100/- on 31 December 2018, and it is a chosen reference rather than something observed. of Rs 100/- on 31 December 2018. The record was built rather than collected, from a monthly driftA steady amount added to every period of an invented record, so that the record leans in one direction on average. Here the drift is 1.00 per cent a month. of 1.00 per cent, twelve repeating calendar values, and an irregular part growing heavier partway through. The prices themselves form a level seriesA series recording where something stood at each date, such as a price, rather than how much it moved. The difference between a level series and a change series is covered separately., which is what a moving average is normally run over, and every figure in this calculator comes back out of those 72 numbers.
What does this calculator take, and what does it hand back?
The calculator takes two settings and returns three answers. The first setting is the window length, any whole number of months from 3 to 24. The second is the month the reading is dated to, and that list holds only months the record can actually answer for. Everything else is bolted down: the record cannot be swapped, the weighting schemes cannot be edited, and the starting value the exponential method needs is fixed at one stated rule.
A single figure on a screen gets read as the figure, and three figures side by side make visible that somebody chose, so the calculator hands back three answers rather than one. A reader who is handed Rs 196.8859/- alone has no way of knowing that Rs 182.2555/- and Rs 186.7689/- were equally available from the same twelve prices on the same day. A reader who is handed all three cannot miss it.
If the window is shortened from 12 months to 3 months, will the three methods land closer together or further apart?
One slider for the window length, with all three averages redrawn over the record
Dragging the window from 3 months to 24 redraws the three lines over the same 72 prices. A reading needs a full window behind it before it exists, so the month list underneath shortens as the window widens. The record, the weights and the starting value rule never move. The panel opens on a window of 12 read at December 2024: Rs 196.8859/-, Rs 182.2555/- and Rs 186.7689/-.
How is the simple moving average worked out?
The prices for the last k months are added and divided by k. Adding and dividing is the entire method, and k is the window length set above. At a window of 12 read at December 2024, the twelve months are January 2024 through December 2024, their prices add to Rs 2,362.6311/-, and Rs 2,362.6311/- divided by 12 is Rs 196.8859/-.
The simple average is the only reading here whose arithmetic can be verified in full without trusting a machine, and checking it on paper takes about a minute. Twelve additions and one division. A hand check can stop at the third month, the sixth, the ninth and the twelfth to see where it stands. The running totals are printed in the diagram below. Nothing is left in the method to disagree about, so a total that agrees at Rs 2,362.6311/- gives an answer that agrees at Rs 196.8859/- as well.
How is the weighted moving average worked out?
Multiply the oldest month in the window by 1, the next by 2, and so on up to the newest by k. Add those products. Then divide by the total of the weights. The weight total is k multiplied by k plus one, all over two. At a window of 12 the weights run 1 through 12, they add to 78, the products add to Rs 14,215.9310/-, and Rs 14,215.9310/- divided by 78 is Rs 182.2555/-.
The divisor is not the window length, and reaching for 12 instead of 78 is the commonest arithmetic slip anybody makes on this calculation. It is easy to see why: the simple method has just finished teaching the hand to divide by the count of months, and the weighted method looks like the same shape with extra multiplication in front. It is not. Dividing Rs 14,215.9310/- by 12 gives Rs 1,184.6609/-. Rs 1,184.6609/- is roughly six times the price of the Nakshatra unit and therefore obviously wrong. The mistake is loud when the numbers are prices and silent when they are ratios. Ratios are where it usually survives.
The twelve prices from the table above, added together and divided by twelve, land on which figure?
A weighted twelve month average divides by 78. At a window of 6 months, what is the divisor?
How is the exponential moving average worked out?
Not by adding a window at all. The exponential method is a recursionA rule that works out each new value from the value it produced last time, rather than from a fresh batch of inputs. Every step depends on the step before it, all the way back to wherever the rule was started.: it starts from some value, then for every month takes 0.153846 of the new price and adds what is left of the value already held. In plain words, the new reading is the smoothing factor times this month's price, plus one less the smoothing factor times last month's reading. Rolled from the start of the record to December 2024, the Nakshatra unit reads Rs 186.7689/-.
The smoothing factor and the starting value must both be written down before anybody else can reproduce an exponential average. The smoothing factor here is two divided by the window length plus one, so a window of 12 gives two divided by 13, which is 0.153846. The starting value here is the simple average of the record's first twelve months, Rs 101.2600/-. The recursion begins from that average at the end of December 2019 and takes its first step in January 2020. Neither of those is discoverable from the column of answers. Both are choices, and a column of exponential averages without them attached is a column nobody can check.
The first four steps are worth walking slowly. In January 2020 the price is Rs 110.0399/-. Take 0.153846 of it, or Rs 16.9292/-, and add 0.846154 of the starting value Rs 101.2600/-, or Rs 85.6815/-. The two add to Rs 102.6107/-. February's price of Rs 114.4415/- carries the reading to Rs 104.4309/-, March's to Rs 106.3231/-, April's to Rs 107.3854/-. Notice how slowly it moves: four months of prices well above the starting value have lifted the reading by about six rupees. The reluctance to move is the method, and it is also the reason the starting value keeps its grip for so long.
A colleague sends a column headed exponential moving average and nothing else. Which two things are needed before a single figure in it can be reproduced?
What is the worked instance every reading can be checked against?
One record, three dates, nine figures. The table below is the whole of it, and each of the nine is reproducible by hand from the 72 prices using the three methods set out above. December 2021 and December 2023 are computed exactly as December 2024 was: twelve prices, weights of 1 through 12 over a divisor of 78, and a recursion carried forward from the same starting value of Rs 101.2600/-. The exponential column never restarts.
| Month read at | Price | Simple | Weighted | Exponential |
|---|---|---|---|---|
| December 2021 | Rs 140.8315/- | Rs 131.7804/- | Rs 131.3563/- | Rs 129.1342/- |
| December 2023 | Rs 231.4611/- | Rs 207.4234/- | Rs 214.3590/- | Rs 208.5704/- |
| December 2024 | Rs 187.4539/- | Rs 196.8859/- | Rs 182.2555/- | Rs 186.7689/- |
Notice that the three methods do not even keep the same running order across the three dates. At December 2024 the simple average is the highest of the three and the weighted the lowest. At December 2023 the weighted average of Rs 214.3590/- is the highest and the simple the lowest. Which reading comes out on top is a property of the stretch of months the reading sits in, not a property of the method, and no amount of staring at one date will reveal it. Setting the calculator to December 2023 and then to December 2024 shows the ordering swap.
All nine figures agree to the paisaOne hundredth of a rupee. Two figures that agree to the paisa match at the second decimal place. Here they are printed to four, so the check is stricter still. with the same nine computed elsewhere in these notes. A figure that disagreed with the worked example printed beside it would leave a reader no way of telling which of the two to believe.
What happens to the answer when the window gets longer?
Two things move at once, in opposite directions. A short window keeps the reading near the price and turns it about constantly. A long window holds the reading steady while describing a stretch of months that is mostly already past. There is no window length that does both, and this is the part of the calculation that no arithmetic can settle.
Here it is counted on the six year record, using the simple method so nothing else varies. The readings from a three month window travel through a band Rs 138.9433/- wide across the record. Six months: Rs 137.0059/- wide. Twelve months: Rs 121.4049/- wide, running from Rs 101.2600/- at its lowest to Rs 222.6649/- at its highest. Twenty four months: Rs 97.0121/- wide. The record itself never changed by one paisa across those four calculations, and yet the reading quoted from it moved through a band forty per cent narrower at the long end than at the short end.
An everyday version helps here. A wedding caterer looking at last month's order count sees every wedding season and every quiet month in full. The same caterer looking at a twelve month average sees a smooth number that barely moves, and would not notice a slow season until it had been running for the better part of a year. Both figures are correct. The two figures answer different questions, and the caterer has to decide which question is being asked before choosing a window, not afterwards.
The window widens from 12 months to 24 and the line stops turning about. Has the Nakshatra unit's record become steadier?
How late is a moving average, in months?
Late by a countable amount, and the count comes out of the weights rather than out of the record. Give each month in the window an age, where this month is aged zero, last month is aged one, and so on. Then work out the average age, weighting each age by the weight its month carries. For a simple twelve month average that average age is 5.5 months. The figure quoted today is centred on a moment half a year back.
The same arithmetic on other windows gives 1.0 month at a window of 3, 2.5 months at 6, 5.5 at 12 and 11.5 at 24. The weighting scheme moves the number too. The twelve month weighted average leans its weights on the newer end of the window, so its average age is 3.6667 months. None of that is an opinion about which figure to prefer. The average age is the arithmetic of where the weight sits, and it is fixed the moment a window and a scheme are chosen.
The record shows the consequence plainly. The price of the Nakshatra unit reached its highest point of the whole six years, Rs 238.6196/-, in November 2023. The three month simple average reached its own high in January 2024, two months later. The six month average in April 2024, five months later. The twelve month average in June 2024, seven months later, at Rs 222.6649/-, a reading Rs 15.9547/- below the price it was describing. A smoothed line always describes a stretch of months the record has already left, and the wider the window, the further behind that stretch sits. This is not a defect to be tuned away. Lateness is what smoothing is. Anybody who wants the current price should read the current price, Rs 187.4539/- on this record at December 2024.
One more thing worth noticing: the trendThe broad direction a record leans in over a long stretch, separated from the month to month movement around it. Measuring one is a separate exercise from averaging, and is covered separately. in this record runs upward across all six years, and yet the twelve month average spends the last half of 2024 falling. Both statements are true at once, and a reader who has only the smoothed line in front of them has no way to tell which of the two they are looking at.
Why do two people get different answers from the same prices?
Three reasons, and not one of them is an arithmetic error. The first is a different window length: twelve months against six months on the same record and the same date gives Rs 196.8859/- against Rs 167.7494/-, a difference of Rs 29.1365/-, and the two people are both right. The second is a different weighting scheme travelling under the same name. Somebody who says moving average and means the weighted kind reports Rs 182.2555/- while somebody who means the simple kind reports Rs 196.8859/-.
The third is the one that hides best. For the exponential method, a different starting value produces a different figure in every row of the column, and almost nobody writes the starting value down. The starting value is not visible in the output, not recoverable from the output, and the person who set it usually accepted whatever their tool did by default without ever seeing a screen that mentioned it.
Because none of the three is an arithmetic error, checking the sums will never find any of them, and checking the sums is exactly what two people who disagree will spend their afternoon doing. What repairs this is dull housekeeping rather than any insight. Three short notes belong beside every published figure, in the same spot each time: how many months went into it, how the months were weighted, and where an exponential column was started from. The three notes are the difference between a number somebody else can rebuild and a number they can only argue with.
Why does this calculator print three answers instead of asking for one method first?
Recall check. At a window of 12 months the smoothing factor is 0.153846. Where does that number come from?
Who actually reaches for a moving average, and what for?
Somebody with a lumpy monthly record and a question that a single month cannot answer. March was a festival month and December was not, so a lender reviewing a small manufacturer looks at twelve months of sales rather than at March. One hot April tells nobody anything, so a household deciding whether the electricity bill has genuinely risen averages the last twelve bills. A shopkeeper comparing this week's takings to a three week average is doing the same arithmetic on a shorter window and for the same reason.
In every one of those cases the moving average is being used to describe what has already happened, not to say anything about what comes next. The lender still asks what changed in the twelve months. The household still opens the bill. The average narrows the question and hands the reader something steadier to compare against, and that is the whole of its job. A smoothed line read as though it said anything at all about next month has quietly left arithmetic for something else.
What kind of reading can never be produced, and why?
Three things. No supplied series is accepted. Every figure here is checkable against a fixed record, and a pasted record would break that. No reading is marked high, low, cheap or dear. Marking one would be a judgement rather than a calculation. And no figure is dated later than December 2024. The record stops there.
The last of the three looks like a missing feature and is in fact a guard rail. A moving average dated to a month claims to have been computable at the end of that month. Dating a reading to January 2025 on a record that ends in December 2024 would mean either inventing a January price or quietly using December's figure and calling it January's. Both are a dating error rather than a forecast, and the general form of that error, in which a computed column borrows information that did not exist yet, has a name: lookaheadUsing information in a calculation dated to a moment before that information existed. Lookahead is a data handling error rather than a modelling one, and it is covered separately at length.. The shortening month list is that guard rail made visible, and it is what keeps lookahead out of every reading here.
The calculator will not return a figure for January 2025. Why is that a design decision rather than a shortcoming?
Where these figures come from: the six year record was written into being by a short script that fixes a monthly drift, twelve repeating calendar values and an irregular part, then compounds the result forward from Rs 100/-. Every average printed above was recomputed from that record.
Rs 186.7689/- against Rs 190.7878/-, and both sums are right
Two people work out the twelve month exponential moving average of the Nakshatra unit at December 2024. One of them has the whole six year record open, starts the recursion at the simple average of the first twelve months, Rs 101.2600/-, and rolls it forward sixty times to Rs 186.7689/-. The other has only the twelve months of 2024 in front of them, starts at January 2024's price of Rs 238.4049/-, rolls eleven times, and gets Rs 190.7878/-. The gap is Rs 4.0189/-. Same method, same window length, same smoothing factor of 0.153846, same twelve prices at the end of it, and neither of them has added anything up wrongly.
The difference is invisible in the place both people will look, and that is what makes it expensive. Both will compare the twelve prices, and the prices agree. Both will compare the divisor, and there is no divisor to compare. Each will recheck the multiplication, and the multiplication is fine on both sides. The one thing that differs was never printed on either screen, and it is not recoverable from either column of answers.
There is a second trap sitting right beside the first, and it points the other way. Change only the starting value, from Rs 101.2600/- to the record's own first price of Rs 102.0000/-, and roll both the same sixty months: December 2024 reads Rs 186.7689/- on both. Sixty multiplications by 0.846154 leave 0.000044 of the Rs 0.7400/- difference, about three thousandths of a paisa. So the starting value is not what bites. The count of months rolled since the starting value was set is what bites, and the two people above differ by forty nine of them.
The fix is the reason the calculator prints its starting value on screen at every setting. A column of exponential averages carrying no note of where its recursion began, and over how many months, is a column that cannot be rebuilt by anybody, including the person who built it.
Keep everything else fixed and change only the starting value, from Rs 101.2600/- to the record's first price of Rs 102.0000/-, then roll both the same sixty months to December 2024. What happens to the December figure?
Is there anything here that has to be taken on trust?
Nothing, and that is unusual enough to be worth saying out loud. Adding twelve numbers and dividing by twelve is not a rule that anyone publishes, amends or enforces. The weights 1 through 12 are counting numbers. The fraction 0.153846 is two divided by thirteen and comes out identical wherever it is worked. There is no institution whose agreement would make Rs 196.8859/- more correct than the twelve additions above already make it, and no series anywhere that this record is standing in for. So the third column of the table below reads the same on every row, and what it says there is the finding itself and not an omission.
None of this comfort travels to months brought in from elsewhere. The three methods will run perfectly happily over any column of numbers at all, and confirming that the multiplications tally says nothing whatever about where that column came from or whether its dates are in the right order.
| What the number is | How it was arrived at | Whose word it rests on | The day it was settled |
|---|---|---|---|
| The 72 monthly changes of the Nakshatra unit, built from a 1.00 per cent drift, twelve repeating calendar values and an irregular part | Chosen in advance as a teaching record, then compounded forward from Rs 100/- to give the 72 prices | Nobody. Invented for these notes | 20 August 2026 |
| Rs 196.8859/-, Rs 182.2555/- and Rs 186.7689/- at December 2024 | Recomputed from those 72 prices by the three methods printed above, then checked a second time against a script kept beside these notes | Nobody. Redo the twelve additions instead | 20 August 2026 |
| The readings at December 2021 and December 2023, and every figure the slider produces | Produced by the same three methods at a different window and a different month, with no rule changed between them | Nobody. The arithmetic is the whole of the authority | 20 August 2026 |
| The starting value of Rs 101.2600/- and the factor 0.153846 | The first is the simple average of the record's first twelve prices; the second is two divided by thirteen | Nobody. Both are stated choices rather than findings | 20 August 2026 |
The Nakshatra unit and its six year record are invented.
Educational material. Not advice on any investment, tax, budget or market position.
