# Sizing and risk

> State what you are willing to lose. Size follows.

Source: https://algobarsx.com/docs/sizing/

Give an order a `risk:` as a percent of the balance or as money, and a stop. The size is worked out for you:

size = risk amount ÷ (stop distance × contract size × quote-to-account rate)

It is rounded down to the lot step and held between the market's minimum and maximum lot. If the minimum lot would carry more than you asked for, the trade still opens at the minimum lot and is marked *“above requested risk”* with the risk it actually carries ([E11](https://algobarsx.com/docs/rules-prices-distances-and-size/#E11)).

- Distances in pips, points or R are measured from the actual fill price, so a gap moves the stop and target with the entry ([E9](https://algobarsx.com/docs/rules-prices-distances-and-size/#E9)).
- A risk-based order with no stop is an error: *“Risk-based size needs a stop to measure risk from.”* ([AS0304](https://algobarsx.com/docs/diag-units-and-risk/#AS0304))
- [`size_for`](https://algobarsx.com/docs/ref-fn-sizing/#ref-size-for) tells you the lot size an entry would use, without placing it.
- You can also size directly with `size: 1 lot`.
