Position size from risk
position_sizeWorks out how big a trade can be so that hitting the stop-loss loses only the chosen share of the account, fees included, plus the margin needed at a given leverage and whether liquidation comes before the stop. Pure calculation.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"account": "<account>",
"risk_pct": "<risk_pct>",
"entry": "<entry>",
"stop": "<stop>"
},
"name": "position_size"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stop | Yes | Stop-loss price. Below the entry for a long, above it for a short; the side is read from this. | |
| entry | Yes | Planned entry price. | |
| account | Yes | Account size in USD. | |
| fee_pct | No | Fee per side in percent. Default 0.05. | |
| leverage | No | Leverage used to work out the margin needed. Optional, default 1 (no leverage). | |
| risk_pct | Yes | Share of the account to risk, in percent (e.g. 1). |