TheCalculatorVault

Scale In / Scale Out Calculator

Blend your buy lots into one quantity-weighted average entry, then model a scale-out: see the realized P&L you lock in, the shares and cost basis you still hold, and the unrealized P&L on the open position.

Currency
Scale in — buy lots

Add each buy: the price per share and how many shares. The blended entry is quantity-weighted across all lots.

$
$
Scale out — partial exit
$
$

Enter the last-traded price to see unrealized P&L on the shares you still hold. Leave at 0 to skip.

Results update live as you type

Realized P&L on scale-out
100 shares sold vs $11.00 average entry.
Average entry
Total shares bought
Remaining shares
Remaining cost basis
Unrealized P&L (open)
enter a current price

Position: bought vs sold vs remaining

How to read this: Realized P&L is the profit or loss you locked in on the shares sold; remaining cost basis is the capital still at risk in the open position.

Assumptions in this estimate
  • Realized P&L is computed against your blended average entry (not FIFO/LIFO lot accounting).
  • A partial exit does NOT change the average entry per share — only the remaining share count shrinks.
  • Figures are fee-free and pre-tax; brokerage, STT/GST and capital-gains taxes are excluded.

Educational estimate — not trading advice. Results are based only on the values you enter and exclude live market conditions. This calculator does not guarantee profitability.

Like this? Share: Email

This blends your buy lots into one average entry, then models a single scale-out: realized P&L on the shares sold, the remaining open position and its cost basis. A partial sale never changes the average entry per share. Realized P&L is fee-free and pre-tax; it uses the blended average, which can differ from a broker's FIFO-realized figure. Not investment advice; see our Terms.

What is the Scale In / Scale Out Calculator?

Scaling in and scaling out are the two halves of managing a position over its life. You scale in by buying across several lots at different prices — blending them into one quantity-weighted average entry — and you scale out by selling part of the position to lock in profit (or cap a loss) while keeping the rest open. This calculator does both: it computes your blended entry, the realized P&L on the shares you sell, the shares and cost basis you still hold, and — if you supply a current price — the unrealized P&L on what remains.

It builds on the buy-side math of the Average Price Calculator and adds the partial-exit leg that a pure cost-basis tool doesn't model.

How it works

avgEntry = Σ(priceᵢ × qtyᵢ) / Σ(qtyᵢ); realizedPnL = sellQty × (sellPrice − avgEntry)

The blended average entry is quantity-weighted across your buy lots. Realized P&L values each sold share at that average, so selling above the average is a profit and below it a loss — the sign is always preserved. Remaining shares = total bought − shares sold (never below zero), and remaining cost basis = remaining shares × the unchanged average entry.

The key insight

A partial sale does not change your average entry per share. Only the number of shares you hold shrinks — so your remaining cost basis falls proportionally, but the per-share break-even for what's left is exactly what it was before you sold.

Worked example

Two buys of 100 shares at $10 and $12 blend to an $11 average. Selling 100 at $15 locks in $400, leaving 100 shares open:

StepValue
Buy lot 1100 @ $10
Buy lot 2100 @ $12
Average entry$11
Scale out100 @ $15
Realized P&L$400
Remaining shares100
Remaining cost basis$1100
Unrealized P&L (at $14)$300

How the sell price changes realized P&L

With the same $23 blended entry, the scale-out flips from profit to loss as the sell price falls through the average. This table is computed by the same engine:

Sell priceShares soldAvg entryRealized P&L
$3080$23$560
$2580$23$160
$2380$23$0
$2080$23$-240

Interpreting your results

A positive realized P&L is profit you have banked; a negative one is a loss you have crystallised to reduce exposure. Remaining cost basis is the capital still at risk in the open position — useful for both tax planning and re-sizing. Pair this with the Position Size Calculator to check the remaining position still fits your risk budget, and the Trading Expectancy Calculator to judge whether your scale-out rules add or subtract edge over many trades.

Professional tips

  • Scale out in planned tranches — re-run the tool with the residual position each time.
  • Remember the average entry is fixed by your buys; selling never moves it.
  • Compare realized P&L across candidate sell prices before you place the order.
  • Add fees and taxes yourself — the tool is deliberately fee-free and pre-tax.

Common mistakes

  • Assuming a partial sale lowers (or raises) the average entry on the shares you keep.
  • Treating realized P&L here as your taxable capital gain — the lot method differs.
  • Entering a sell quantity larger than you hold (the tool caps it and warns you).
  • Ignoring that scaling out at a loss is sometimes the right risk decision.

Assumptions and limitations

  • Realized P&L is against the blended average — not FIFO/LIFO lot accounting.
  • A single scale-out event; model multiple exits by re-running with the residual position.
  • Long positions only; short-selling and corporate actions are not modelled.
  • Fee-free and pre-tax — brokerage, STT/GST and capital-gains taxes are excluded.

