Type/to search
Welcome to FMZ Quant Trading Platform
Programming Languages
JavaScript
TypeScript
Python
C++
MyLanguage
PINE Language
Blockly Visual Programming
Workflow
Key Security
Live Trading
Strategy Library
Docker
Deploy Docker
One-Click Docker Rental
Manual Deployment of Bot
Docker Operation Precautions
Global IP Address Specification
Command Line Parameters for Bot Program
Live Trading Data Migration
Docker Monitor
Exchange
Strategy Editor
Backtesting System
Strategy Entry Functions
Strategy Framework and API Functions
Template Library
Strategy Parameters
Interactive Controls
Options Trading
C++ Strategy Writing Guide
JavaScript Strategy Writing Guide
Web3
Built-in Libraries
Extended API Interface
MCP Service
Trading Terminal
Data Explorer
Alpha Factor Analysis Tool
General Protocol
Debugging Tool
Remote Editing
Import and Export of Complete Strategies
Multi-language Support
Live Trading and Strategy Grouping
Live Trading Display
Strategy Sharing and Renting
Live Trading Message Push
Common Causes of Live Trading Errors and Abnormal Exits
Exchange-Specific Notes

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 cmd parameter is the interactive command sent to the bot. The GetCommand() function in the bot strategy will capture this interactive command and trigger the strategy's interaction logic. For the specific implementation of interaction logic in the strategy code, please refer to the GetCommand() function description in the FMZ Quant Trading Platform API Manual.

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) } }

If you use the Python test script in this section to access the FMZ Quant Trading Platform's extended API: api("CommandRobot", 123, "test command"), the bot with Id 123 will receive the interactive command: test command, and output it through the Log function.