Appearance
Platform Services
Three services expose script execution to clients:
| Service | Transport | Purpose |
|---|---|---|
| Validator | HTTP or WebSocket RPC | Compile and validate scripts on a synthetic candle snapshot |
| Backtesting | HTTP or WebSocket RPC | Run strategies and indicators over historical candles |
| IndiChart | dxLink WebSocket channel | Stream live candles and indicator outputs to chart clients |
How they fit together
text
┌─────────────────┐
│ dxScript code │
└────────┬────────┘
│
┌───────────────────┼───────────────────┐
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Validator │ │ Backtesting │ │ IndiChart │
│ (metadata) │ │ (history) │ │ (realtime) │
└──────────────┘ └──────────────┘ └──────────────┘Use the validator when you need to check that a script compiles, discover its declared inputs and outputs, or obtain first-bar calculation samples without loading market data.
Use backtesting when you need a full historical run: candles for a date range, per-bar indicator outputs, and strategy trade reports with performance analytics.
Use IndiChart when you need a live chart feed: candle snapshots and updates aligned with indicator calculation results over a dxLink WebSocket session.
Choosing a service
| Aspect | Validator | Backtesting | IndiChart |
|---|---|---|---|
| Market data | Synthetic snapshot | Historical candles | Live feed subscription |
| Calculation window | First bar samples only | Full loaded window | Streaming per subscription |
| Strategy reports | Performance summary only | Yes | No |
| Transport | HTTP / WebSocket RPC | HTTP / WebSocket RPC | WebSocket channel |
| Best for | Compile checks, input discovery | Historical strategy evaluation | Live charts and realtime preview |
Pick one service per task — they are complementary, not interchangeable. Validate before publishing, backtest when you need history and trade analytics, and subscribe through IndiChart when the UI needs a live stream.
Language support
All services accept dxScript source with lang set to dxscript-js.
Strategy scripts (strategy() in the init section) are always supported by backtesting. The validator accepts them unless strategy support is disabled on the deployment. IndiChart compiles indicator scripts only.
Related documentation
- API Reference — endpoints, request shapes, and response fields
- Language Reference — dxScript language API
- Strategy — trading simulation API
- Indicator — indicator declaration API