资源加载中... loading...

NewRobot

The NewRobot method is used to create a live trading under the API KEY corresponding to the FMZ Quant Trading Platform account in the request.

// Create live trading successfully
{
    "code": 0,
    "data": {
        "result": 74260,
        "error": null
    }
}

The live trading configuration parameters, settings parameters format is as follows:

{
    "name": "hedge test",
    /*
    Strategy parameters; the order does not have to be in correspondence with the parameter order, but the name must be the same as the parameter name 
    Note: the second element in the parameter array ["MAType", 0, 75882] is an array including three elements,
    in which the first one "MAType" is the parameter on the pattern referred by the live trading-binding strategy
    The second one "0" is the specific value set by the parameter "MAType".
    The third element, 75882, is the ID of the template to which the MAType parameter belongs, and is used to identify which template the parameter belongs to
    */
    "args": [["Interval", 500], ["MAType", 0, 75882]],
    // Strategy ID, which can be obtained by "GetStrategyList" method
    "strategy": 25189,                      
    // K-line period parameter; "60" indicates 60 seconds
    "period": 60,                           
    // It can be specified to run on which docker; no writing of the attribute will lead to automatic assignment
    "node" : 52924,                         
    // Custom field
    "appid": "member2",
    // Specify live trading group
    "group": 1122,
    "exchanges": [
        // ZB; "pid" can be obtained by "GetPlatformList" method
        {"pid": 15445, "pair": "ETH_BTC"},     
        // OKEX
        {"pid": 13802, "pair": "BCH_BTC"},     
        // In addition to the exchanges configured by the FMZ dashboard (pid identification), you can also set exchange configuration information that has not been configured to operate the live trading
        {"eid": "OKEX", "pair": "ETH_BTC", "meta" :{"AccessKey": "xxx", "SecretKey": "yyy"}},
        {"eid": "Huobi", "pair": "BCH_BTC", "meta" :{"AccessKey": "xxx", "SecretKey": "yyy"}}
    ]
}

settings true JSON object

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 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.

If you want to create live trading that uses the plugin to support the platform, 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.

GetStrategyList PluginRun