QTSurfer API (0.93.0)

Download OpenAPI specification:

QTSurfer backend services API

Exchange

This set of endpoints allows interaction with various exchanges for cryptocurrencies and financial assets. With these endpoints, users can access information about available exchanges, retrieve the instruments (currency pairs or assets) offered by each exchange, and perform analyses on them. The data provided by these endpoints is crucial for strategic decision-making within the trading platform.

Key functionalities:

  • Retrieve the list of available exchanges on the platform.
  • Get the instruments available on a specific exchange (currency pairs, assets, etc.).

Get a list of available exchanges

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a list of Instruments from a specific exchange

path Parameters
exchangeId
required
string
Example: binance

ID of the exchange to retrieve instruments for

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Backtesting

The backtest endpoints enable users to test trading strategies based on historical data before applying them in real-time trading. This functionality is essential for traders who want to evaluate the performance of a strategy under past market conditions and optimize it before implementing it in a live trading environment.

Key functionalities:

  • Prepare historical market data for fast access.
  • Run simulations of trading strategies using prepared historical market data.
  • Assess performance and optimize strategies based on past results and metrics.

Prepare backtesting data

Enqueues a prepare task over the requested date range. Returns immediately with a jobId; poll GET /backtest/{exchangeId}/{type}/prepare/{jobId} for completion.

The same params always return the same jobId (idempotent). Repeated calls with identical params do not enqueue duplicate work — they reuse the existing job.

Authorizations:
bearerAuth
path Parameters
exchangeId
required
string
Example: binance

ID of the exchange to prepare the backtesting for

type
required
string (DataSourceType)
Value: "ticker"
Example: ticker

The type of data source to prepare from

Request Body schema: application/json
required

The required data to prepare a backtesting

instrument
required
string (Instrument)

Exchange instrument identifier (e.g. a currency pair)

from
required
string

Start date for the preparation process. Supports the following formats:

  • ISO-8601 (e.g. 2024-12-14T23:59:59Z)
  • ISO DATE (e.g. 2024-12-14)
  • BASIC ISO DATE (e.g., 20241214)
to
required
string

End date for the preparation process. Supports the following formats:

  • ISO-8601 (e.g. 2024-12-14T23:59:59Z)
  • ISO DATE (e.g. 2024-12-14)
  • BASIC ISO DATE (e.g., 20241214)

Responses

Request samples

Content type
application/json
{
  • "instrument": "BTC/USDT",
  • "from": "2024-12-13T00:00:00Z",
  • "to": "2024-12-14T00:00:00Z"
}

Response samples

Content type
application/json
{
  • "jobId": "13RBLGQlPnfDjO6wyKSX8i"
}

Get the status of a prepare job

Retrieves the current state of the prepare job identified by jobId. Poll until status is Completed, Failed, or Aborted.

Authorizations:
bearerAuth
path Parameters
exchangeId
required
string
Example: binance

ID of the exchange for the backtesting process

type
required
string (DataSourceType)
Value: "ticker"
Example: ticker

The type of data source to prepare from

jobId
required
string
Example: 13RBLGQlPnfDjO6wyKSX8i

Job ID returned by POST /prepare

Responses

Response samples

Content type
application/json
{
  • "contextId": "jctx:ticker:4a627755-7f5a-4297-b647-8dddd8aee416:binance:1rabbrpk5r4kkegs83w6qr:btc/usdt:0bjmoxd4vahkgc0hnvdldh",
  • "status": "Completed",
  • "statusDetail": null,
  • "size": 0,
  • "completed": 24,
  • "startTime": "2026-04-14T15:00:00Z",
  • "endTime": "2026-04-14T15:00:01Z"
}

Execute a compiled strategy against a prepared dataset

Enqueues an execute task that runs the strategy identified by strategyId over the data prepared by the prepare job identified by prepareJobId. The instrument and date range are recovered from the prepare job — they do not need to be sent again.

Returns immediately with a jobId; poll GET /backtest/{exchangeId}/{type}/execute/{jobId} for the result.

The same params (same prepareJobId, strategyId, storeSignals) always return the same jobId (idempotent).

