The resource loading... loading...

RestartRobot

The RestartRobot method is used to restart the live trading under the API KEY corresponding to the FMZ Quant Trading Platform account in the request. The Id of the restarted live trading is the live trading Id specified by the robotId parameter.

{
    "code": 0,
    "data": {
        // 1 means running
        "result": 1,          
        "error": null
    }
}

The robotId parameter is used to specify the Id of the live trading to be restarted. You can use the GetRobotList method to get the information of the live trading under the account, which contains the live trading Id. robotId true number The live trading configuration parameters, the parameters settings format is as follows:

{
    "name": "hedge test",
    // Strategy parameter
    "args": [["Interval", 500]],            
    // Strategy ID, which can be obtained with "GetStrategyList" method
    "strategy": 25189,                      
    // K-line period parameter, "60" means 60 seconds
    "period": 60,                           
    // Specify on which docker to run; if the attribute is not written, it will be automatically assigned to run
    "node" : 51924,                         
    // Custom field
    "appid": "member2",                     
    "exchanges": [
        // ZB; "pid" can be obtained by "GetPlatformList" method
        {"pid": 15445, "pair": "ETH_BTC"},     
        // OKX; 2 exchange objects are configured
        {"pid": 13802, "pair": "BCH_BTC"},     
        
        // In addition to the platforms ("pid" identification) configured by the FMZ dashboard, you can also set exchange configuration information that has not been configured to operate live trading
        {"eid": "OKEX", "pair": "ETH_BTC", "meta" :{"AccessKey": "xxx", "SecretKey": "yyy"}},
        {"eid": "Huobi", "pair": "BCH_BTC", "meta" :{"AccessKey": "xxx", "SecretKey": "yyy"}}
    ]
}

When you use the sensitive information, such as platform API KEY, including "meta":{"AccessKey":"xxx","SecretKey":"yyy"} in the configuration of eid, you should know that FMZ does not store the data. The data will be sent directly to the docker program, so this information must be configured every time when live trading is created or restarted.

To restart live trading that uses the plugin to support the exchange, when configuring the settings parameter, you should make the following settings for the exchanges attribute:

{"eid": "Exchange", "label" : "testXXX", "pair": "ETH_BTC", "meta" :{"AccessKey": "123", "SecretKey": "1234", "Front" : "http://127.0.0.1:6666/XXX"}}

label attribute is to set a label for the exchange object accessed by the current general protocol, which can be obtained by the exchange.GetLabel() function in the strategy.

settings false JSON Object

If live trading is created by the extended API, the extended API RestartRobot (RobotId, Settings) must be used to restart, and the settings parameter must be passed. The live trading created on the platform page can be restarted through the extended API or by clicking the button on the page. You can pass or don’t pass the settings parameter. If you only pass the RobotId parameter, start live trading according to the current live trading settings.

StopRobot GetRobotDetail