# Stock average cost calculator (P&L and position size)

> Calculate your average cost per share across several buys, unrealized profit and return, and the position size for your risk and stop loss.

직접 계산할 수 있는 페이지: https://www.calcopenly.com/ko/finance/stock-position-calculator
분야: 금융 계산기

Average cost is the total paid for all your buys, fees included, divided by the number of shares held. Unrealized profit or loss is the shares times the current price minus that total cost. For a new trade, position sizing starts from risk: the amount you are willing to lose (account size × risk per trade) divided by the gap between entry and stop loss gives the number of shares, rounded down.

With the defaults, buys of 100 shares at 42.50, 50 at 38.20 and 25 at 45.00 cost 7,285, an average of 41.63 a share. At 47.10 the 175 shares are worth 8,242.50, a gain of 957.50 or 13.14%. Risking 1% of a 25,000 account, 250, with an entry at 47.10 and a stop at 44.50 allows 96 shares, and a target of 54.00 offers 2.65 times the risk.

The stop is assumed to fill at its price; a gap through the stop makes the loss larger. Taxes are not included.

## 입력

- **Buys (shares and price, one per line)**: For example 100 42.50 or 100 @ 42.50.
- **Fees and commissions (total)**
- **Current price**
- **Account size**
- **Risk per trade**
- **Planned entry price**
- **Stop-loss price**
- **Target price**

## 결과

- Unrealized profit or loss — 주요 결과
- Return on cost
- Average cost per share (with fees)
- Shares held
- Total cost
- Market value
- Amount at risk
- Shares to buy for this risk
- Position cost at entry
- Reward-to-risk ratio (: 1)

## 공식

$$
\bar p = \frac{\sum s_i p_i + \text{fees}}{\sum s_i},\quad \text{shares} = \left\lfloor \frac{\text{account} \times \text{risk\%}}{|\text{entry} - \text{stop}|} \right\rfloor,\quad \frac{R}{R} = \frac{|\text{target} - \text{entry}|}{|\text{entry} - \text{stop}|}
$$

## 계산 예제

### Three buys and a 1% risk plan

- Buys (shares and price, one per line): 100 42.50 / 50 38.20 / 25 45.00
- Fees and commissions (total): 0
- Current price: 47.10
- Account size: 25,000
- Risk per trade: 1%
- Planned entry price: 47.10
- Stop-loss price: 44.50
- Target price: 54.00
- **Average cost per share (with fees): 41.63**
- **Unrealized profit or loss: 957.50**
- **Return on cost: 13.14%**
- **Shares to buy for this risk: 96**
- **Amount at risk: 250.00**
- **Reward-to-risk ratio: 2.65 : 1**
- 검증 출처: Python decimal script: 7285/175 = 41.628571; 175 × 47.10 − 7285 = 957.50; floor(250/2.60) = 96; 6.90/2.60 = 2.653846

### Fees raise the cost basis

- Buys (shares and price, one per line): 10 100
- Fees and commissions (total): 10
- Current price: 90
- Account size: 25,000
- Risk per trade: 1%
- Planned entry price: 47.10
- Stop-loss price: 44.50
- Target price: 54.00
- **Average cost per share (with fees): 101.00**
- **Unrealized profit or loss: -110.00**
- **Return on cost: -10.89%**
- 검증 출처: (10 × 100 + 10)/10 = 101; 900 − 1010 = −110; −110/1010 = −10.891089% (hand calculation, Python decimal)

### Short trade with the stop above entry

- Buys (shares and price, one per line): 100 42.50
- Fees and commissions (total): 0
- Current price: 47.10
- Account size: 10,000
- Risk per trade: 2%
- Planned entry price: 50
- Stop-loss price: 52
- Target price: 44
- **Shares to buy for this risk: 100**
- **Reward-to-risk ratio: 3.00 : 1**
- **Position cost at entry: 5,000.00**
- 검증 출처: Budget 200 / risk 2 per share = 100 shares; reward 6 / risk 2 = 3 (hand calculation)

