Position sizing
position_sizeSize a position the way a risk manager would: fixed-fractional risk to a stop, volatility targeting (ATR or annualized vol), or fractional Kelly from your edge statistics. Applies a max-position cap and round lots, and explains the binding constraint. Price: $0.005.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| atr | No | volatility: average true range in price units. | |
| side | No | long | |
| equity | Yes | ||
| method | Yes | ||
| avg_win | No | kelly: average win (any unit, same as avg_loss). | |
| avg_loss | No | kelly: average loss as a positive number. | |
| lot_size | No | Round down to this multiple, default 1. | |
| risk_pct | No | fixed_fractional: fraction of equity to risk, default 0.01. | |
| win_rate | No | kelly: probability of a win (0-1). | |
| annual_vol | No | volatility: annualized volatility of the asset (e.g. 0.35). | |
| stop_price | No | fixed_fractional: protective stop. | |
| entry_price | Yes | ||
| atr_multiple | No | volatility: stop distance in ATRs, default 2. | |
| kelly_fraction | No | kelly: fraction of full Kelly to use, default 0.25. | |
| allow_fractional | No | ||
| max_position_pct | No | Cap on position value / equity, default 0.2. | |
| target_annual_vol_contribution | No | volatility: target vol contribution as fraction of equity, default 0.02. |