Price Action Trading Simulator

How do I calculate position size from my stop loss? Worked examples

The Price Action Trading Simulator team Updated · 6 min read

Two iPhone screens from Price Action Trading Simulator: a backtest with entry, stop loss and take profit, and a Today tab analysis

For a linear position before costs: units = chosen cash risk ÷ (stop distance × cash value per unit of price movement). This estimates planned loss at an assumed entry and stop fill. It does not guarantee a maximum loss or select a suitable risk budget for you.

What assumptions belong with the formula?

Specify the account and quote currencies, contract size, linear or nonlinear payoff, stop trigger, fill price and costs. A stop trigger is not a guaranteed execution price. Gaps, slippage, changing conversion rates, liquidation and funding can change the result. Stop-order and close-based exits must be modelled separately.

For a cost-aware linear example, let B be the cash risk budget, F fixed round-trip cost, d stop distance, v cash value per unit per price point, and k assumed variable round-trip cost per unit:

Units = (B − F) ÷ (d × v + k), provided B exceeds F.

It is still an assumed model. Round down to an allowed quantity, then recheck planned loss, minimum notional, available cash and margin. Rounding down limits the modelled amount; it does not cap actual loss.

Example 1: SOL/USDT with a USDT risk budget

Hypothetical values, not a historical trade: budget 10 USDT, entry 165, stop fill 162.50, one SOL per unit, no costs. Stop distance is 2.50 USDT per SOL:

  • Units = 10 ÷ 2.50 = 4 SOL.
  • Position value = 4 × 165 = 660 USDT.
  • Exact stop fill: 4 × 2.50 = 10 USDT planned loss.

If assumed variable costs are 0.05 USDT per SOL and fixed costs are zero, units = 10 ÷ (2.50 + 0.05) ≈ 3.9216 SOL before rounding. A worse fill can exceed that budget. USDT and USD are different currencies; convert explicitly for a USD account instead of silently assuming parity.

Example 2: conditional EUR/USD lots

Assume a USD account, a linear contract of 100,000 EUR per lot and a pip of 0.0001 USD per EUR. One pip per lot is 100,000 × 0.0001 = 10 USD. With a chosen 10 USD budget and a 20-pip stop:

Lots = 10 ÷ (20 × 10) = 0.05 lot, before costs and quantity constraints.

A different contract or account currency needs a different conversion. This is arithmetic under stated specifications, not a claim about every broker.

Example 3: conditional gold contract

Assume a broker contract of 100 ounces per lot, with a 5 USD-per-ounce stop distance and a 10 USD budget. Lots = 10 ÷ (5 × 100) = 0.02, before costs. A minimum order larger than 0.02 would make that modelled budget infeasible; do not round up to fit.

This conditional broker example is separate from the app’s GC=F gold futures history displayed as XAU/USD. The app does not provide a spot/CFD feed or establish broker lot, margin or sizing specifications. See the data methodology.

What about leverage?

For an unchanged linear quantity and identical fills, price P/L is unchanged by the margin fraction alone. But leverage can make larger exposure possible and introduce liquidation before a planned exit; funding and margin rules also matter. A stop-distance calculation is not a complete leveraged-risk model.

The distinction matters when free margin looks like money available to risk. In an original Forex Factory discussion, hals12 compared equal lot sizes under different leverage settings. In a separate thread, xp3000 asked how to work out leverage alongside a stop-based risk budget. Those questions establish the confusion, not a recommendation to choose higher leverage.

Same quantity, different margin; same margin, different quantity

Hypothetical worksheet: a USD account starts with 1,200 USD equity and no other positions. A linear EUR/USD long enters at 1.2000 and is assumed to exit exactly at 1.1980. That is a 0.0020 USD-per-EUR move, or 20 pips under the earlier pip definition. Ignore spread, fees, financing and currency-conversion charges for this exercise.

