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

Variable (naming example)DescriptionTypeDefault Value (description)Component Configuration (description)Notes
cmdNumDescription of interactive control cmdNumNumber type (number)Default value is optional, can be left emptyUsed to set the component type, minimum value, maximum value, grouping, etc. of the interface control bound to the current interactive itemNotes for interactive control cmdNum
cmdBoolDescription of interactive control cmdBoolBoolean type (true/false)Default value is required, on or offSame as aboveNotes for interactive control cmdBool
cmdStrDescription of interactive control cmdStrString type (string)Default value is optional, can be left emptySame as aboveNotes for interactive control cmdStr
cmdComboxDescription of interactive control cmdComboxDropdown (selected)Default value is optional, can be left emptySame as aboveNotes for interactive control cmdCombox
cmdBtnDescription of interactive control cmdBtnButton (button)Button control does not bind input itemsSame as aboveNotes for interactive control cmdBtn

Messages (strings) sent to the strategy after interactive control is triggered:

  • Number type
    After entering interactive data 123 in the input box of interactive control cmdNum, click the button of interactive control cmdNum. The GetCommand() function in the strategy program will receive the message: cmdNum:123.
  • Boolean type
    After setting the switch control of interactive control cmdBool to on, click the button of interactive control cmdBool. The GetCommand() function in the strategy program will receive the message: cmdBool:true.
  • String type
    After entering interactive data abc in the input box of interactive control cmdStr, click the button of interactive control cmdStr. The GetCommand() function in the strategy program will receive the message: cmdStr:abc.
  • Dropdown
    After selecting the second option in the dropdown of interactive control cmdCombox, click the button of interactive control cmdCombox. The GetCommand() function in the strategy program will receive the message: cmdCombox:1, where 1 represents the index of the selected option, the first option has index 0, the second option has index 1.
  • Button
    Click the button of interactive control cmdBtn. The GetCommand() function in the strategy program will receive the message: cmdBtn.

The "Component Configuration" of interactive controls is the same as for strategy parameters (see Strategy Parameters → Component Configuration).

Example: changing a strategy parameter with an interactive control

On the strategy editing page, add a string interactive control named changeSymbol under "Strategy Interaction". The settings of the interactive control:

Setting up an interactive control

While the strategy runs live, enter ETH_USDT in the control's input box and click its button; GetCommand() receives the message changeSymbol:ETH_USDT. The strategy detects the message and updates the corresponding variable (parameters set in the strategy interface are global variables too; a global variable in the code is used here for demonstration):

javascript
// strategy parameter var symbol = "BTC_USDT" function main() { while (true) { var cmd = GetCommand() if (cmd) { var arr = cmd.split(":") if (arr.length == 2 && arr[0] == "changeSymbol") { // the changeSymbol control was triggered: update the parameter Log("Changed symbol parameter to:", arr[1]) symbol = arr[1] } } LogStatus(_D(), ", Current symbol parameter value:", symbol) Sleep(3000) } }