Position Size Calculator with Sleep-Well Mode
Enter your account, entry, stop-loss and the drawdown you can actually tolerate. Get one recommended size, see which limit bound it, and check whether a realistic losing streak fits your plan. Everything is calculated in your browser.
Account and risk limit
The trade
Risk per trade and drawdown tolerance
Worked example (Sleep-Well Mode)
Illustrative only. A 10,000 account, 1% standard risk, a 10% maximum drawdown and 8 consecutive full stop-outs, before trading costs.
- Standard risk budget: 1% × 10,000 = 100.
- Sleep-Well risk cap: 1.31% × 10,000 ≈ 130.84 — the largest per-trade risk that still fits the 10%/8-loss scenario.
- Because 100 is lower than 130.84, the user’s own 1% limit is the binding constraint here.
- Projected drawdown after 8 losses at 1% risk: 1 − 0.998 ≈ 7.73%, inside the 10% tolerance.
- Raise the risk to 2% and the same streak projects 1 − 0.988 ≈ 14.9% — a breach, so Sleep-Well Mode would cut the size instead.
The live calculator repeats this arithmetic using your own inputs, and adds costs and broker rounding, so its figure can differ slightly from the round numbers above.
Contract specification
Every field is editable because brokers and exchanges use different specs. The preset only fills sensible defaults.
Trading costs
Portfolio and target
Journal and plan
Sleep-Well Mode: the drawdown constraint
Your per-trade risk limit answers “how much do I risk on this one trade?” Sleep-Well Mode answers a second question: “how much can I risk per trade and still survive N full stop-outs without breaching the drawdown I can tolerate?” The calculator applies both limits and uses the lower one.
- Scenario: test whether the account stays inside a 10% drawdown after 8 consecutive full stop-outs.
Preset stress scenarios
Planner presets, not recommendations. Tap one to set N, then adjust if you wish.
Recommended position size
—
Key numbers
Standard size vs Sleep-Well size
| Constraint | Max size | Cash risk at that size | Status |
|---|
Drawdown path under the stress scenario
| Loss # | Risk taken | Equity after | Cumulative drawdown | Vs tolerance |
|---|
Sensitivity: projected drawdown by risk % and losing streak
| Risk per trade | 3 losses | 5 losses | 8 losses | 10 losses | 15 losses |
|---|
Cost drag, recovery and extra checks
Cost drag
Recovery requirement
Reward & break-even (if target entered)
Prop-firm / daily-loss check
Copy, share and export
Nothing is uploaded. All calculations run in your browser; saved settings stay on this device only.
Every formula used, in plain language
Symbols: \(E\) = account equity, \(r\) = risk per trade as a decimal, \(P_e\) = entry, \(P_s\) = stop, \(D=|P_e-P_s|\), \(V\) = cash value of a 1.0 price move per 1 unit of size, \(c\) = per-unit round-trip cost in price units, \(F\) = fixed round-trip commission, \(f_{x}\) = quote-to-account currency rate, \(N\) = consecutive losses, \(DD\) = maximum acceptable drawdown.
1. Cash risk budget
Your risk limit converted into money. Percentage risk normally uses current equity so that risk shrinks as the account shrinks.
2. Loss per unit of size (all-in)
What one share, lot or contract actually loses when the stop is hit — stop distance plus spread plus slippage, converted to your account currency, plus per-unit commission.
3. Standard (risk-based) position size
The fixed commission is deducted before dividing, then the result is always rounded down to the broker’s quantity step so the real risk never exceeds the plan.
4. Sleep-Well maximum risk per trade
The largest per-trade risk that still keeps the account inside your tolerance after \(N\) consecutive full stop-outs. A 10% tolerance over 8 losses gives about 1.31% — not 1.25% — because percentage losses shrink the equity base.
5. Sleep-Well size cap
\(b\) is the optional uncertainty buffer. The tool sizes against the lower of your own risk limit and the drawdown limit, then names which one bound the result.
6. Projected drawdown at a given size
7. Reverse solves
A 20% drawdown needs a 25% gain to recover. The streak-probability line assumes independent trades and a stable win rate — assumptions that often fail in real markets.
8. Cost drag, margin and reward
Leverage changes the margin a position requires. It does not make the same quantity less risky at your stop.
Frequently asked questions
How do I calculate position size?
Divide the money you are willing to lose on the trade by the loss per unit if the stop is hit. If you risk 1% of a 10,000 account (100) and your all-in loss per share is 5.40, the size is 100 ÷ 5.40 ≈ 18 shares, rounded down to your broker’s step. Include spread, slippage and commission in the loss per unit, or your real risk will be higher than planned.
How many consecutive losses can my account withstand?
With percentage risk the usable count is \(N=\lfloor \ln(1-DD) / \ln(1-\text{risk}\%) \rfloor\). At 1% risk and a 10% tolerance you can take roughly 10 full stop-outs before hitting the threshold, because each loss is taken from a smaller equity base. Use the stress scenario field to test any value you expect to face.
What is a good risk percentage per trade?
There is no universal number. It depends on your tolerance, your stop distance and how long a losing streak your strategy can realistically produce. This tool shows what each level implies for your drawdown rather than declaring a level correct.
Why did Sleep-Well Mode reduce my size?
Because your normal risk setting would breach your own tolerance after the number of losses you chose. The tool always shows both numbers and labels the binding constraint, so you can decide whether to accept a smaller size, widen your tolerance, or reconsider the stop.
Does a bigger stop always mean a smaller position?
Yes, at a fixed cash risk budget. Loss per unit rises with stop distance, so quantity falls. That is why the same lot size on trades with very different stops produces very different risk.
Is the result a guarantee of safety?
No. It is a scenario-based planning aid. Gaps over the stop, slippage, liquidity, fees and forced liquidation can all produce losses larger than the model, and a losing streak is only one path to a drawdown.
Assumptions, accuracy and common mistakes
Assumptions
- Every loss equals the full planned stop-out risk. Real fills can be worse.
- In compounding mode, risk is recalculated on the remaining equity after each loss.
- Contract specifications, spread and slippage are the values you enter, not live broker data.
- Open positions are treated as independent unless you enter their risk, and correlated trades can lose together.
- Calculations are nominal; financing, swap and overnight interest are not modelled.
Common mistakes this tool guards against
- Entering a stop on the wrong side of the entry — blocked with a plain-language error.
- Mixing the compounding and fixed-cash models — the toggle makes the choice explicit.
- Ignoring fees on tight stops — the cost-drag panel shows what fees consume.
- Rounding size up — the calculator only ever rounds down, and warns when no tradeable size fits.
- Assuming leverage reduces risk — leverage is treated as a margin constraint, not a risk reducer.
Accuracy note
Arithmetic uses standard double-precision floating point and results are floored to your quantity step, so displayed risk may be marginally below the calculated maximum. Percentages are shown to two decimals; small rounding differences are expected. Re-verify any figure against your broker’s own contract specification before placing an order.
Educational use only. This calculator is a scenario-based planning aid for position sizing and drawdown awareness. It is not investment advice, not a prediction, and not a safety guarantee.
About this tool
Built for AlamToolKit.com. One page, multiple functions: trade inputs, execution costs, the Sleep-Well drawdown constraint, worked formulas, charts and a screenshot-ready result summary. Single self-contained file — no external JavaScript libraries beyond MathJax for the formula typesetting.
© AlamToolKit.com — position size calculator with Sleep-Well drawdown mode. Educational use only.
Position Size Calculator with Sleep-Well Mode: Complete User Guide
This guide walks through every result the AlamToolKit Position Size Calculator produces, explains the arithmetic behind it, defines each field with its unit, validates your inputs, and shows how to read the answer without over-trusting it. It mirrors the live calculator's four result areas: the recommended size, the key-number tiles, the cap comparison chart and table, the drawdown projection, the sensitivity grid, and the cost / reward / recovery panels.
All formulas are shown in plain text so they render on any device. The live calculator uses the same arithmetic with double-precision floating point and floors each size to your broker's quantity step.
What Is This Calculation Used For?
A position size calculator answers one practical question: how many shares, lots, contracts or coins should I trade so that a stop-out costs only what I planned to lose? The Sleep-Well extension answers a second question on top of that: how much can I risk per trade and still survive N consecutive full stop-outs without breaching the drawdown I can tolerate?
The calculator applies both limits, uses the lower one, and then names which constraint bound the result. That last part matters: a size that is limited by your own 1% risk rule is a different decision from a size limited by a drawdown scenario. The tool makes that distinction visible instead of hiding it inside a single number.
Where traders and engineers apply this
- Discretionary trading: size a stock, forex or futures trade so the cash loss at the stop matches a fixed risk budget.
- Systematic / algorithmic trading: convert a percentage risk target into an integer quantity that respects contract multipliers and broker steps.
- Prop-firm challenges: test whether a daily loss limit or a static / trailing maximum drawdown rule would be breached before the first target is reached.
- Risk engineering and project finance: the same arithmetic sizes exposure when a stop-equivalent loss tolerance must be derived from a capital buffer.
- Teaching and journaling: the copied summary and CSV export preserve the assumptions so a review later is honest.
Key User Pain Points and How This Calculator Solves Them
Pain: "My lot size is right but my risk is not."
Two trades with the same lot size but very different stop distances carry very different risk. The calculator converts stop distance, spread, slippage and commission into a single all-in loss per unit, so the quantity comes out of real risk, not habit.
Pain: "I round up and my risk silently rises."
The tool always floors the raw size to your broker's quantity step. It never rounds up past the budget, and when no tradeable size fits it says so plainly instead of showing a misleading number.
Pain: "I don't know which limit actually set my size."
A binding-constraint label appears in the hero, the tiles and the cap table. You can see instantly whether your own risk rule, the Sleep-Well drawdown cap, margin or portfolio heat produced the final number.
Pain: "I mix compounding and fixed-cash drawdown math."
A single toggle makes the model explicit. Compounding uses 1 − (1 − DD)^(1/N); simple uses DD / N. The tool states which one produced the projection, so the two are never silently blended.
Pain: "I forget that fees eat tight stops."
The cost-drag panel shows spread, slippage and commission as a cash amount and as a percentage of the risk budget. When costs consume the whole budget, the tool refuses the trade and explains why.
Pain: "Leverage feels like it reduces risk."
Leverage is treated strictly as a margin constraint. The calculator warns when margin exceeds capital but never uses leverage to shrink the loss at the stop.
Visual: How the Three Caps Combine Into One Position Size
Step-by-Step Guide to Every Results Calculation
The calculator produces six result areas. Each section below defines the field, its unit, the formula and the validation rule that protects it.
Step 1 — Input Validation (Before Any Number Is Shown)
The calculator refuses to produce a size until the inputs are internally consistent. These checks run first, and each failure appears as a plain-language error in the results panel.
| Input field | Rule | Error shown when broken |
|---|---|---|
| Account equity | Must be > 0 | "Account equity must be greater than zero." |
| Entry price | Must be > 0 | "Entry price must be greater than zero." |
| Stop-loss price (long) | Must be < entry | "Long trades need a stop-loss BELOW the entry." |
| Stop-loss price (short) | Must be > entry | "Short trades need a stop-loss ABOVE the entry." |
| Stop distance | Must be > 0 | "Stop distance is zero — entry and stop-loss cannot be the same price." |
| Loss per unit | Must be > 0 | "Loss per unit works out to zero." |
| Consecutive losses (N) | Integer ≥ 1 | "Consecutive losses to withstand must be at least 1." |
| Risk % | 0 < risk ≤ 100 | "Risk per trade cannot exceed 100% of the account." |
| Max drawdown % | 0 < DD < 100 | "Maximum drawdown must be between 0% and 100%." |
| Single-trade risk vs DD | Risk ≤ total DD tolerance | "Your single-trade risk is larger than your total drawdown tolerance." |
| Value per price move | Must be > 0 | "Value per price move must be greater than zero." |
| Pip / point size | Must be > 0 | "Pip / point size must be greater than zero." |
| Contract size | Must be > 0 | "Contract size must be greater than zero." |
| Costs vs risk budget | Costs < budget | "Fees, spread and slippage consume the entire risk budget." |
Step 2 — Cash Risk Budget
Field: R_budget | Unit: account currency (USD, EUR, BDT, etc.).
This is your risk limit converted into money. Percentage risk normally uses current equity so that risk shrinks as the account shrinks; fixed cash is used for prop accounts with absolute loss limits.
Worked example
If risk mode is "fixed cash", the percentage shown on the tiles is the cash amount expressed as a percentage of current equity, so the two views stay consistent.
Step 3 — Loss Per Unit of Size (All-In)
Field: u | Unit: account currency per 1 unit of size (per share, per lot, per contract).
What one share, lot or contract actually loses when the stop is hit — stop distance plus spread plus slippage, converted to your account currency, plus per-unit commission. This is the number that makes tight-stop fee drag visible.
Worked example (US stock)
Step 4 — Standard Risk-Based Position Size
Field: Q_risk | Unit: shares / lots / contracts / coins, floored to your broker's step.
The fixed commission is deducted before dividing, then the result is always rounded down to the broker's quantity step so the real risk never exceeds the plan.
| Broker step | Raw size | Floored size | Cash risk at floored size |
|---|---|---|---|
| 1 share | 19.80 | 19 shares | 19 × 5.05 = 95.95 |
| 0.01 lot | 0.1980 | 0.19 lots | 0.19 × 5.05 = 0.9595 |
| 0.0001 coin | 0.1980 | 0.1980 coins | 0.1980 × 5.05 = 0.9999 |
Step 5 — Sleep-Well Maximum Risk Per Trade
Field: r_max and R_drawdown | Unit: % of equity and account currency.
The largest per-trade risk that still keeps the account inside your tolerance after N consecutive full stop-outs. A 10% tolerance over 8 losses gives about 1.31% — not 1.25% — because percentage losses shrink the equity base.
Worked example (compounding, 10% DD, 8 losses)
Because the standard budget of 100 is lower than 130.84, the user's own 1% limit is the binding constraint. Raise the risk to 2% and the same streak projects 14.9% — a breach — so Sleep-Well Mode would cut the size instead.
Step 6 — Recommended Size and Binding Constraint
Field: final_size and binding | Unit: shares / lots / contracts / coins, plus a text label.
The smallest of the four caps — risk budget, Sleep-Well, margin and portfolio heat — becomes the final size. The calculator names which one bound it so you can make a deliberate choice about whether to accept the smaller size, widen the tolerance, or reconsider the stop.
| Label | Meaning | What to do next |
|---|---|---|
| Risk budget | Your own percentage or cash risk limit set the size. | This is the normal case. No action needed unless you want to explore a smaller size. |
| Sleep-Well drawdown cap | The drawdown scenario allowed less risk than your own rule. | Decide whether to accept the smaller size, widen the tolerance, or reduce N. |
| Margin / buying power | Leverage or capital cannot support a larger position. | Reduce size or raise available capital. Leverage is not a risk reducer. |
| Portfolio heat cap | Open risk plus this trade exceeds your total heat cap. | Close or reduce an existing position first, or lower this trade's risk. |
Step 7 — Planned Risk and Projected Drawdown
Fields: planned_risk (account currency), eff_risk_pct (% of equity), planned_DD (% of equity).
Planned risk is the all-in cash loss if the floored size is stopped out: final_size × u + fixed_commission. Projected drawdown converts that into a percentage after N consecutive losses, using the model you selected.
Worked example (US stock, 1% risk, 8 losses)
Step 8 — Survivable Losses and Recovery Requirement
Fields: n_survive (integer losses) and gain_to_recover (%).
The calculator solves the reverse question: given the effective risk per trade, how many consecutive full stop-outs fit inside the tolerance before the threshold is reached? It also shows the gain needed to climb back from the projected drawdown.
Step 9 — Cost Drag, Margin and Reward
These panels show what the trade costs, what capital it ties up, and what it pays if the target is hit. Each field is defined below with its unit.
| Field | Unit | Formula | What to watch |
|---|---|---|---|
| Cost drag | Account currency and % of R_budget | (c_price × V × f_x + commission_per_unit) × final_size + fixed_commission | Above 25% of the risk budget, the tool warns that costs are unusually high. |
| Position notional | Account currency | final_size × contract_size × entry × f_x | Compare with account equity to gauge concentration. |
| Estimated margin | Account currency | notional / leverage | If margin exceeds equity, the tool warns. |
| Reward-to-risk (R:R) | Ratio (unitless) | |TP − entry| / |entry − stop| | Only shown when the target is on the correct side of the entry. |
| Break-even win rate | % | 100 / (1 + R:R) | The win rate at which the strategy is indifferent before costs. |
| Net profit at target | Account currency | final_size × |TP − entry| × V × f_x − costs | Already net of spread, slippage and commission. |
Step 10 — Cap Table, Equity Chart and Sensitivity Grid
The results panel also renders three visual aids: a bar chart of each cap, an equity line for the stress scenario, and a sensitivity grid of projected drawdown across risk levels and losing streaks. Each one is a direct visualisation of the formulas above — no separate model is used.
| Risk per trade | 3 losses | 5 losses | 8 losses | 10 losses | 15 losses |
|---|---|---|---|---|---|
| 0.25% | 0.75% | 1.24% | 1.98% | 2.47% | 3.69% |
| 0.50% | 1.49% | 2.47% | 3.93% | 4.89% | 7.23% |
| 1.00% | 2.97% | 4.90% | 7.73% | 9.56% | 13.97% |
| 1.50% | 4.44% | 7.28% | 11.40% | 14.03% | 20.26% |
| 2.00% | 5.88% | 9.61% | 14.92% | 18.29% | 26.14% |
| 3.00% | 8.73% | 14.13% | 21.62% | 26.26% | 36.63% |
Green = inside a 10% tolerance, amber = within 15% of it, red = breaching it. The grid uses the compounding model and a 10% tolerance as an illustration; the live calculator uses your own tolerance.
Accuracy Note: What the Numbers Do and Do Not Promise
The calculator uses standard double-precision floating point and floors each size to your quantity step, so displayed risk may be marginally below the calculated maximum. Percentages are shown to two decimals; small rounding differences are expected.
Every loss is assumed to equal the full planned stop-out. In real markets, gaps over the stop, slippage, liquidity, fees and forced liquidation can all produce losses larger than the model. The projected drawdown is a scenario, not a forecast, and a losing streak is only one path to a drawdown.
Re-verify any figure against your broker's own contract specification before placing an order. This calculator is an educational planning aid — not investment advice, not a prediction, and not a guarantee of safety.
Real-World Usage Examples
Example 1 — US stock, 1% risk, 8-loss stress test
A 10,000 USD account trades a 100.00 stock with a 95.00 stop and a 112.00 target. Spread and slippage total 0.05, fixed commission is 2.00, per-share commission is 0.01. Loss per share is 5.05. The risk budget is 100.00, so the raw size is 19.40 shares; floored to 1 share steps, the recommended size is 19 shares. Planned risk is 95.95, which is 0.96% of equity. After 8 consecutive stop-outs at the compounding model, projected drawdown is 7.73% — inside the 10% tolerance. Reward-to-risk is 2.40R, break-even win rate is 29.41%.
Example 2 — Forex major, 0.5% risk, 3-loss conservative plan
A 25,000 USD account trades a USD-quoted major with a 20-pip stop. Value per standard lot is 100,000, pip size is 0.0001, so loss per lot is 20 × 0.0001 × 100,000 = 200.00 USD before costs. Risk budget is 125.00, raw size is 0.625 lots; floored to 0.01 lot steps, the recommended size is 0.62 lots. Planned risk is 124.00. With a 10% tolerance over 3 losses, the Sleep-Well cap is about 3.48% per trade, which is higher than the user's 0.5% rule — so the risk budget binds and the size stays at 0.62 lots.
Example 3 — Futures ES, prop-firm daily loss limit
A 50,000 USD prop account trades ES with a 4-point stop. Value per price move is 50, so loss per contract is 4 × 50 = 200.00 USD. A 2% risk budget gives 1,000.00 USD, raw size is 5 contracts; floored to 1-contract steps, the recommended size is 5 contracts. Planned risk is 1,000.00. The daily loss limit is 2% = 1,000.00, so this single trade uses 100% of it — the prop check flags this explicitly. The user can lower risk to 1% or widen the stop plan.
Common Mistakes This Calculator Guards Against
- Entering a stop on the wrong side of the entry — blocked with a plain-language error, not silently flipped.
- Mixing compounding and fixed-cash models — a toggle makes the choice explicit and the result panel states which model was used.
- Ignoring fees on tight stops — the cost-drag panel shows what fees consume as a percentage of the risk budget.
- Rounding size up — the calculator only ever floors, and warns when no tradeable size fits.
- Assuming leverage reduces risk — leverage is treated as a margin constraint, never as a risk reducer.
- Forgetting open portfolio risk — the heat-cap check adds open risk to this trade and warns when the total exceeds the cap.
Frequently Asked Questions
How do I calculate position size?
Divide the money you are willing to lose on the trade by the loss per unit if the stop is hit. If you risk 1% of a 10,000 account (100) and your all-in loss per share is 5.05, the size is 100 ÷ 5.05 ≈ 19 shares, rounded down to your broker's step. Include spread, slippage and commission in the loss per unit, or your real risk will be higher than planned.
How many consecutive losses can my account withstand?
With percentage risk the usable count is N = floor( ln(1 − DD) / ln(1 − risk%) ). At 1% risk and a 10% tolerance you can take roughly 10 full stop-outs before hitting the threshold, because each loss is taken from a smaller equity base. The calculator's stress-scenario field lets you test any N you expect to face.
What is a good risk percentage per trade?
There is no universal number. It depends on your tolerance, your stop distance and how long a losing streak your strategy can realistically produce. This tool shows what each level implies for your drawdown rather than declaring a level correct.
Why did Sleep-Well Mode reduce my size?
Because your normal risk setting would breach your own tolerance after the number of losses you chose. The tool always shows both numbers and labels the binding constraint, so you can decide whether to accept a smaller size, widen your tolerance, or reconsider the stop.
Does a bigger stop always mean a smaller position?
Yes, at a fixed cash risk budget. Loss per unit rises with stop distance, so quantity falls. That is why the same lot size on trades with very different stops produces very different risk.
Is the result a guarantee of safety?
No. It is a scenario-based planning aid. Gaps over the stop, slippage, liquidity, fees and forced liquidation can all produce losses larger than the model, and a losing streak is only one path to a drawdown.
Why does the tool show two different sizes?
One size is the standard risk-based size; the other is the Sleep-Well size. The recommended size is the smaller of the two, because the drawdown constraint should never be ignored just to trade a larger position. The cap table and bar chart make the comparison visible.
What currency are the results shown in?
The account currency you select. If the instrument is quoted in a different currency, the quote-to-account FX rate field converts the value per price move and the costs before sizing. Leave FX at 1 when the instrument is quoted in your account currency.
About This Guide
Published by AlamToolKit.com as the user-facing companion to the Position Size Calculator with Sleep-Well Mode. The guide mirrors the live calculator's arithmetic exactly, so the numbers you read here match the numbers you see there — apart from the deliberate rounding differences described in the accuracy note.
Educational use only. This material is not investment advice, not a prediction, and not a safety guarantee. © AlamToolKit.com