Save Parameter Settings
Strategy parameters set for a backtest can be saved into the strategy code; a live robot's parameters can be exported to a file and imported into another robot.
Saving backtest parameters
After changing strategy parameters on the backtest page, click "Save Backtest Settings": the parameters are saved together with the backtest configuration as a comment block at the top of the strategy code; see Backtest Configuration and Saving. For example, for a strategy with these parameters:
| Variable | Description | Type | Default |
|---|---|---|---|
| number | Number | Number (number) | 1 |
| string | String | String (string) | Hello FMZ |
| combox | Dropdown | Dropdown (selected) | 1|2|3 |
| bool | Boolean | Boolean (true/false) | true |
| numberA | Number A (filter isShowA: available only when isShowA is true) | Number (number) | 2 |
| isShowA | Whether to show numberA | Boolean (true/false) | false |
after changing the values and saving, the block at the top of the code looks like this (JavaScript and Rust use /*backtest ... */, Python uses '''backtest ... '''):
javascript
/*backtest
start: 2020-02-29 00:00:00
end: 2020-03-29 00:00:00
period: 1d
args: [["number",2],["string","Hello"],["combox",2],["bool",false],["numberA",666],["isShowA",true]]
*/
python
'''backtest
start: 2020-02-29 00:00:00
end: 2020-03-29 00:00:00
period: 1d
args: [["number",2],["string","Hello"],["combox",2],["bool",false],["numberA",666],["isShowA",true]]
'''
If a Rust strategy declares dependencies in a frontmatter block at the top, the backtest configuration block must come after the frontmatter; see Rust.
Importing and exporting live robot parameters
- On the robot page, click "Parameter Settings", then "Export Parameters"; the parameters are saved as a
jsonfile. - On the robot page that should receive them, click "Import Parameters" and choose the exported file.
- Click "Update Parameters" to save; the imported parameters take effect only then.