Save Backtest Settings
In the "Simulation Backtest" tab of the Strategy Editor Page (i.e., the backtesting system), you can configure backtest settings, strategy parameters, and other options for strategy backtesting. Backtest configuration is used to set the backtest time range, backtest exchange, trading slippage, commission fees, and other conditions; strategy parameters are used to set the parameter options of the strategy.
After setting these parameter configurations, you can perform strategy backtesting according to the settings. So how do you save these configured settings?
-
- You can use the "Save Backtest Settings" button on the Strategy Editor Page to record all backtest configuration information (including backtest settings and strategy parameter settings) in the strategy source code in the form of code.
-
- When clicking the "Save Strategy" button on the strategy editor page to save the strategy, the platform will automatically record the current backtest settings, strategy parameter configurations, and other information.
How does the backtesting system load backtest configurations?
-
- When refreshing the strategy editor page or reopening the strategy editor page, it will prioritize automatically loading the backtest configuration information recorded through the "Save Backtest Settings" button.
-
- If there is no backtest configuration information recorded in comment form
backtestin the current strategy code (saved in the strategy code through the "Save Backtest Settings" button), the backtesting system will automatically configure the backtest settings to the backtest configuration information from the last time the "Save Strategy" button was clicked for this strategy.
- If there is no backtest configuration information recorded in comment form
-
- If you have modified the backtest configuration information recorded in comment form at the beginning of the strategy code in the strategy editor page, and need to synchronize the updated backtest configuration information to the options in the strategy backtest interface, you can click the "Backtest Settings" button above
backtestin the strategy editing area.
- If you have modified the backtest configuration information recorded in comment form at the beginning of the strategy code in the strategy editor page, and need to synchronize the updated backtest configuration information to the options in the strategy backtest interface, you can click the "Backtest Settings" button above
Examples
-
After clicking the "Save Backtest Settings" button, there are slight differences in the format when saving backtest settings to the strategy code for
JavaScript/Python/C++/MyLanguage/PINElanguage strategies:javascript/*backtest start: 2021-06-26 00:00:00 end: 2021-09-23 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Binance","currency":"BTC_USDT"}] */python'''backtest start: 2021-06-26 00:00:00 end: 2021-09-23 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Binance","currency":"BTC_USDT"}] '''c++/*backtest start: 2021-06-26 00:00:00 end: 2021-09-23 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Binance","currency":"BTC_USDT"}] */ -
MyLanguage:
mylang(*backtest start: 2021-06-26 00:00:00 end: 2021-09-23 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Binance","currency":"BTC_USDT"}] *) -
PINE Language:
pine/*backtest start: 2021-06-26 00:00:00 end: 2021-09-23 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Binance","currency":"BTC_USDT"}] */