Catalog/trade-position-size

Calculators

Fixed-fractional position size API

Fixed-fractional position sizing: units = (account · riskPct) / |entry − stop|, so a stop-out costs no more than the chosen fraction of the account. Deterministic risk math LLMs miscompute. Answers 'how many shares risking 1%','what position size for a 5-point stop','how big a trade can I take'.

Price$0.01per request
MethodPOST
Route/v1/calc/trade-position-size
StatusLive
MIME typeapplication/json
Rate limit120/minute
CacheNo cache
calctradingposition-sizerisk-managementstop-lossfixed-fractionalmoney-managementsizing
API URLhttps://x402.hexl.dev/v1/calc/trade-position-size
Integration docs
Example request
{
  "account": 10000,
  "riskPct": 1,
  "entry": 100,
  "stop": 95
}
Example response
{
  "account": 10000,
  "riskPct": 1,
  "entry": 100,
  "stop": 95,
  "direction": "long",
  "riskCapital": 100,
  "riskPerUnit": 5,
  "units": 20,
  "positionValue": 2000,
  "positionPctOfAccount": 20,
  "formula": "units = (account · riskPct) / |entry − stop|"
}
Input schema
{
  "type": "object",
  "required": [
    "account",
    "riskPct",
    "entry",
    "stop"
  ],
  "properties": {
    "account": {
      "type": "number",
      "description": "Account equity (currency).",
      "examples": [
        10000
      ]
    },
    "riskPct": {
      "type": "number",
      "description": "Percent of account to risk, e.g. 1 = 1%.",
      "examples": [
        1
      ]
    },
    "entry": {
      "type": "number",
      "examples": [
        100
      ]
    },
    "stop": {
      "type": "number",
      "examples": [
        95
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}