The most common trading mistake is not picking the wrong direction. It is being right about the direction and wrong about the size - so that one normal loss removes a month of gains.
Position size is the fix, and it is one division: the money you are prepared to lose, divided by the distance to your stop. Everything else follows from it.
How to use it
- Account equity - what is in the account now, not what you hope will be.
- Risk per trade - the share of that equity a stop-out is allowed to cost. One to two percent is where most measured systems live.
- Entry price - where you get in.
- Stop price - where you are wrong. If you do not have one, you do not have a position size, you have a guess.
- Leverage - only if trading futures. It does not change the size; it changes the margin and the liquidation distance.
The calculator returns the size in units of the asset, the notional value of the position, and the margin an exchange would ask for at that leverage.
The arithmetic
money at risk = equity × risk%
stop distance = |entry − stop|
position size = money at risk ÷ stop distance
notional = position size × entry
margin = notional ÷ leverage
A worked example: a 1,000 USD account, risking 1%, buying BTC at 78,000 with a stop at 76,500. Money at risk is 10 USD. The stop is 1,500 away. The size is 10 ÷ 1,500 = 0.00667 BTC, worth about 520 USD. At 1× that needs 520 USD of margin; at 5× it needs 104.
Notice that the risk is 10 USD in both cases. Leverage did not make the trade riskier - it made it cheaper to hold and easier to liquidate.
How the engine uses this
The NusaTerminal automation engine sizes every position with exactly this formula. The stop is 1.5× ATR from entry - measured volatility, not a fixed percentage - so on a volatile pair the stop is wider and the size smaller, and on a quiet pair the reverse. The money at risk is the same either way. That is what lets a backtest's R-multiples and a live account's results be the same units.