Skip to main content
Sizing turns a size range into a share count. It is arithmetic on numbers you pass in: it reads no rule, writes nothing and says nothing about whether to add the holding.

In the app

Adding a holding can fill the share count from your size range at its minimum, midpoint or maximum.

With an agent

An agent calls POST /positions/size (MCP: calculate_position_size, see Check tools). The call needs read access and your own price. Take both bounds from the class’s rule (get_rules or GET /position-rules): its size range, or its short size range for a short. For a short, pass the class’s short size range as the bounds, a positive manual_shares and a negative current_shares for a short you hold. The share count, value and percent come back negative. See Shorts.

What the target means

The target is held between 0 and 100 percent of portfolio_value, not inside your range. When it lands outside the range, compliance_status is BELOW_MIN or ABOVE_MAX and the share count is still the one asked for. With no bounds, compliance_status is UNEVALUATED, which is not a pass.

Example

Illustrative example. The figures are hypothetical, not a recommendation.
The response has target_shares, target_value, target_pct, shares_delta and value_delta, with compliance_status and, when you sent cash, can_afford and cash_after_trade. The result is a calculation. Nothing is recorded; to change what you hold, update your holdings.

Next steps