Skip to content

Average price calculator with partial sales

Track the weighted cost of an open position as buys, fees and partial sales change it.

Transaction ledger

Purchases and sales

Enter transactions in chronological order. A sale cannot exceed the units held at that point.

Results by transaction

See how the open quantity and moving average change after each trade. Sales also show realised profit or loss for the row.

Moving weighted average after each transaction
#ActionOpen quantityMoving averageRealised P&L for this row

How it works

Enter transactions in actual order. A purchase raises quantity and adds its cost, while a partial sale removes inventory and realizes the difference between proceeds and the attributed cost.

Use these examples for education and planning. Actual execution and costs can change results.

Worked example

Buy two units at 100 and one at 130. The moving average is 110 before fees. Selling one leaves two units at the same moving average until the next buy.

Sources and verification

The US SEC resource illustrates order mechanics. Check the rules and execution terms on the venue you use.

Continue exploring