Calculate Position Size
calculate_position_sizeCalculate how many shares to buy so a stop-loss costs no more than a set risk percentage, and get the ATR-based stop distance.
Instructions
Sizes a position from account risk rather than gut feel: how many shares can be
bought such that being stopped out costs no more than risk_percent of the account.
Also reports the ATR-based stop distance for context.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | Ticker symbol (e.g. MU, NVDA). | |
| entry_price | No | Planned entry. Defaults to the latest close. | |
| risk_percent | No | Percent of account equity to risk on this trade (default 1.0). | |
| stop_loss_price | Yes | The price at which the thesis is wrong and you exit. | |
| account_currency | No | Currency line to size against (default USD). | USD |