PeraturanNewRobot
metode ini digunakan untuk membuat perdagangan langsung di bawahAPI KEY
yang sesuai dengan akun Platform Perdagangan Kuantum FMZ dalam permintaan.
// Create live trading successfully
{
"code": 0,
"data": {
"result": 74260,
"error": null
}
}
Parameter konfigurasi perdagangan langsung,settings
format parameter adalah sebagai 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"}}
]
}
pengaturan benar Objek JSON
Ketika Anda menggunakan informasi sensitif, seperti platformAPI KEY
, termasuk"meta":{"AccessKey":"xxx","SecretKey":"yyy"}
dalam konfigurasieid
, Anda harus tahu FMZ tidak menyimpan data.
Data akan dikirim langsung ke program docker, sehingga informasi ini harus dikonfigurasi setiap kali perdagangan langsung dibuat atau dihidupkan kembali.
Jika Anda ingin membuat perdagangan hidup yang menggunakan plugin untuk mendukung platform, ketika mengkonfigurasisettings
parameter, Anda harus membuat pengaturan berikut untukexchanges
atribut:
{"eid": "Exchange", "label" : "testXXX", "pair": "ETH_BTC", "meta" :{"AccessKey": "123", "SecretKey": "1234", "Front" : "http://127.0.0.1:6666/XXX"}}
label
Atribut adalah untuk mengatur label untuk objek pertukaran diakses oleh protokol umum saat ini, yang dapat diperoleh olehexchange.GetLabel()
fungsi dalam strategi.