Type/to search
Getting Started
Platform Basics
Writing Strategies
Development Tools
Backtesting System
Overview and Starting a Backtest
Backtest Modes and Order Matching
Backtest Configuration and Saving
Supported Languages and Exchanges
Reading Backtest Results
Parameter Optimization
Custom Data Source
Data Format
Custom Data Source Example
Local Backtesting Engine
Backtest Page Shortcuts
Advanced Topics
Data and Research
Extended API Interface

The backtest system can use a custom data source instead of the platform's historical data: set the exchange's data source in the backtest configuration to the custom data source (feeder) address, and during the backtest the platform's data server requests that URL with the GET method, so the URL must be reachable from the public internet. The request carries these parameters:

ParameterMeaningDescription
symbolSymbol nameSpot like BTC_USDT, futures like BTC_USDT.swap; funding rate and price index: see below
eidExchangeFor example: OKX, Futures_OKX
roundData precisionAlways round=true: values are integers scaled by precision; see Data Format
periodK-line data period (milliseconds)For example: 60000 represents a 1-minute period
depthOrder book depth levels1-20
tradesWhether trade-by-trade data is requiredYes (1) / No (0); always 0 in simulated-tick backtests
fromStart timeUnix timestamp in seconds
toEnd timeUnix timestamp in seconds
detailInstrument detailsAlways detail=true: the response must include the instrument details
eventRequest typefeed: market data requested when the backtest starts; fill: older K-lines when there are not enough bars
custom--This parameter can be ignored
  • Perpetual contract backtests also request funding rate data (symbol like BTC_USDT.funding) and price index data (symbol like BTC_USDT.index); see Data Format.
  • event=fill requests always carry depth=2&trades=0&custom=0, with period 900000 or 86400000.

Example requests sent by the backtest system to a custom data source (one for a spot and one for a futures exchange object):

url
http://customserver:9090/data?custom=0&depth=20&detail=true&eid=Bitget&event=feed&from=1351641600&period=86400000&round=true&symbol=BTC_USDT&to=1611244800&trades=0 http://customserver:9090/data?custom=0&depth=20&detail=true&eid=Futures_OKX&event=feed&from=1351641600&period=86400000&round=true&symbol=BTC_USDT.swap&to=1611244800&trades=0

In this sectionRead the whole section

NameDescription
Data FormatA custom data source returns JSON in one of the two formats below, recognized automatically: simulated-tick backtests use K-line data, real-tick backtests use o…
Custom Data Source ExampleA minimal custom data source service written in Go, and a test strategy to check it.