Sumber dimuat naik... memuat...

NewRobot

PeraturanNewRobotkaedah digunakan untuk membuat perdagangan langsung di bawahAPI KEYyang sepadan dengan akaun Platform Dagangan Kuantum FMZ dalam permintaan.

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

Parameter konfigurasi dagangan langsung,settingsformat parameter adalah seperti berikut:

{
    "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"}}
    ]
}

tetapan betul Objek JSON

Apabila anda menggunakan maklumat sensitif, seperti platformAPI KEY, termasuk"meta":{"AccessKey":"xxx","SecretKey":"yyy"}dalam konfigurasieid, anda harus tahu FMZ tidak menyimpan data. Data akan dihantar terus ke program docker, jadi maklumat ini mesti dikonfigurasikan setiap kali perdagangan langsung dibuat atau dimulakan semula.

Jika anda ingin membuat perdagangan hidup yang menggunakan pemalam untuk menyokong platform, apabila mengkonfigurasisettingsparameter, anda harus membuat tetapan berikut untukexchangesatribut:

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

labelAtribut adalah untuk menetapkan label untuk objek pertukaran diakses oleh protokol umum semasa, yang boleh diperoleh olehexchange.GetLabel()fungsi dalam strategi.

GetStrategyList PluginRun