Appearance
API Reference
This page is the API reference for dxScript platform services.
Transports
dxScript platform services are available over two transports, HTTP and WebSocket. Each transport carries a subset of the services:
| Transport | Services | Typical use |
|---|---|---|
| HTTP | Validator, Backtesting | REST-style RPC from browsers, backends, and CI |
| WebSocket | Validator, Backtesting, IndiChart | Interactive chart apps and low-latency streaming |
Both RPC services use Protocol Buffers as the canonical schema. HTTP endpoints accept and return JSON, with camelCase field names mapped from the proto definitions.
Note: IndiChart is a channel service on WebSocket only. It does not expose HTTP RPC methods; clients open an
INDICHART/1channel and exchange typed messages.
Platform RPC
| Service | Proto package | Method | HTTP path suffix |
|---|---|---|---|
| Validator | dxscript.indicators.v1.IndicatorService | validate | /dxscript.indicators.v1.indicatorservice/validate |
| Backtesting | dxscript.backtesting.v1.BacktestingService | backtest | /dxscript.backtesting.v1.backtestingservice/backtest |
Full URL pattern:
text
{origin}/dxscript.<package>.<servicename>/<method>Common request fields
Both RPC methods require:
| Field | Type | Description |
|---|---|---|
lang | string | Script language; use dxscript-js |
content | string | Full dxScript source code |
Backtesting adds market-data selectors — see Backtest.
Common error shape
Failed script compilation or execution returns a ScriptError object:
| Field | Type | Description |
|---|---|---|
id | string | Error identifier |
type | string | Error category |
scriptName | string | Script name when known |
startLine, startColumn | int | Start of error span (1-based; -1 if unknown) |
endLine, endColumn | int | End of error span |
message | string | Human-readable message |
scriptStack | array | { functionName, line, column } frames |
HTTP validation errors (missing fields, unsupported language) return standard dxLink HTTP error responses instead of a ValidateResponse / BacktestResponse.
Channel service
| Service | Channel name | Version |
|---|---|---|
| IndiChart | INDICHART | 1 |
Open the channel through the dxLink CHANNEL_REQUEST flow with IndiChartInitParameters as the service payload. Inbound client messages and indicator status are documented in IndiChart service. Chart-data payloads are defined in IndiChart Protocol.
OpenAPI / schema sources
The HTTP host publishes an OpenAPI 3.1 document for both RPC methods: endpoints, request and response bodies, and status codes. Browse it in Swagger UI, which also links to the raw document.
Field descriptions and examples are in Backtest and Validate.
Endpoints by topic
Script API
- indicator() — indicator declaration and display settings
- strategy() — strategy simulation API and trade semantics
Platform RPC
- Validate — indicator and strategy validation RPC
- Backtest — historical backtesting RPC
- IndiChart Protocol — snapshot, update, and indicator payload schemas