Choose a paper loss budget of 12 USD. The quantity calculation is 12 ÷ 0.0020 = 6,000 EUR. This budget is a chosen arithmetic input, not a suitable-risk recommendation. Assume margin is a constant percentage of the initial USD notional value; the two margin percentages below are illustrative, not available terms promised by any broker.

Initial measureA: 6,000 EUR, 5% marginB: 6,000 EUR, 1% marginC: 30,000 EUR, 1% margin
USD notional: quantity × 1.20007,200 USD7,200 USD36,000 USD
Required margin: notional × margin fraction360 USD72 USD360 USD
Price loss at the assumed exit: quantity × 0.002012 USD12 USD60 USD
Price loss ÷ initial equity1%1%5%
Initial notional ÷ equity6:16:130:1

A to B changes the margin assumption, while quantity stays fixed. The model holds less collateral but the same price move still loses 12 USD. A to C keeps the margin amount at 360 USD by increasing quantity fivefold. The price loss also becomes five times larger. Thus “I used the same margin” does not mean “I took the same price risk.”

OANDA’s margin explanation distinguishes the margin deposit from position size and notes that requirements can be tiered. Its P/L examples calculate the currency result from quantity and entry/exit prices. These support the distinction; the worksheet above is our own conditional calculation, not a quote of broker terms.

The table does not model whether a position can remain open until the stop. Required margin, account equity, other positions and provider-specific closeout rules must be checked separately; more free margin is not proof of safety. Gaps or worse fills can also make the loss exceed the paper budget. Do not use this table to predict a liquidation price.

Check the three amounts before replaying

Cover the answers and calculate B’s margin and C’s price loss yourself. Then write three separate fields for a simulated decision: cash loss at the assumed stop, initial notional value and required margin under a named assumption. Change only the margin fraction and check which fields stay the same; next change quantity and recheck all three.

Before treating a quantity as usable, round down to the permitted increment and verify the minimum order, available cash and margin conditions. If the modelled loss at the minimum quantity exceeds the chosen loss budget, the worksheet has no feasible trade under those assumptions. Moving the stop just to make a quantity fit changes the rule; review the risk-budget assumptions instead of silently increasing exposure.

What can I practise in the app?

Price Action Trading Simulator supports placing entry, stop and target in manual historical replay, with a configurable simulated fee in R and saved sessions. It has no broker connection or real-money trading. It is not a broker contract or margin calculator. Setup is free to view; starting a backtest needs Pro.

For a self-check, choose a paper risk budget, state the assumptions and calculate units outside the app before replaying a decision. Compare your calculation with the assumed exit and costs in a journal.

Source and scope: this is educational material by the Price Action Trading Simulator development team. Price/account examples are hypothetical unless identified as a historical observation; exact fills and omitted costs are assumptions, not guarantees. Our case-data methodology explains the historical sources, selection and limits.

Frequently asked questions

How do I calculate position size?

For a linear position before costs, units equal chosen cash risk divided by stop distance times cash value per unit of price movement. This estimates planned loss at an assumed fill; it does not guarantee a maximum actual loss.

Does leverage change risk?

It changes financing and margin requirements; it can also introduce liquidation and funding exposure. The simple stop-distance formula does not model these. Verify the instrument’s full contract and margin rules.

How many EUR/USD lots does a 20-pip stop allow?

In the conditional example of a USD account, 100,000 units per lot and 10 USD planned risk, a 20-pip stop gives 0.05 lot before costs. Contract and minimum-size rules must be checked; the account balance alone cannot determine size.

Is the app’s XAU/USD the same as a broker gold contract?

No. The app replays Yahoo’s GC=F COMEX gold futures series under an XAU/USD label. That is not a spot or CFD feed, and it does not establish your broker’s lot size or execution rules.

Is used margin the amount I will lose at my stop?

No. In a simplified linear model, margin is a deposit calculated from notional exposure and a margin requirement. Price loss depends on quantity and the entry-to-exit move. Costs, closeout rules and fills require separate checks.

Written by the app’s development team. See the data, selection rules and limits of these first-party examples. Sources & method →

Keep reading