romaco_calculate_position_size
Calculate position size based on account risk management rules: given account size, risk percentage, entry price, and stop loss, returns exact shares to trade, total risk, and position value.
Instructions
Calculate position size based on account risk management rules. Given account size, risk percentage, entry price, and stop loss — returns exact shares/contracts to trade, total risk in dollars, position value, and risk/reward ratio if target is provided. Pure math — no data source or browser needed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| riskPct | Yes | Max risk as percentage of account (e.g., 1 = risk 1% = $100 on a $10,000 account). Recommended: 0.5–2%. | |
| stopLoss | Yes | Stop loss price. Must be below entry for longs, above for shorts. | |
| entryPrice | Yes | Planned entry price per share/unit | |
| accountSize | Yes | Total account value in USD (e.g., 10000) | |
| targetPrice | No | Take profit target. Used to calculate risk/reward ratio (optional). | |
| commissionPerSide | No | Commission cost per trade side in USD (default 0). Affects net P&L calculation. |