Position Averaging Calculator
In add mode, enter your current position and the add-on price to get the new weighted average cost; in target mode, enter a target cost to see how many shares and how much cash you need.
A position that has fallen tempts you to buy more and bring the average cost down — but before placing the order it is worth knowing three things: what the average becomes, how much cash it takes, and whether averaging down is actually the right move. Both directions are covered here: work forward from a top-up plan to the new average cost, or set a target cost and work back to the number of shares and the money required.
The arithmetic is simple — average cost = (existing shares × existing cost + added shares × added price) ÷ total shares. The lower the top-up price, the more it pulls the average down, but averaging down does not fix a wrong call: it concentrates more of the portfolio in a single name. A useful test before buying is to ask whether you would buy at this price if you held nothing today.
Did this tool solve your problem?
Submitting sends the tool name, your input and the current result to the server. Please do not include ID numbers, phone numbers or other private data.
AI assistant It answers using your current input and result
Asking again sends your current input and result to the server once more. Please do not include private data.
How to use
- Choose the direction: work out the new average after a top-up, or reverse from a target cost.
- Enter the existing position and the top-up parameters (or the target cost).
- Read the new weighted average cost and the percentage change in cost.
- Check how much cash the top-up requires before committing to it.
How it works
How the weighted average cost works
The post-top-up cost is a weighted average: (original quantity x original cost + top-up quantity x top-up price) / (original quantity + top-up quantity). For example holding 1,000 shares at 10 and buying 500 more at 7 gives a new cost of (1,000x10 + 500x7) / 1,500 = 9, a 10% drop. The new cost always lies between the original cost and the top-up price, closer to the top-up price the more you buy.
Back-solving the top-up amount for a target cost
You can also set the target first: to bring the cost to T, quantity needed = original holding x (original cost - T) / (T - top-up price). In the example, target 9 and top-up price 7 requires 1,000 x (10 - 9) / (9 - 7) = 500 shares, costing 3,500. Note this formula has a solution only when "top-up price < target cost < original cost": you can't lower the cost by buying at a higher price, and the page says so directly.
Limits and risks of averaging down
Averaging down only changes the average cost; it doesn't make the existing unrealized loss disappear. Its real effect is lowering the "gain needed to break even": after the cost drops from 10 to 9, the stock need rise only 11% instead of 25% to break even. But it also doubles the position, so if the price keeps falling the absolute loss grows — the premise for averaging down is "you still believe in the long-term value of this asset," not "unwilling to book a loss."
Code example
JavaScript Averaging down, and solving backwards
function avgCost(shares1, cost1, shares2, price2) {
return (shares1 * cost1 + shares2 * price2) / (shares1 + shares2);
}
function sharesForTarget(shares1, cost1, price2, target) {
// (s1*c1 + s2*p2) / (s1 + s2) = target, solve for s2
return shares1 * (cost1 - target) / (target - price2);
}
avgCost(1000, 20, 1000, 15); // 17.5
sharesForTarget(1000, 20, 15, 17); // 1500 shares (adding 22,500)
Python The same formulas in Python
avg_cost = lambda s1, c1, s2, p2: (s1 * c1 + s2 * p2) / (s1 + s2)
shares_for_target = lambda s1, c1, p2, t: s1 * (c1 - t) / (t - p2)
avg_cost(1000, 20, 1000, 15) # 17.5
shares_for_target(1000, 20, 15, 17) # 1500.0
# The reverse solve needs target between c1 and p2, otherwise there is no solution (negative)
FAQ
How is the post-top-up average cost computed?
As a weighted average: (original holding x original cost + top-up quantity x top-up price) / total quantity. Holding 1,000 shares at 10 and buying 500 at 7 gives (10,000 + 3,500) / 1,500 = 9. The lower the top-up price and the more you buy, the closer the new cost is to the top-up price.
Does averaging down reduce my loss?
It can't reduce an existing unrealized loss, only the gain needed to break even. The position's market value is unchanged and the book loss is not a cent smaller; what changes is the lower cost line. If the price keeps falling, the enlarged position actually widens the absolute loss.
Why is the averaged cost always above the top-up price?
Because the new cost is a weighted average of the original cost and the top-up price. Since the original cost is above the top-up price, the weighted result inevitably falls between them. Only when the original holding is 0 (initial build) does the cost equal the purchase price.
What conditions does the target-cost back-solve need?
It requires "top-up price < target cost < original cost." If the target exceeds the original cost, no averaging down is needed; if the target is below the current price (the top-up price), there's no mathematical solution — you can't pull the average cost lower by buying at a higher price. The page warns in both cases.
How do I estimate the cash needed to average down?
Compute the quantity needed, then multiply by the top-up price for the added funds. In the example, 500 shares at 7 needs 3,500. In practice, set a capital ceiling (say no more than 50% of the original position) to avoid buying all the way down until the cash runs out.
When should I not average down?
Three typical cases: the buy thesis is broken (earnings blow-up, industry policy reversal); the position is already too heavy, so averaging down pushes a single asset beyond your risk tolerance; or there's no reserve cash, so averaging down costs other opportunities or forces a cut at a loss. Stopping out or holding still is steadier then.
Is it safe once the cost falls after averaging down?
No. A lower cost also means a larger holding (bigger risk exposure). Whether it's safe depends on "total commitment as a share of investable funds" and "whether the asset is still worth holding," not on the cost price alone. Averaging the cost to 9 while doubling the position actually raises the risk.
Are my holding and top-up data uploaded?
No. The weighted average is just a multiply-add, done entirely in the browser with no network request; history is written only to local localStorage and is clearable in one click.