Tools · Free · No sign-up

Average Price Calculator

Work out the weighted average price of a position bought in more than one lot, what it cost, and what it risks measured from that average once a stop is named. Or work the other way, and see how many units at a given price would move that average to a level you choose.

The lots already bought

A lot left completely blank is skipped, so there is no need to fill every row. Six is the limit here; a position split more finely than that can be entered as its groups.

This mode takes the lots above and returns the price the position sits at as a whole, together with what each lot weighs inside it.

Stop and direction, optional
Direction

Left blank, the result stops at the average and the cost. Filled in, it adds what the position risks measured from that average: below it when long, above it when short.

Your numbers never leave your browser. No account, nothing uploaded, and nothing you type is tracked.

Built for shares, ETFs and crypto — instruments where one unit costs exactly its price. It does not cover futures or forex, which need a point or pip value this calculator deliberately does not ask for.

Five equal lots, one stop left where it was

The same position bought in five lots of 100 units, at 50, 45, 40, 35 and 30, with the stop kept at 28 throughout. Each row is the position after that lot. The average price falls with every addition. The money at risk is the distance from that average to the stop, across every unit held by then.

Units held Total cost Average price Money at risk
1005,00050.002,200
2009,50047.503,900
30013,50045.005,100
40017,00042.505,800
50020,00040.006,000

How to use this average price calculator

Enter each purchase as a price and a number of units, one lot per row, up to six rows. Leave unused rows blank. The first mode, What my average becomes, returns the weighted average price of everything you hold, the total cost, and the share each lot carries in the position. Add a stop and a direction and it also returns what the position risks, measured from that average.

The second mode, How much to add, works backwards: give it the price of the next purchase and the average you want to end at, and it returns the number of units that gets you there. Try a small case first. 100 units at 50 and 300 units at 44 give an average of 45.50, not the 47 you would get by averaging the two prices.

A weighted average is not the average of the prices

A position bought in more than one lot still has a single price, and that price is not the halfway point between the prices paid. Buying 100 units at 50 and then 400 units at 45 does not leave an average of 47.50. It leaves 46.00, because four times as many units sit behind the lower price. The weighted average multiplies each price by the units bought at it, adds those products together, and divides by the total units held. A price counts only in proportion to the units bought there.

That is why the weight of each lot is worth reading before the average itself. A lot holding 8% of the units barely moves the number whatever it was bought at; a lot holding 60% of them very nearly is the position. This page also runs the calculation the other way: name the price of a new purchase and the average you want to end at, and it returns the units that would get there — the exact figure, before any rounding to a whole unit.

The average price formula, step by step

The average price of a position is its total cost divided by the units held: add up price times units for every lot, then divide by the sum of the units. Written out for three lots, average price = (P1 × U1 + P2 × U2 + P3 × U3) ÷ (U1 + U2 + U3). The top line is what you paid in; the bottom line is what you own. Nothing else enters the formula, so it works the same for shares, ETF units, coins or contracts, as long as every price is quoted in the same currency.

Take 100 units at 50, 100 units at 45 and 200 units at 40. The cost is 5,000 + 4,500 + 8,000 = 17,500 over 400 units, so the average price is 43.75. The plain midpoint of the three prices would say 45, which is wrong by 1.25 per unit, because half the units sit at 40. The weights give the same answer: 25% of the position at 50, 25% at 45 and 50% at 40 gives 12.50 + 11.25 + 20.00 = 43.75. Type the three lots into the calculator above to check it.

How many units to add to reach a target average

Running the formula backwards gives the units to add: units to add = units held × (current average − target average) ÷ (target average − price of the new purchase). With 200 units held at an average of 47.50, a new purchase at 40 and a target average of 45, that is 200 × 2.50 ÷ 5.00 = 100 units. Check it forward: (200 × 47.50 + 100 × 40) ÷ 300 = 45. These are the numbers the calculator opens with in its second mode.

The target has to sit between the price of the new purchase and your current average, because a purchase can only pull the average toward its own price, never past it. A target of 38 when buying at 40 has no answer, and the closer the target is to the purchase price, the faster the units required grow: a target of 41 with the same inputs already needs 1,300 units.

The risk is measured from the average, not from the first entry

Once a position has been built in pieces, the price of the first purchase stops being a useful reference. There is one stop, one total size, and what that stop costs is the distance from the average to it multiplied by every unit held — not by the units of the opening lot. Reading the risk from the first entry understates it whenever the later lots were bought further from the stop, and understates it by more the larger those lots are.

That distance is the figure this page returns once a stop and a direction are filled in, and it is the same distance a sizing calculation begins from. Our position size calculator runs it in the other direction: from the account and the risk budget to the units a given stop allows. One measures the gap before the position exists; the other after it has already been added to.

Two ways to reach the same average

Two different actions produce identical arithmetic. In the first, the lots were decided before anything was bought: a size split into three, with the prices and the stop written down in advance, so each purchase is a step in a plan already made. In the second, the position was opened as a single lot, at a size chosen for that lot alone, the price moved, and the further purchases were decided afterwards.

