Skip to content

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:

TransportServicesTypical use
HTTPValidator, BacktestingREST-style RPC from browsers, backends, and CI
WebSocketValidator, Backtesting, IndiChartInteractive 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/1 channel and exchange typed messages.

Platform RPC ​

ServiceProto packageMethodHTTP path suffix
Validatordxscript.indicators.v1.IndicatorServicevalidate/dxscript.indicators.v1.indicatorservice/validate
Backtestingdxscript.backtesting.v1.BacktestingServicebacktest/dxscript.backtesting.v1.backtestingservice/backtest

Full URL pattern:

text
{origin}/dxscript.<package>.<servicename>/<method>

Common request fields ​

Both RPC methods require:

FieldTypeDescription
langstringScript language; use dxscript-js
contentstringFull dxScript source code

Backtesting adds market-data selectors — see Backtest.

Common error shape ​

Failed script compilation or execution returns a ScriptError object:

FieldTypeDescription
idstringError identifier
typestringError category
scriptNamestringScript name when known
startLine, startColumnintStart of error span (1-based; -1 if unknown)
endLine, endColumnintEnd of error span
messagestringHuman-readable message
scriptStackarray{ functionName, line, column } frames

HTTP validation errors (missing fields, unsupported language) return standard dxLink HTTP error responses instead of a ValidateResponse / BacktestResponse.

Channel service ​

ServiceChannel nameVersion
IndiChartINDICHART1

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 ​