# Position Size Calculator

> Computes how many shares (or units) to buy or short so that hitting the stop-loss loses a fixed percentage of the account, using the fixed-fractional method: risk amount divided by the risk per share.

- Calculator id: `position-sizing` · Category: Investing & Real Estate (`investing`) · Tool name: `calculate_position_size`
- Canonical page: https://tttkmbb.com/investing/position-sizing · This document: https://tttkmbb.com/investing/position-sizing.md · JSON definition: https://tttkmbb.com/investing/position-sizing.json

## Purpose

Computes how many shares (or units) to buy or short so that hitting the stop-loss loses a fixed percentage of the account, using the fixed-fractional method: risk amount divided by the risk per share.

**Use when:** You have an entry and stop-loss price and want the number of shares that keeps the potential loss at a chosen fraction of the account.

**Do not use when:** You want the mathematically optimal fraction to bet from a known edge (Kelly criterion) or the reward side of the trade (use risk-reward-ratio). Informational only; not financial advice.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `account_size` | number |  | required | Total trading capital. (> 0, max 1000000000000) |
| `risk_percent` | number | % | required | Share of the account you are willing to lose if the stop is hit (commonly 0.5–2 %). (> 0, max 100) |
| `entry_price` | number |  | required | Planned entry price per share or unit. (> 0, max 1000000000) |
| `stop_loss_price` | number |  | required | Price at which the trade is exited at a loss; below the entry for a long, above it for a short. (min 0, max 1000000000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `risk_amount` | number |  | account_size × risk_percent / 100. |
| `risk_per_share` | number |  | \|entry_price − stop_loss_price\|. |
| `stop_distance_percent` | number | % | risk_per_share / entry_price × 100. |
| `shares` | integer |  | floor(risk_amount / risk_per_share). |
| `position_value` | number |  | shares × entry_price. |
| `position_percent_of_account` | number | % | position_value / account_size × 100 (above 100 % requires leverage). |
| `actual_risk_amount` | number |  | shares × risk_per_share. |
| `direction` | string |  | Long when the stop is below the entry, short when above. |

## Formula

`risk_amount = account_size × risk_percent/100; risk_per_share = |entry_price − stop_loss_price|; shares = floor(risk_amount / risk_per_share); position_value = shares × entry_price`

Fixed-fractional position sizing: the loss at the stop, not the position value, is held to a constant fraction of capital. Slippage, gaps through the stop and commissions can make the real loss larger. Informational mathematics only; not financial advice.

## Data Sources

- Britannica Money – Calculating position size in trading — https://www.britannica.com/money/calculating-position-size (reference, retrieved 2026-09-24)
- Wikipedia – Risk return ratio — https://en.wikipedia.org/wiki/Risk_return_ratio (reference, retrieved 2026-09-24)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/position-sizing?account_size=…&risk_percent=…&entry_price=…&stop_loss_price=…`
- `POST https://tttkmbb.com/api/v1/calculate/position-sizing` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/position-sizing · OpenAPI operationId `calculate_position_size` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "position-sizing", "inputs": {…}}`

## Example

- 50,000 account, 1 % risk, entry 100, stop 95: inputs `{"account_size":50000,"risk_percent":1,"entry_price":100,"stop_loss_price":95}` → `{"risk_amount":500,"risk_per_share":5,"stop_distance_percent":5,"shares":100,"position_value":10000,"position_percent_of_account":20,"actual_risk_amount":500,"direction":"Long (stop-loss below entry)"}`
- Short: 20,000 account, 2 % risk, entry 40, stop 42: inputs `{"account_size":20000,"risk_percent":2,"entry_price":40,"stop_loss_price":42}` → `{"risk_amount":400,"risk_per_share":2,"shares":200,"position_value":8000,"position_percent_of_account":40,"direction":"Short (stop-loss above entry)"}`

```
GET https://tttkmbb.com/api/v1/calculate/position-sizing?account_size=50000&risk_percent=1&entry_price=100&stop_loss_price=95
```

## Limitations

You want the mathematically optimal fraction to bet from a known edge (Kelly criterion) or the reward side of the trade (use risk-reward-ratio). Informational only; not financial advice. Fixed-fractional position sizing: the loss at the stop, not the position value, is held to a constant fraction of capital. Slippage, gaps through the stop and commissions can make the real loss larger. Informational mathematics only; not financial advice. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is the share count rounded down?**

Rounding up would risk more than the chosen percentage; flooring keeps the actual risk at or below the target, which actual_risk_amount reports.

**What if the position is larger than the account?**

A tight stop can imply a position above 100 % of capital; that requires margin and the calculator flags it in the position percentage rather than capping it.

## Related

- [Risk/Reward Ratio Calculator](https://tttkmbb.com/investing/risk-reward-ratio.md) — Reward-to-risk of the same entry, stop and target.
- [Stock Profit Calculator](https://tttkmbb.com/finance/stock-profit.md) — Profit or loss of the position at a given exit price.
- [Maximum Drawdown Calculator](https://tttkmbb.com/investing/max-drawdown.md) — Largest peak-to-trough loss of an equity curve.
