ComputeYard

The math, explained — built by a derivatives quant.

Position Size Calculator

Size every trade by risk, not gut feel: enter your account, the percentage you'll risk per trade and your entry and stop, and get the exact number of whole shares to buy.

How it works

Fixed-fractional position sizing decides how much to buy from how much you're willing to lose. First it turns your risk per trade into cash: risk amount = account size × risk %. That's the most this trade may cost you if the stop is hit.

The distance from entry to stop is your risk per share. Dividing the cash risk budget by the per-share risk gives the number of shares — floored to whole units, so the realised loss at the stop is always at or below your budget. From the share count it derives the position value, what fraction of the account that ties up, and the actual cash at risk if you're stopped out.

Worked example

Account $25,000, risking 1% per trade, entry $50.00, stop $48.00:

  • Risk budget = $25,000 × 1% = $250.00.
  • Risk per share = |$50.00 − $48.00| = $2.00.
  • Shares = floor($250 ÷ $2) = 125 shares.
  • Position value = 125 × $50 = $6,250.00 — that's 25% of the account.
  • Actual risk if stopped = 125 × $2 = $250.00 (exactly the budget here, since 250 ÷ 2 is whole).

The formula

risk_amount    = account_size × risk_per_trade_pct
per_share_risk = |entry_price − stop_price|
shares         = floor(risk_amount ÷ per_share_risk)   (whole shares)
position_value = shares × entry_price
% of account   = position_value ÷ account_size
actual_risk    = shares × per_share_risk   (≤ risk_amount)

FAQ

How much should I risk per trade?
Many traders cap risk at 1–2% of account equity per trade, so a losing streak can't blow up the account. This is a sizing tool, not advice — pick a level that fits your plan.
Why are shares rounded down?
Whole shares only: flooring means the loss at your stop is always at or below your risk budget. The small leftover is the bit a fractional share would have used.
Does it account for commissions or slippage?
No. It sizes off the clean entry-to-stop distance. Fees and slippage widen your real loss slightly, so treat the result as the maximum size, not a floor.

More calculators