Type/to search
Getting Started
Welcome to FMZ Quant Trading Platform
Quick Start
Key Security
Platform Basics
Account and Billing
Live Robot Billing and Top-up
Sub-accounts
Exchange
General Protocol
Local Credential Files
Exchange-Specific Notes
Securities and Futures
Crypto
Docker
Strategy Library
Live Trading
Writing Strategies
Development Tools
Backtesting System
Advanced Topics
Data and Research
Integrations

The backtest configuration on the "Backtest" tab (time range, exchanges, fees, ...) and the strategy parameters can be saved with the strategy and are loaded again the next time the strategy is opened.

Saving

  • Click "Save Backtest Settings": the configuration and strategy parameters are written as a comment block (the backtest block) at the top of the strategy source.
  • Click "Save Strategy": the platform also records the current backtest configuration and strategy parameters.

Loading

  • When the strategy editor is opened or refreshed, the configuration in the source's backtest block is loaded first.
  • If the source has no backtest block, the configuration recorded by the last "Save Strategy" is loaded.
  • After editing the backtest block by hand, click the "Backtest Settings" button above the block to apply the change to the backtest form.

Block format

The word backtest follows the language's block-comment opener directly, then one key: value per line:

javascript
/*backtest start: 2024-01-01 00:00:00 end: 2024-03-01 00:00:00 period: 1h basePeriod: 15m exchanges: [{"eid":"Binance","currency":"BTC_USDT","balance":10000,"stocks":0,"fee":[0.1,0.1]}] args: [["fast",5],["slow",20]] */

Comment syntax per language: JavaScript, TypeScript, Rust and PINE use /*backtest ... */; Python uses '''backtest ... '''; MyLanguage uses (*backtest ... *).

KeyFormatDescription
start, endYYYY-MM-DD HH:mm:ssStart and end time, parsed in the browser's time zone.
period1m, 1h, 1d etc., or secondsStrategy K-line period.
basePeriodsameBase K-line period; defaults to period; ignored in real-tick mode.
mode1Real-tick mode; omit for simulated-tick mode.
exchangesJSON arrayOne element per exchange object, fields below.
argsJSON arrayStrategy parameters, [["name", value], ...]; a third element with a template ID sets that template's parameter: ["name", value, templateId].

Fields of an exchanges element; everything except eid and currency is optional:

FieldDescription
eidExchange ID, e.g. Binance, Futures_OKX.
currencyTrading pair, e.g. BTC_USDT.
balance, stocksInitial quote-currency and base-currency balances.
fee[maker rate, taker rate] in percent.
feeMinMinimum fee per fill; only applies to some markets.
depthDeep, depthAmountDepth levels and the amount on each simulated level.
tradesModeWhether trade prints are replayed in real-tick mode: "0" replay, "1" do not.
feederCustom data source URL, see Backtesting System → Custom Data Source.

"Save Backtest Settings" also writes some keys starting with bt (e.g. btSlipPoint slippage, btNetDelay network delay, btFaultTolerant failure probability, btMaxBarLen max K-line bars) that record the other options of the backtest form; editing them by hand is not recommended. The local backtest engines read the same block, see Backtesting System → Local Backtesting Engine.