How many coins to buy or sell so that hitting your stop loses only the share of the account you chose to risk, fees included.
10,000 USDT account, 1% risk, long entry 60,000, stop 58,800, 0.05% fee per side, 5x leverage: risk 100 USDT, loss per BTC 1,259.40, quantity 0.079403 BTC, position 4,764.17 USDT, margin 952.83 USDT.
The position size calculator answers one question before a trade is placed: how large can this position be so that, if the stop loss is hit, the account loses only the percentage you decided in advance? Use it whenever you have a defined stop price; without a stop there is nothing to size against.
Account balance is the capital in the account you are trading, not your total savings. Risk % is the share of that balance you accept losing if the stop triggers; keeping it small means a run of losing trades does not cut deep into the account. Entry and stop are prices: a stop below entry is treated as a long, a stop above entry as a short. Place the stop where the trade idea is proven wrong, not where the loss happens to look comfortable. Fee is charged per side as a percentage of notional. Leverage does not change the size at all; it only changes how much margin is locked up.
A 5,000 USDT account risks 0.5% on a short at 2,500 with a stop at 2,575, paying 0.04% per side at 3x leverage. Risk amount = 5,000 × 0.5% = 25 USDT. Loss per unit = |2,500 − 2,575| + 2,500 × 0.04% + 2,575 × 0.04% = 75 + 1.00 + 1.03 = 77.03 USDT. Quantity = 25 ÷ 77.03 ≈ 0.324549 units, position value ≈ 0.324549 × 2,500 ≈ 811.37 USDT, and margin at 3x ≈ 270.46 USDT.
Read the quantity as the maximum size for the risk you chose, and the margin as the cash the exchange will hold against it. If the position value comes out larger than balance × leverage, the tool flags that the trade cannot be opened at that leverage, which usually means the stop is too tight for the risk you picked.
The formula assumes the stop fills exactly at the stop price. In fast markets stop orders can fill worse, and price gaps around news or thin trading can skip the stop entirely, so the real loss can exceed the risk amount. Funding payments on a perpetual are not included. A stop placed beyond the liquidation price never gets used, because the position is closed first, so check it against the liquidation price calculator. Finally, raising leverage to free up margin does not lower the risk: the loss at the stop stays the same.
Reference only, not investment advice. Exchange rules (maintenance margin tiers, fee tiers, funding intervals) change; check your exchange before trading.