The formula
risk amount = equity x risk per trade stop distance = |entry - stop loss| value per unit = contract size x tick value (per instrument) lot size = risk amount / (stop distance x value per unit)
The result is then clamped to the broker's minimum lot, its step size and your own max lot cap. If clamping would push the trade above your risk budget, the signal is rejected rather than executed too large.
Worked example
Equity 10,000 USD Risk per trade 0.5% -> 50 USD at risk Signal BUY EURUSD 1.0850, SL 1.0800 Stop distance 0.0050 -> 50 pips Pip value 10 USD per pip per standard lot lot size = 50 / (50 x 10) = 0.10 lots
Why metals and indices differ
Contract size differs per instrument and per broker. Gold is often 100 ounces per lot; an index CFD might be 1 or 10 contracts per point; micro variants divide everything by ten. PipSync reads the spec from your broker per symbol rather than assuming — and rejects the trade if it cannot read one.
A tight stop means a big position
That is the formula working, not a bug. Same risk in currency, more lots. If that feels wrong, lower risk per trade or cap it with max lot size.