Candle Script API
Server-side compile, run, and backtest endpoints require a signed-in session for a workstation or service account. For language syntax, see the language reference.
| Method | Path | Summary |
|---|---|---|
POST | /v1/scripts/compile | Compile source and return diagnostics. |
POST | /v1/scripts/run | Execute a compiled script against supplied bars. |
POST | /v1/scripts/diagnostics | List built-ins, namespaces, and diagnostic codes. |
POST | /v1/backtests/run | Run a synchronous strategy backtest. |
POST | /v1/backtests/jobs | Queue an asynchronous backtest job. |
GET | /v1/backtests/jobs | List backtest jobs. |
GET | /v1/backtests/jobs/{id} | Fetch one job result. |
bash
curl -s http://localhost:4000/v1/scripts/compile \
-H "Content-Type: application/json" \
-H "Cookie: session=..." \
-d '{"source":"indicator \"RSI\" { plot(rsi(close, 14), \"RSI\") }"}'