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.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"equity": 50000,
"method": "fixed_fractional",
"risk_pct": 0.01,
"stop_price": 95,
"entry_price": 100
},
"name": "position_size"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| atr | No | volatility: average true range in price units. | |
| side | No | long | |
| equity | Yes | ||
| method | Yes | ||
| api_key | No | Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial. | |
| 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 | Required when method is fixed_fractional: the protective stop price. | |
| 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. |