The calculator cannot tell the two apart, and neither can the average it returns. What separates them is the stop. A scale-in planned in advance leaves the stop where the plan put it and the total risk inside the budget, because the size of every lot was chosen with that stop already in mind. Where the additions were decided afterwards, the stop is either left where the first lot put it while the units grow, or moved further away so the larger position fits — and either way the money at risk is no longer the figure it was at the opening.

Whether that number is still acceptable is not a question about one position on its own. It depends on what the rest of the account already has at stake at the same time, which is the sum our portfolio heat calculator adds up.

What happens to the size while the average moves

Every added lot does two things at once, and they point in opposite directions. It pulls the average toward the price paid, which brings the level where the position is flat closer to the market. It also raises the unit count and the capital committed, and with them what a stop would cost. The table above holds the stop still and adds equal lots at lower prices: the average falls from 50 to 40 while the risk to that same stop climbs from 2,200 to 6,000. Neither number moves without the other.

The level where the position is flat is not quite the average, either. Commission and spread are charged on each lot separately, so a position built in five pieces has paid five entry costs against the single exit still to come. Our break-even calculator adds those costs to the average this page returns.

How to read each number

The headline is the weighted average in the first mode and the units to add in the second. Units held and total cost describe the position as it stands: the cost is what has been paid in, not what the position is worth now. The weight of each lot is its share of the units, and so the share of the average it controls. With a stop filled in, money at risk is that distance across every unit, the share of the position turns it into a percentage of the capital committed, and the distance to the stop restates the same gap as a percentage of the average.

Fees, partial sales and cost basis

Fees are part of what you paid. Add the commission of each purchase to its cost before dividing by the units, and the average rises slightly: a position that looks flat at the average price is really a little under water until the fees are covered.

Selling part of the position does not change the average price of the units you still hold, because the average is a property of what is left, not of what went out. What a sale changes is the realised result and the size of the position. Tax rules can use a different cost basis than this average, such as first in first out, and that depends on your country and broker, so check yours before using this number for anything other than managing the trade.

Stocks, crypto, forex: the same arithmetic

Price and units can be anything, as long as every lot uses the same pair of measures: shares at a share price, coins at a coin price, or forex lots at the entry rate. The calculator reads the lots as typed and sends nothing anywhere, so the average entry price of a live position stays on your own screen.

Questions

How is the average price calculated when buying in multiple lots?
It is a weighted average, not the midpoint between the prices paid: each price is multiplied by the units bought at it, the products are added together, and the total is divided by the units held. Buying 100 units at 50 and then 400 units at 45 does not average to 47.50; it averages to 46, because four times as many units sit behind the lower price. The weight of each lot, its share of the total units, is worth reading before the average itself.
How many more units do I need to bring my average down to a target price?
The calculator runs the arithmetic in reverse for this: name the price of the new purchase and the average you want to end at, and it returns the exact number of units needed, before any rounding to a whole unit. A lot holding a small share of the total barely moves the average whatever it was bought at, while a lot holding most of the units very nearly becomes the average. It is the mirror of the forward calculation, which starts from the lots and returns the average.
Is averaging down the same as averaging up?
The calculator cannot tell the two apart, and neither can the average it returns, because the arithmetic is identical either way. What separates them is the stop: a scale-in planned in advance leaves the stop where the plan put it, with every lot sized around it, while additions decided after the price moved either leave the stop where the first lot put it while the units grow, or move it further away to fit the larger position. Either way, once the position was not planned as a whole, the money at risk is no longer the figure it was at the opening.
Why does the risk to my stop change as I add to a position?
Every added lot pulls the average toward the new price, bringing the level where the position is flat closer to the market, while at the same time raising the unit count and what a stop would cost. Holding the same stop and adding equal lots at lower prices can drop the average from 50 to 40 while the risk to that same stop climbs from 2,200 to 6,000; neither number moves without the other. Once a stop and a direction are filled in, this page returns that distance directly, the same gap a sizing calculation begins from.
Does selling part of my position change the average price?
No. The units you keep are still priced at the weighted average of what you paid for the whole position. The sale changes the size of the position and books a profit or a loss on the units sold, but the break-even level of the remainder stays where it was.
Is the average price the same as average entry price or cost basis?
For managing a trade, average price and average entry price are the same number: the weighted average of every purchase. Cost basis is the term tax systems use, and some of them do not use the weighted average, so the two can differ when it comes to reporting.
What is the formula for average price?
Average price = total cost ÷ total units, where total cost is the sum of price × units for every lot. For 100 units at 50, 100 at 45 and 200 at 40, the cost is 17,500 over 400 units, so the average price is 43.75, not the midpoint of 45.
What is the formula for how many units to buy to reach a target average?
Units to add = units held × (current average − target average) ÷ (target average − new purchase price). Holding 200 units at 47.50, buying at 40 to reach 45 takes 200 × 2.50 ÷ 5 = 100 units. The target has to fall between the new purchase price and the current average, or no number of units reaches it.

Adding to a position is a question of where, not just how much. Order blocks mark the places where price has been defended before.

See Edo Order Blocks → Read: what is an order block →

Indicators that draw this for you

The numbers above are what these tools mark on the chart: levels, stops and context, no spreadsheet.