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
Local Backtesting Engine
Backtest Page Shortcuts
Advanced Topics
Data and Research
Extended API Interface

Which programming languages and exchanges the backtest system supports, and where strategies in each language are backtested.

Programming languages

The backtesting system supports strategies written in JavaScript, Python, Rust, PINE, MyLanguage and Workflow.

  • JavaScript strategies are backtested in the browser, where the backtest engine runs as WebAssembly; nothing needs to be installed. JavaScript strategies can be debugged with Chrome DevTools during a backtest, see this guide.
  • Rust strategies are compiled by the platform's servers; third-party crates declared in the strategy's frontmatter are fetched at compile time, so no local toolchain is needed. The backtest node defaults to "Cloud" (runs on the platform's servers); you can also choose "Local", which runs in the browser.
  • For Python strategies the backtest node defaults to "Cloud" (the platform's public servers); you can also choose your own docker, or "Local: Python3" to backtest in the browser (run with Pyodide). A backtest on a docker, like live trading, uses the Python 3 environment of the docker's system; install the third-party libraries you need yourself. The public servers only provide common libraries.
  • Workflow strategies show each node's execution state and data flow visually during a backtest.

Exchanges

Backtests use the platform's historical data; the exchanges selectable on the backtest page are the ones that can be backtested (the MCP tool list_exchanges also shows this: exchanges with backtest set to true have history data).

  • Cryptocurrency: spot and futures of major exchanges, e.g. Binance and Futures_Binance, OKX and Futures_OKX, HTX and Futures_HTX, Bybit and Futures_Bybit, Bitget and Futures_Bitget, GateIO and Futures_GateIO, with all symbols of the exchange.

    These are the exchange IDs used for backtesting (the eid in the /*backtest*/ configuration and in the MCP tool run_backtest, matching the names of the history data server). For most exchanges they equal what exchange.GetName() returns in live trading, but a few differ: backtest OKX and Futures_OKX correspond to live OKEX and Futures_OKCoin (OKX futures); backtest HTX and Futures_HTX correspond to live Huobi and Futures_HuobiDM (HTX futures). If a strategy branches on the exchange name, handle both spellings.

  • Futu Securities (Futures_Futu): Hong Kong, US and other stock markets. Only daily data is available for backtesting; set currency to STOCK and select the stock code in the strategy with exchange.SetContractType():

javascript
/*backtest start: 2024-05-01 00:00:00 end: 2025-02-17 00:00:00 period: 1d basePeriod: 1d exchanges: [{"eid":"Futures_Futu","currency":"STOCK","fee":[0.03,0.03]}] */ function main() { // Set the stock code: Tesla var info = exchange.SetContractType("TSLA.US") // Contract info: InstrumentID, PriceTick, LotTick, VolumeMultiple, ... Log("info:", info) // Daily market data at the current backtest time Log(exchange.GetTicker()) }