The Stock Pyramiding Calculator shows how the average cost and the unrealized gain or loss change at each step when you add to a stock in stages after its price has risen. In an assumed example you hold 20 shares at $150.00 and add 10 shares at $156.00 in step 1 and 10 shares at $168.00 in step 2. The final average cost is $156.00, and the current price of $168.00 is 7.69% above it.
Pyramiding in 3 steps
- Enter the buysyour holding plus the price and shares of each of up to 5 steps
- Average costtotal paid so far ÷ total shares so far
- Unrealized gain or lossshares × current price − cost
Average cost = (held shares × held average + sum of step shares × step price) ÷ total shares
Pyramiding versus averaging down
Pyramiding adds to a position after the price has risen, so the average cost goes up when the add-on price is above your average. Averaging down adds after the price has fallen, so the average goes down. The formula is the same and only the direction differs. Use this calculator to compare a plan of up to five buys step by step. For one add-on buy, or the shares needed to reach a target average, the Stock Average Calculator is simpler.
How the figures are calculated
average cost at a step = (held shares × held average + shares and prices of the steps so far) ÷ total sharesunrealized gain or loss = total shares × current price − (total paid + commission on new buys)average cost with commission = (total paid + commission on new buys) ÷ total shares(commission applies to the new shares only)new money share = amount of new buys ÷ total paid at the endcurrent price vs. average cost = (current price ÷ final average cost − 1) × 100
Example: 20 shares at $150.00, current price $168.00, two add-on steps (assumed numbers)
The first table spells out the default input of the calculator above, step by step. The commission rate of 0% applies to the new shares only, and the gain or loss uses the current price of $168.00. The numbers come from the same function as the calculator.
| Step | Total shares | Average cost | Avg. cost incl. fees | Unrealized P/L | Return |
|---|---|---|---|---|---|
| Current holding | 20 | $150.00 | $150.00 | $360.00 | +12% |
| Step 1 | 30 | $152.00 | $152.00 | $480.00 | +10.53% |
| Step 2 | 40 | $156.00 | $156.00 | $480.00 | +7.69% |
The second table compares what happens to the final average cost and the unrealized result when the add-on buys or the current price change. In this example, more add-on buys raise the average and shrink the gap, and a current price below the average turns the result into a loss.
| Case | Current price ($) | Final average cost | Current price vs. average cost | Final unrealized P/L |
|---|---|---|---|---|
| No add-on buys (for comparison) | $168.00 | $150.00 | +12% | $360.00 |
| Step 1 only (example) | $168.00 | $152.00 | +10.53% | $480.00 |
| Default example (2 steps) | $168.00 | $156.00 | +7.69% | $480.00 |
| Current price falls (example) | $151.20 | $156.00 | -3.08% | -$192.00 |
| Current price rises (example) | $184.80 | $156.00 | +18.46% | $1,152.00 |
In the default example the new money is 51.92% of the $6,240.00 total, and the average cost has moved from $150.00 to $156.00. With the same buys and a current price of $151.20, the unrealized result becomes -$192.00.
What to check
- Buying above your average raises it. At the same current price the gap to your average shrinks, and if the price falls below the average, the loss grows with the money you put in.
- The gain or loss uses the current price you enter. It does not predict future prices, and it leaves out selling commissions and taxes. To work out a price that covers those costs use the Target Sell Price Calculator, and for a price that matches a loss you can accept use the Stop-Loss Price Calculator.
- The commission rate is an example. It differs by broker and promotion, so enter the rate on your own account.
- A step with 0 shares does not change the average. To use fewer steps, remove the last one.
- Adding to a position, whether after a rise or a fall, does not protect your capital and does not promise any gain. The figures on this page are results at the prices you assume.
What to calculate next
For one add-on buy and the average after it, use the Stock Average Calculator. For the selling price that reaches your target return after costs, use the Target Sell Price Calculator, and for the exit price that matches a loss you can accept, use the Stop-Loss Price Calculator.
This page is a reference tool that calculates the average cost and the unrealized gain or loss at each step, not investment advice. Whether and when to add to a position is your own decision, and the results do not tell you where the price or your returns will go.