API & MCP

Everything a person can do on RavingDesk Position Size & Risk Planner, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

RavingDesk Position Size & Risk Planner

Calculates how many units fit a fixed risk budget (account × risk %) between entry and stop, including an estimated round-trip fee, plus the loss at the stop, the profit at the target, reward/risk and a price-move map. It is the risk planner of the RavingDesk paper-trading workspace; it does not place orders.

Inputs of RavingDesk Position Size & Risk Planner
FieldTypeDefaultDescription
sideselect (long, short)"long"Direction
account (required)number10000Account size. Paper account value in your account currency.
riskPercent (required)number1Risk per trade
entry (required)number100Entry price
stop (required)number95Stop price. Below entry for a long, above entry for a short.
target (required)number110Target price. Above entry for a long, below entry for a short.
feenumber0Estimated round-trip fee. Entry plus exit fee in account currency; it is taken out of the risk budget.

Example request

Long: 10,000 account, 1 % risk, entry 100, stop 95, target 110, fee 4

curl -X POST https://ravingdeskpositionsize.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"side":"long","account":10000,"riskPercent":1,"entry":100,"stop":95,"target":110,"fee":4}'

Every result contains

inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.

MCP (Model Context Protocol)

{
  "mcpServers": {
    "ravingdesk-position-size": { "type": "http", "url": "https://ravingdeskpositionsize.usefulweb.site/mcp" }
  }
}