Start with the amount at risk
Balance multiplied by risk percentage gives your cash budget. Divide that by the estimated loss per lot at the stop, including costs. The result is rounded down to the permitted lot step so rounding never increases your chosen risk.