Authorizations:
bearerAuth
path Parameters
exchangeId
required
string
Example: binance

ID of the exchange for the backtesting process

type
required
string (DataSourceType)
Value: "ticker"
Example: ticker

The type of data source to execute from

Request Body schema: application/json
required

Execute task parameters

prepareJobId
required
string

Job ID returned by POST /prepare (must be in Completed state)

strategyId
required
string (strategyId)

Unique identifier for a compiled strategy

storeSignals
boolean
Default: false

When true, the worker uploads emitted signals to object storage and the response includes signalsUrl / signalsId fields. Defaults to false.

Responses

Request samples

Content type
application/json
{
  • "prepareJobId": "13RBLGQlPnfDjO6wyKSX8i",
  • "strategyId": "6bsh31ikwkuivhtgcoa6s4",
  • "storeSignals": false
}

Response samples

Content type
application/json
{
  • "jobId": "13RBLGQlPnfDjO6wyKSX8i"
}

Cancel a running backtest execution

Requests cancellation of the specified execution. The execution status will transition to Aborted once the cancellation is processed. Cancellation is asynchronous — poll the GET endpoint to confirm the final status.

Authorizations:
bearerAuth
path Parameters
exchangeId
required
string
Example: binance
type
required
string (DataSourceType)
Value: "ticker"
Example: ticker

Managed exchange data sources available for backtesting. Currently only ticker is supported; kline and funding rate support is planned.

jobId
required
string
Example: 13RBLGQlPnfDjO6wyKSX8i

Job ID returned by POST /execute

Responses

Response samples

Content type
application/json
{
  • "status": "cancelling",
  • "jobId": "13RBLGQlPnfDjO6wyKSX8i"
}

Get the result of a backtest execution job

Retrieves the current state and results of the execute job identified by jobId. Poll until state.status is Completed, Failed, or Aborted.

Authorizations:
bearerAuth
path Parameters
exchangeId
required
string
Example: binance

ID of the exchange for the backtesting process

type
required
string (DataSourceType)
Value: "ticker"
Example: ticker

The type of data source to execute from

jobId
required
string
Example: 13RBLGQlPnfDjO6wyKSX8i

Job ID returned by POST /execute

Responses

Response samples

Content type
application/json
{
  • "state": {
    },
  • "results": {
    }
}

Strategy

The strategy endpoints allow users to submit, compile, and validate trading strategies within the platform. This feature is crucial for traders who develop automated trading systems and wish to ensure their strategy is both executable and effective before deploying it in a live/backtesting environment.

Key functionalities:

  • Submit rich Java™ based trading strategies for validation and compilation.
  • Ensure strategies meet the required syntax and operational constraints.
  • Validate strategies to identify potential issues or errors before execution.
  • Integrate strategies with specific exchanges and market instruments for tailored use.

Compile a strategy from source code

Submits raw strategy source for compilation. By default the call is synchronous and returns the strategyId once compilation succeeds. Set the header X-Compile-Async: true to enqueue the compile task and return immediately with a jobId — poll GET /strategy/{strategyId} to check status.

The strategyId is deterministic: the same source for the same user always produces the same id.

Authorizations:
bearerAuth
header Parameters
X-Compile-Async
boolean
Default: false

When true, compile asynchronously and return 202 with a jobId.

Request Body schema: text/plain
required

The raw strategy source code

string

Raw strategy Java source code

Responses

Response samples

Content type
application/json
{
  • "strategyId": "6bsh31ikwkuivhtgcoa6s4"
}

Get the status of an async compile task

Polls the status of a strategy compilation. Useful when the strategy was submitted with X-Compile-Async: true. Returns the resolved strategyId once compilation completes.

Authorizations:
bearerAuth
path Parameters
strategyId
required
string
Example: 6bsh31ikwkuivhtgcoa6s4

The id returned by POST /strategy (sync) or the jobId returned in async mode

Responses

Response samples

Content type
application/json
{
  • "jobId": "6bsh31ikwkuivhtgcoa6s4",
  • "status": "Completed",
  • "strategyId": "6bsh31ikwkuivhtgcoa6s4",
  • "statusDetail": "string"
}