### Share count rounds down

- Buys (shares and price, one per line): 100 42.50
- Fees and commissions (total): 0
- Current price: 47.10
- Account size: 10,000
- Risk per trade: 1.5%
- Planned entry price: 23.40
- Stop-loss price: 21.75
- Target price: 28
- **Shares to buy for this risk: 90**
- **Reward-to-risk ratio: 2.79 : 1**
- **Position cost at entry: 2,106.00**
- 검증 출처: 150 / 1.65 = 90.9 → 90 shares (floor); 4.60/1.65 = 2.787879 (Python decimal)

## 자주 묻는 질문

### How do you calculate the average cost of a stock?

Add up what each buy cost, including fees, and divide by the total number of shares. For 100 shares at 42.50, 50 at 38.20 and 25 at 45.00, the cost is 4,250 + 1,910 + 1,125 = 7,285 for 175 shares, an average of 41.63. The position breaks even when the price returns to that average, plus any selling costs.

### How does averaging down lower my break-even price?

Buying more shares below your average cost pulls the average down. Holding 100 shares bought at 42.50, adding 50 at 38.20 lowers the average to (4,250 + 1,910) ÷ 150 = 41.07, so the stock needs to recover only to 41.07 instead of 42.50. It also increases the amount you lose if the price keeps falling.

### How many shares should I buy for my risk per trade?

Divide the amount you are willing to lose by the risk per share, the distance from entry to stop loss, and round down. Risking 1% of 25,000 is 250; with an entry at 47.10 and a stop at 44.50 the risk per share is 2.60, so 250 ÷ 2.60 = 96.15 gives 96 shares and a loss of 249.60 if the stop is hit.

### What is a good reward-to-risk ratio?

It depends on how often your trades win. The ratio is (target − entry) ÷ (entry − stop): 6.90 ÷ 2.60 = 2.65 for the defaults. At 2.65 to 1, winning more than 1 ÷ (1 + 2.65) = 27.4% of trades covers the losses, before costs; at 1 to 1 you need to win more than half.

### Is average cost the same as cost basis for US taxes?

Not for individual stocks. Under IRS Publication 550, if you do not identify which shares you sold, the first shares bought are treated as sold first (FIFO); the average-basis method is allowed for mutual fund shares and dividend reinvestment plans. Gains on shares held more than one year are long-term, and a loss is disallowed as a wash sale if you buy the same stock within 30 days before or after selling.

### “Stock average cost calculator (P&L and position size)”의 정확도는 어느 정도인가요?

정확도는 입력값과 계산 방법의 가정에 따라 달라집니다. 십진 연산은 유효숫자 50자리를 사용하지만, 추정값·수치해석 방법·원본 데이터의 정밀도는 더 낮을 수 있습니다. 표시값을 반올림해도 이러한 한계는 사라지지 않습니다. 독립적인 출처의 풀이와 대조한 계산 예시: 4. 예를 들어 “Three buys and a 1% risk plan”은 Python decimal script: 7285/175 = 41.628571; 175 × 47.10 − 7285 = 957.50; floor(250/2.60) = 96; 6.90/2.60 = 2.653846와 대조해 확인합니다.

### 이 계산 방법의 출처는 무엇인가요?

Van Tharp — Trade Your Way to Financial Freedom, ch. 14 (position sizing); FINRA — Understanding cost basis.

## 출처

- Van Tharp — Trade Your Way to Financial Freedom, ch. 14 (position sizing)
- [FINRA — Understanding cost basis](https://www.finra.org/investors/insights/cost-basis-basics)

_계획을 위한 참고용입니다. 대출기관, 세무당국과 시장은 자체 반올림 방식, 수수료와 규칙을 적용합니다. 계약 등의 결정을 내리기 전에 해당 기관에 수치를 확인하세요._
