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 CommandRobot method is used to send interactive commands to a live trading bot under the FMZ Quant Trading Platform account corresponding to the API KEY in the request. The bot Id that receives the interactive command is specified by the robotId parameter, and the interactive command is captured and returned by the GetCommand() function called in the strategy.

Returns

json
{ "code":0, "data":{ "result":true, "error":null } }
  • result: Whether the interactive command was sent successfully. When sending a command to a bot that is not running, the result in the returned data will be false.

Arguments

NameTypeRequiredDescription

robotId

number

Yes

The robotId parameter is used to specify the bot Id that receives the interactive command. You can use the GetRobotList method to get information about bots under the account, which includes the bot Id.

cmd

string

Yes

The interactive command sent to the bot; the strategy reads it with GetCommand(), see GetCommand.

Remarks

Example of bot strategy (assuming this strategy bot is running with bot Id 123):

javascript
function main() { while (true) { var cmd = GetCommand() if (cmd) { Log(cmd) } Sleep(2000) } }

Calling api("CommandRobot", 123, "test command") with api() from the Python example on the signature authentication page, the bot with Id 123 will receive the interactive command: test command, and output it through the Log function.