How the average entry price is calculated
Average = Σ(price × quantity) / Σ quantity. Each buy counts in proportion to its size, so the average entry price is not the plain mean of the prices. The example in the form: 0.1 BTC at $60,000, another 0.1 BTC at $55,000 and 0.2 BTC at $50,000 — $21,500 invested, 0.4 BTC in total, an average of $53,750. The plain mean of the three prices is $55,000, but the last buy is twice as large and pulls the average towards its price.
| Entry | Price | Quantity | Amount | Average after |
|---|---|---|---|---|
| 1 | $60,000 | 0.1 BTC | $6,000 | $60,000 |
| 2 | $55,000 | 0.1 BTC | $5,500 | $57,500 |
| 3 | $50,000 | 0.2 BTC | $10,000 | $53,750 |
If you buy for the same amount each time (DCA), switch the form to «Amount»: the quantity of each buy is amount / price and the average is Σ amounts / Σ(amount / price). $1,000 each at $60,000, $50,000 and $40,000 gives 0.06166667 BTC at an average of $48,648.65 — below the plain mean of $50,000, because the same money buys more coins at the lower price.
P&L and how far the price has to come back
Without fees the breakeven is the average itself. At price P a long makes (P − average) × size and a short (average − P) × size; the percentage is taken from the total entry amount. To get back to zero, the price of a long has to rise by (average / P − 1) × 100% and the price of a short has to fall by (1 − average / P) × 100%.
In the example at $52,000 the position is at −$700 (−3.26%), and the price needs to rise by 3.37% to breakeven. The rise is measured from the current, lower price, so it is always larger than the percentage loss — the same effect as recovering a drawdown, which the drawdown calculator works out.
Breakeven with fees
A fee is charged on the amount of every trade — the entries and the exit — so with a fee rate f the breakeven moves away from the average: for a long it is average × (1 + f) / (1 − f), for a short average × (1 − f) / (1 + f). With an assumed 0.1% fee the example breaks even at $53,857.61; the entry fees are $21.50, at $52,000 the P&L after entry and exit fees is −$742.30 (−3.45%), and the price needs to rise by 3.57%.
A short mirrors this. Sell 1 ETH at $3,000 and another 1 ETH at $3,300: the average is $3,150, at $3,200 the position is at −$100 (−1.59%), and the price needs to fall by 1.56% to breakeven; with a 0.1% fee the breakeven is $3,143.71. The calculator leaves out funding, swap and slippage. If the exchange takes the buy fee in the coin, the long breakeven is average / (1 − f)²: at 0.1% that is 0.0001% higher, about 5 cents on a $53,750 average.
What averaging down does to risk
Every buy below the average pulls the breakeven closer to the price but makes the position bigger, so the next move against you costs more. Example: BTC falls from $60,000 to $42,000, with an extra buy at every 10% drop from the first price ($54,000, $48,000 and $42,000).
| How you entered | Invested | Average | At $42,000 | Rise to breakeven | At $37,800 (another −10%) |
|---|---|---|---|---|---|
| One buy of 0.1 BTC at $60,000 | $6,000 | $60,000 | −$1,800 | 42.86% | −$2,220 |
| 0.1 BTC at every level | $20,400 | $51,000 | −$3,600 | 21.43% | −$5,280 |
| Doubling: 0.1 / 0.2 / 0.4 / 0.8 BTC | $69,600 | $46,400 | −$6,600 | 10.48% | −$12,900 |
The harder you average down, the closer the breakeven and the bigger the loss if the price does not turn: the next 10% drop costs $420, $1,680 and $6,300. Doubling the size on every add is a martingale: most of the time it gets out at zero on a small bounce, and a long move without one needs more money than the account has. How to find the limit of such a scheme is covered in «Grid EAs and martingale: how to calculate the risk».
On a leveraged account every add also takes margin and makes each point against you more expensive: with the same balance, a margin call, stop out or cross-margin liquidation comes sooner. More in «Margin, leverage, margin call and stop out explained».
Average price after a partial sale
Under the average cost method, selling part of a position leaves the average unchanged — only the remaining size shrinks. Under FIFO the earliest coins are sold first, and the cost of what is left shifts towards the latest buys. The total result is the same under both methods; what differs is how much of it counts as realized — see the example and table in «Crypto portfolio tracking: cost basis, FIFO and return».
Average price in Davinchu
- The portfolio in «Investments». A position's average price follows the same formula as the calculator: every buy you add as an operation to a manual position re-weights it by quantity. The coin card shows a chart of buys and sells with average and current price lines, an «Operations timeline» with the average after each operation, and the totals «On paper (unrealized)» and «Locked in by sales». The accounting method is «Average» or «FIFO»; fees are subtracted from the total as a separate line, so you see what went to the exchange.
- MetaTrader 5 EAs. Davinchu Trade Monitor sends «Averaging #N» to Telegram on every add, and once there is more than one position in that direction it adds the breakeven — the volume-weighted average entry of all of them, without swap and commission — how many points away it is, and what 100 points against you cost. You see the shifted breakeven and the cost of a move at the moment you can still act on it.
- Bybit futures. Trades arrive in the journal by closing: the average entry and exit prices come from the exchange, fees are shown separately.
Exchanges connect with an API key: Davinchu only reads the account and does not accept a key with withdrawal rights. What arrives from each exchange is on the «Davinchu for crypto traders» page, and the EA messages for MetaTrader are on «Davinchu for algo traders».