Frequently asked questions

What does 'scale in' mean in trading?+

Scaling in means building a position incrementally across multiple buy orders at different prices instead of buying all shares at once. By spreading purchases, a trader blends their average entry price — buying more at lower prices lowers the blended average, and the position only needs the market to recover to that average (not to the first purchase price) to break even. This calculator computes the quantity-weighted average entry across all buy lots.

What does 'scale out' mean in trading?+

Scaling out means selling a portion of your position to lock in realized profit (or cap a loss) while leaving remaining shares open to capture further price movement. For example, if you hold 200 shares at an average entry of $11 and the price rises to $15, selling 100 shares locks in $400 of realized P&L while the remaining 100 shares stay in the trade.

Does selling some shares change my average entry price?+

No. A partial sale (scale out) does not change your average entry (cost basis per share) for the remaining position. The average entry per share remains exactly what it was before the sale. Only the total remaining cost basis shrinks, because you now hold fewer shares. This is a key concept: avgEntry is a buy-side calculation and is unaffected by sell events.

How is realized P&L calculated when scaling out?+

Realized P&L = sellQty × (sellPrice − avgEntry). Each share sold is assumed to have cost you avgEntry (your blended average), and the profit or loss per share is the difference between the sell price and that average. The result can be positive (you sold above your average — a profit) or negative (you sold below your average — a realized loss). The sign is always preserved.

What is remaining cost basis and why does it matter?+

Remaining cost basis = remainingShares × avgEntry. It is the total capital still at risk in your open position after the scale-out. It matters for tax purposes (capital gains will be computed against this cost basis when you eventually close the full position) and for position-risk sizing (it tells you how much money is committed to the remaining trade).

Why would a trader scale out at a loss?+

Sometimes a position moves against the trader before they can exit fully. Scaling out at a loss reduces position size and total exposure, limiting further downside if the stock continues to fall. The realized P&L will be negative in this case, but it frees capital and lowers the risk of a larger loss if the trade does not recover. This calculator correctly preserves the negative sign on realizedPnL.

What is the difference between this calculator and the average price calculator?+

The average price calculator computes the blended cost basis across buy lots and marks unrealized P&L against a current price — it models a fully open position with no sales. The scale-in/out calculator adds a partial exit (scale-out) leg: it computes realized P&L on the sold shares, tracks the remaining open position, and optionally marks unrealized P&L on what remains. Use the average-price calculator for pure cost-basis questions; use this one when you also need to model a partial exit.

What is the difference between scale-in/out and pyramiding?+

Pyramiding adds to a winning position in progressively smaller tranches as the price moves in your favor — it focuses on building into a trend and managing the total risk of adding to a winner. Scale-in/out is a more general concept: scaling in may happen at lower prices (averaging down) or at higher prices (building a position), and scaling out is the partial exit that this calculator specifically models. Pyramiding focuses on tranche sizing and a total-risk stop; this calculator focuses on realized P&L, remaining shares, and remaining cost basis.

How many buy lots can I enter?+

Up to 30 buy lots. You can represent any number of historical purchases by combining older lots manually: compute their weighted average price and enter it as a single lot with the combined quantity.

Does this calculator work for ETFs, mutual funds, or crypto?+

Yes. The scale-in/out math is identical for any asset where you make multiple purchases at different prices and later sell a portion. For mutual funds, use the NAV as the price and units as the quantity. For crypto, use the coin price and coin quantity. The calculator is currency-agnostic and works for USD, INR, EUR, GBP, and JPY denominated positions.

Is realized P&L the same as taxable capital gain?+

Not exactly. Realized P&L here is the fee-free, pre-tax gain or loss computed against your average entry. Taxable capital gain depends on the actual proceeds net of transaction costs, the specific lot method your tax authority requires (FIFO, average cost, or specific identification), and applicable rates (short-term vs long-term holding period). Consult a tax adviser or your broker's tax statement for the correct taxable amount.

What happens if I sell more shares than I bought?+

The calculator clamps sellQty to totalBought. It does not model short-selling. If you enter a sellQty larger than totalBought, the remaining shares are set to zero and realizedPnL is computed on the full totalBought position. A warning appears in the UI so you can correct the input.

Disclaimer

This calculator is provided for general educational and informational purposes only. Its results are estimates based on the values you enter and do not account for fees, slippage, taxes or live market conditions. Trading and investing carry a real risk of loss, and hypothetical results do not guarantee future performance. It is not investment or trading advice — please do your own research and consult a qualified professional where appropriate.

Sources

Formula and data last reviewed by the TheCalculatorVault team on 4 July 2026. Figures are for general information, not professional advice.