The extended API Interface of FMZ Quant Trading Platform
Append the query parameters (separated by ?
) of the request directly after https://www.fmz.com/api/v1
. The following are the request parameters expressed using Python
:
{
"version" : "1.0",
"access_key": "xxx",
"method" : "GetNodeList",
"args" : [],
"nonce" : 1516292399361,
"sign" : "085b63456c93hfb243a757366600f9c2"
}
Fields | Directions |
---|---|
version | Version number. |
access_key | AccessKey, apply for it on the account management page. |
method | The specific calling method. |
args | The parameter list of the specific method called. |
nonce | Timestamp, in milliseconds, allows a 1-hour error from the standard time stamp. Nonce must be larger than the nonce value of the last access. |
sign | Signature. |
Each parameter name is separated by the character &
, and the parameter names and values are connected with the symbol =
. The complete request URL (taking method=GetNodeList
as an example):
https://www.fmz.com/api/v1?access_key=xxx&nonce=1516292399361&args=%5B%5D&sign=085b63456c93hfb243a757366600f9c2&version=1.0&method=GetNodeList
Note that there is no secret_key
parameter among request parameters.
Signature Method
The sign
parameter in the request parameter is encrypted as follows, according to the format:
version + "|" + method + "|" + args + "|" + nonce + "|" + secretKey
After concatenating strings, use MD5
encryption algorithm to encrypt the string and convert it to a hexadecimal data string value, referred as the value of parameter sign
. For the signature part, refer to the Python
code extension API interface Ways of Verification :
# Parameter
d = {
'version': '1.0',
'access_key': accessKey,
'method': method,
'args': json.dumps(list(args)),
'nonce': int(time.time() * 1000),
}
# Calculate "sign" signature
d['sign'] = md5.md5(('%s|%s|%s|%d|%s' % (d['version'], d['method'], d['args'], d['nonce'], secretKey)).encode('utf-8')).hexdigest()
The GetNodeList
method is used to get the list of dockers
under the FMZ Quant Trading Platform account corresponding to the
API KEY
in the request.
{
"code": 0,
"data": {
"result": {
"all": 1,
"nodes": [{
"build": "3.7",
"city": "...",
"created": "2024-11-08 09:21:08",
"date": "2024-11-08 16:37:16",
"forward": "...",
"guid": "...",
"host": "node.fmz.com:9902",
"id": 123,
"ip": "...",
"is_owner": true,
"loaded": 0,
"name": "MacBook-Pro-2.local",
"online": true,
"os": "darwin/amd64",
"peer": "...",
"public": 0,
"region": "...",
"tunnel": false,
"version": "...",
"wd": 0
}]
},
"error": null
}
}
Description of the return value fields (the literal meaning is obvious and will not be repeated):
ecs_
and unit_
, which records the relevant information of the one-click deployment docker server (operator name, configuration, status, etc.), billing cycle, price and other information, which will not be repeated here.No parameter
GetRobotGroupList()
returns the live trading grouping list
of FMZ Quant Trading Platform account corresponding to the API KEY
in the request.
{
"code": 0,
"data": {
"result": {
"items": [{
"id": 3417,
"name": "Test"
}, {
"id": 3608,
"name": "Live trading demo"
}]
},
"error": null
}
}
items
field only records newly created groups. The “default” group is not in items
.No parameter
GetPlatformList()
returns the list of exchanges that have
been added by the FMZ Quant Trading Platform account corresponding
to the API KEY
in the request.
{
"code": 0,
"data": {
"result": {
"all": 2,
"platforms": [{
"category": "加密货币||Crypto",
"date": "2023-12-07 13:44:52",
"eid": "Binance",
"id": 123,
"label": "Binance",
"logo": "...",
"name": "币安现货|Binance",
"stocks": ["BTC_USDT", "LTC_USDT", "ETH_USDT", "ETC_USDT", "BTC_TUSD", "ETH_TUSD", "BNB_TUSD"],
"website": "..."
}, {
"category": "通用协议|Custom Protocol",
"date": "2020-11-09 11:23:48",
"eid": "Exchange",
"id": 123,
"label": "XX Exchange REST Protocol",
"logo": "...",
"name": "通用协议|Custom Protocol",
"stocks": ["BTC_USDT", "ETH_USDT"],
"website": ""
}]
},
"error": null
}
}
No parameter
The GetRobotList
method is used to get the list of live tradings under the FMZ Quant Trading Platform account corresponding to the API KEY
in the request.
{
"code": 0,
"data": {
"result": {
"all": 53,
"robots": [{
"date": "2017-12-25 09:29:27",
"end_time": "2017-12-28 17:44:21",
"id": 66054,
// If the value is 1, the live trading is a virtual platform live trading
"is_sandbox": 1,
"name": "C++ test strategy",
"node_guid": "705d9aaaaaaaa93b49baaaaa787581cb087",
"profit": 0,
"public": 0,
"refresh": 151345645647000,
"start_time": "2017-12-28 17:44:15",
"status": 3,
"strategy_id": 65365,
"strategy_isowner": true,
"strategy_name": "C++ Version Docker API Test Strategy(cryptocurrency futures and spot markets)",
"wd": 0
}, ...
]
},
"error": null
}
}
The paging query offset setting.
offset
false
number
The paging query length setting.
length
false
number
Specify the status of the live trading to be queried, refer to the extended API interface Live Trading Code, pass -1
to get all live tradings.
robotStatus
false
number
Specify the custom label of the live trading you want to query, and you can filter all the live tradings of this label.
label
false
string
Take the Python
language’s extended API interface Ways of Verification as an example: print(api('GetRobotList', 'member2'))
: print the information of all live trading with the custom label member2
. print(api('GetRobotList', 0, 5, -1, 'member2'))
: pages from 0 to 5 and list up to 5 robots labeled with member2
.
The CommandRobot
method is used to send an interaction command to the live trading under the FMZ Quant Trading Platform account corresponding to the API KEY
in the request. The Id of the live trading receiving the interaction command is the live trading Id specified by the robotId
parameter, and the interaction command is returned by the GetCommand()
function called in the strategy to capture it.
{
// The API request was successfully executed
"code": 0,
"data": {
// However, sending a command to live trading that is not running returns failure
"result": false,
"error": null
}
}
The parameter robotId
is used to specify the Id of the live trading that receives the interactive command. 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 parameter cmd
is the interactive command sent to the bot; the command will be captured by the function GetCommand()
, which triggers the interactive logic in the strategy. For specific implementation of the interaction logic in the strategy code, please refer to the GetCommand()
function in the FMZ Quant Trading Platform API Manual.
cmd
true
string
StopRobot(RobotId)
is used to request the API KEY
corresponding to the live trading of the FMZ Quant Trading Platform account. The live trading Id to stop running is the live trading Id specified by the robotId
parameter.
{
"code": 0,
"data": {
// 2 means stopping
"result": 2,
"error": null
}
}
The parameter robotId
is used to specify the Id of the live trading to be stopped. 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 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.
The GetRobotDetail
method is used to get the details of the live trading under the FMZ Quant Trading Platform account corresponding to the API KEY
in the request. The Id of the live trading to be retrieved is the live trading Id specified by the robotId
parameter.
{
"code": 0,
"data": {
"result": {
"robot": {
// Next payment time, namely the effective cut-off time after the current payment
"charge_time": 1561992608,
// Elapsed Time
"charged": 3600,
// Amount consumed (0.125 CNY = 12500000 / 1e8)
"consumed": 12500000,
"date": "2019-07-01 21:50:08",
"debug": "{\"Nano\":1561989722431145193,\"Stderr\":\"\",\"Stdout\":\"\"}",
// Stop time
"end_time": "2019-07-01 22:02:02",
// The docker ID assigned when live trading is running; if it is automatic, the value is -1
"fixed_id": 85960,
"id": 150288,
"is_deleted": 0,
// Whether it has the permission to manage live trading
"is_manager": true,
// Whether it is a simulation trading
"is_sandbox": 0,
// Live trading name
"name": "Spread monitoring2",
// Docker ID
"node_id": 85960,
// The exchange objects configured by live trading
"pexchanges": {
// 14703 is pid, and "GateIO" is exchange name
"14703": "GateIO",
"15445": "ZB",
"42960": "OKEX",
"44314": "Huobi"
},
// label information of the exchange object configured by live trading
"plabels": {
"14703": "Gate.IO (old name: BTER)",
"15445": "ZB",
"42960": "OKEX spot V3 test",
"44314": "Huobi - newest test"
},
"profit": 0,
// Whether to show public
"public": 0,
// Recent active time
"refresh": 1561989724000,
"robot_args": "[[\"TickInterval\",500],[\"StrOnePair\",\"spot:Huobi:spot;spot:OKEX:spot;false;60;5;0;0\"],[\"StrTwoPair\",\"spot:ZB:spot;spot:GateIO:spot;false;60;5;0;0\"],[\"StrThreePair\",\"null\"],[\"StrFourPair\",\"null\"],[\"StrSixPair\",\"null\"],[\"StrFivePair\",\"null\"],[\"ResetChart\",false]]",
"start_time": "2019-07-01 22:00:54",
// Live trading status
"status": 4,
"strategy_args": "[[\"TickInterval\",\"Detection frequency (ms)\",\"This is millisecond. Don't set it too small.\",500],[\"StrOnePair\",\"Combination1\",\"Spread Combination\",\"spot:Huobi:spot;spot:OKCoin:spot;false;60;5;0;0\"],[\"StrTwoPair\",\"Combination2\",\"Spread Combination\",\"future:Futures_OKCoin:this_week;spot:OKCoin:spot;false;60;5;0;0\"],[\"StrThreePair\",\"Combination3\",\"Spread Combination\",\"future:Futures_OKCoin:this_week;future:Futures_OKCoin:quarter;true;60;5;0;0\"],[\"StrFourPair\",\"Combination4\",\"Spread Combination\",\"null\"],[\"StrSixPair\",\"Combination6\",\"Combination\",\"null\"],[\"StrFivePair\",\"Combination5\",\"Combination\",\"null\"],[\"ResetChart\",\"whether to clear the previous chart\",\"clear the previous chart\",false]]",
// Configured exchange objects, set trading pair information
"strategy_exchange_pairs": "[60,[44314,42960,15445,14703],[\"BTC_USDT\",\"BTC_USDT\",\"ETH_USDT\",\"ETH_USDT\"]]",
// Strategy ID
"strategy_id": 21337,
// Strategy's last modification time
"strategy_last_modified": "2018-11-29 12:07:58",
// Strategy name
"strategy_name": "Digital currency spread monitoring and analysis",
"summary": "Polling time consuming: 500ms\n`[{\"type\":\"table\",\"title\":\"pair basic data\",\"cols\":[\"ID\",\"NameA - NameB\",\"SymbolA - SymbolB\",\"UpdCycle\",\"isUSD\",\"Collect\"],\"rows\":[[\"0 \",\"Huobi/OKEX\",\"spot/spot\",60,false,\"612ms\"],[\"1 \",\"ZB/GateIO\",\"spot/spot\",60,false,\"501ms\"]]},{\"type\":\"table\",\"title\":\"pair ticker data\",\"cols\":[\"ID\",\"NameA - NameB\",\"SymbolA - SymbolB\",\"A_Bids1\",\"B_Asks1\",\"Plus\",\"A_Asks1\",\"B_Bids1\",\"Minus\"],\"rows\":[[\"0 \",\"Huobi/OKEX\",\"spot/spot\",10518.02,10525.1,-7.08,10520,10523,-3],[\"1 \",\"ZB/GateIO\",\"spot/spot\",285.68,286,-0.32,285.8,285.85,-0.05]]},{\"type\":\"table\",\"title\":\"pair statistical data\",\"cols\":[\"ID\",\"NameA - NameB\",\"SymbolA - SymbolB\",\"Maximum spread\",\"Minimum spread\",\"Mean positive premium\",\"Mean negative premium\"],\"rows\":[[\"0 \",\"Huobi/OKEX\",\"spot/spot\",0,-3,0,-1.47],[\"1 \",\"ZB/GateIO\",\"spot/spot\",0.03,-0.05,0.03,-0.05]]}]`\n",
// Whether to enable offline alert
"wd": 0
}
},
"error": null
}
}
The robotId
parameter is used to specify the Id of the live trading for which the details are to be obtained. You can use the GetRobotList
method to obtain information about the live trading under the account, which contains the live trading Id.
robotId
true
number
The summary
attribute in the returned data (information on the bot status bar; cached for 10 second; not the latest data) currently has a data amount limit (cached data).
The data amount limit is 200KB, and the excess data will be truncated. If you need more status bar information data, you can use the GetRobotLogs
interface to get (when GetRobotLogs
obtains the information of status bar, the field summary
is the latest data).
The attribute description of strategy_exchange_pairs
, take the following data as an example:
[60,[44314,42960,15445,14703],[\"BTC_USDT\",\"BTC_USDT\",\"ETH_USDT\",\"ETH_USDT\"]]
The first data 60
represents the default K-line period set by live trading is 1 minute, namely 60 seconds.
[44314,42960,15445,14703]
is the exchange object pid
configured for live trading (according to the addition order).
[\"BTC_USDT\",\"BTC_USDT\",\"ETH_USDT\",\"ETH_USDT\"]
is the trading pair set for the exchange object configured by live trading (in the order of addition and in one-to-one correspondence with pid
).
The GetAccount
method is used to acquire the account information corresponding to the API KEY
in the request of the FMZ Quant Trading Platform account.
{
"code": 0,
"data": {
"result": {
"username": "littlelittledream",
"level": 0,
"consumed": 3235500000,
"invitation_code": "1545967",
"points": 25,
// The value here, due to precision control, is expressed in integer. To convert it to actual value, you need to divide it by 1e8 (i.e. 10 to the 8th power), and the actual result here is: 65.421
"balance": 6542100000
},
"error": None
}
}
The GetExchangeList
method is used to acquire the list of exchanges and the required configuration information supported by FMZ Quant Trading Platform.
{
"code": 0,
"data": {
"result": {
"exchanges": [{
"website": "https://www.huobi.pro/",
"name": "Huobi",
"priority": 1,
"meta": "[{"desc": "Access Key", "required": true, "type": "string", "name": "AccessKey", "label": "Access Key"}, {"encrypt": true, "name": "SecretKey", "required": true, "label": "Secret Key", "type": "password", "desc": "Secret Key"}]",
"eid": "Huobi",
"logo": "huobi.png",
"id": 1
}, {
"website": "https://www.kex.com/",
"name": "KEX",
"priority": -99,
"meta": "[{"desc": "Access Key", "required": true, "type": "string", "name": "AccessKey", "label": "Access Key"}, {"encrypt": true, "name": "SecretKey", "required": true, "label": "Secret Key", "type": "password", "desc": "Secret Key"}, {"encrypt": true, "required": true, "type": "password", "name": "Password", "label": "Trading Password"}]",
"eid": "KEX",
"logo": "",
"id": 43
},
...
]
},
"error": null
}
}
The DeleteNode(Nid)
method is used to delete the docker node corresponding to the API KEY
in the request of the FMZ Quant Trading Platform account. The deleted docker node Id is the docker Id specified by the nid
parameter.
{
"code":0,
"data":{
"result":true,
"error":null
}
}
The nid
parameter is used to specify the Id of the docker to be deleted. You can use the GetNodeList
method to get information about the dockers of the account.
nid
true
number
The DeleteRobot(RobotId, DeleteLogs)
method is used to delete the live trading corresponding to the API KEY
in the request under the FMZ Quant Trading Platform account. The deleted live trading Id is the live trading Id specified by the robotId
parameter.
// Return value after successful deletion
{
"code": 0,
"data": {
"result": 0,
"error": null
}
}
The parameter robotId
is used to specify the Id of the live trading to be deleted. 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 deleteLogs
parameter is used to set whether to delete the live trading log, if passed a true value (e.g.: true
), the live trading log is deleted.
deleteLogs
true
bool
The GetStrategyList()
method is used to obtain the strategy information corresponding to the API KEY
in the request of the FMZ Quant Trading Platform account.
{
"code": 0,
"data": {
"result": {
"strategies": [{
"category": 0,
"username": "yifidslei",
"is_owner": true,
"name": "fmz simulation trading test strategy",
"language": 0,
"hasToken": false,
"args": "[]",
"is_buy": false,
"public": 0,
"last_modified": "2018-01-18 12:36:03",
"date": "2018-01-17 09:19:32",
"forked": 0,
"id": 63372
}, {
"category": 20,
"username": "bifndslez",
"is_owner": true,
"name": "Plot library",
"language": 0,
"hasToken": false,
"args": "[]",
"is_buy": false,
"public": 0,
"last_modified": "2017-05-08 09:44:18",
"date": "2017-04-19 10:38:14",
"forked": 0,
"id": 39677
},
...
],
"all": 20
},
"error": null
}
}
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.
The PluginRun
method is used to call the debug tool function of the FMZ Quant Trading Platform.
{
"code": 0,
"data": {
"result": "...",
"error": null
}
}
The settings parameters in the debugging tool, settings
configuration, include the test code in the source
attribute. The settings
parameter format is as follows:
# K-line period parameter, "60" indicates 60 seconds
"period": 60,
"source": "function main() {Log("Hello FMZ")}",
# The docker ID can specify which docker to run the bot on; if the value is -1, it means automatic assignment
"node" : 54913,
"exchanges": [
{"eid": "OKEX", "pair": "ETH_BTC", "meta" :{"AccessKey": "123abc", "SecretKey": "123abc"}},
{"eid": "Huobi", "pair": "BCH_BTC", "meta" :{"AccessKey": "123abc", "SecretKey": "123abc"}}
]
} ```
settings
true
JSON object
```{"eid": "OKEX", "pair": "ETH_BTC", "meta" :{"AccessKey": "123abc", "SecretKey": "123abc"}}```
```{"eid": "Huobi", "pair": "BCH_BTC", "meta" :{"AccessKey": "123abc", "SecretKey": "123abc"}}```
For the ```exchanges``` attribute in the ```settings```, the attribute only needs to be set to 1, when calling the ```PluginRun``` interface (for only one exchange object can be supported when you use the "Debug Tool" page).
No error will be reported when you set 2 exchange objects in ```settings```, but an error will be reported when the second exchange object is accessed in the code.
### GetRobotLogs
The ```GetRobotLogs``` method is used to get the log information of the live trading under the FMZ Quant Trading Platform account corresponding to the ```API KEY``` in the request. The Id of the live trading platform to be obtained is the live trading platform Id specified by the ```robotId``` parameter.
{
“code”: 0,
“data”: {
“result”: {
“status”: 1,
“updateTime”: 1527049990197,
“wd”: 0,
// The first data structure in logs is the log records in the strategy log table in the live trading database
“logs”: [{
“Max”: 3984,
“Arr”: [
[3977, 3, “Futures_OKCoin”, “”, 0, 0, “Sell(688.9, 2): 20016”, 1526954372591, “”, “”],
[3976, 5, “”, “”, 0, 0, “OKCoin:this_week excessive positions, long: 2”, 1526954372410, “”, “”]
],
“Total”: 1503,
“Min”: 2482
}, {
// The second data structure in logs is the log records in the strategy log table in the live trading database
“Max”: 0,
“Arr”: [],
“Total”: 0,
“Min”: 0
}, {
// The third data structure in logs is the log records in the strategy log table in the live trading database
“Max”: 0,
“Arr”: [],
“Total”: 0,
“Min”: 0
}],
“chart”: “”,
“refresh”: 1527049988000,
“summary”: “…”,
"chartTime ": 0,
"node_id ": 50755,
"online ": true
},
"error ": null
}
}
The ```robotId``` parameter is used to specify the Id of the live trading for which the log information is to be obtained. You can use the ```GetRobotList``` method to obtain information about the live trading under the account, which contains the live trading Id.
robotId
true
number
The ```logMinId``` parameter is used to specify the minimum Id of the Log.
logMinId
true
number
The ```logMaxId``` parameter is used to specify the maximum Id of the Log.
logMaxId
true
number
The ```logOffset``` parameter is used to set the offset, after determining the range by ```logMinId``` and ```logMaxId```, offset based on the ```logOffset``` (how many records are skipped). Start as the starting position for fetching data.
logOffset
true
number
The parameter ```logLimit``` is used to set the number of data records to be selected after the starting position is determined.
logLimit
true
number
The ```profitMinId``` parameter is used to set the minimum Id of the profit log.
profitMinId
true
number
The parameter ```profitMaxId``` is used to set the maximum Id of the profit log.
profitMaxId
true
number
The parameter ```profitOffset``` is used to set the offset (how many records are skipped) as the starting position.
profitOffset
true
number
The parameter ```profitLimit``` is used to set the number of data records to be selected after the starting position is determined.
profitLimit
true
number
The parameter ```chartMinId``` is used to set the minimum Id of the chart data record.
chartMinId
true
number
The parameter ```chartMaxId``` is used to set the maximum Id of the chart data record.
chartMaxId
true
number
The parameter ```chartOffset``` is used to set the offset.
chartOffset
true
number
The parameter ```chartLimit``` is used to set the number of records to obtain.
chartLimit
true
number
The parameter ```chartUpdateBaseId``` is used to set the base Id after the query is updated.
chartUpdateBaseId
true
number
The parameter ```chartUpdateDate``` is used to set the data record update timestamp, and it will filter out records greater than this timestamp.
chartUpdateDate
true
number
The parameter ```summaryLimit``` is used to set the number of bytes of status bar data to be queried. The parameter is of integer type for querying the status bar data of the live trading.
Setting to "0" means there is no need to query the status bar information, and setting to non-zero number indicates the number of bytes of the status bar information to be queried (the interface does not limit the data quantity, so you can specify a larger ```summaryLimit``` parameter to get all status bar information). The status bar data is stored in the returned data ```summary```.
summaryLimit
true
number
- The strategy log table in the database
The ```Arr``` attribute value in the first element of the ```Logs``` attribute value (array structure) in the return data (log data) is described as follows:
“Arr”: [ [3977, 3, “Futures_OKCoin”, “”, 0, 0, “Sell(688.9, 2): 20016”, 1526954372591, “”, “”], [3976, 5, “”, “”, 0, 0, “OKCoin:this_week too many positions, long: 2”, 1526954372410, “”, “”] ],
| id | logType | eid | orderId | price | amount | extra | date | contractType | direction |
| - | - | - | - | - | - | - | - | - | - |
| 3977 | 3 | "Futures_OKCoin" | "" | 0 | 0 | "Sell(688.9, 2): 20016" | 1526954372591 | "" | "" |
| 3976 | 5 | "" | "" | 0 | 0 | "OKCoin:this_week too many positions, long: 2" | 1526954372410 | "" | "" |
```extra``` is the attached message of the printed log.
The specific log types represented by the ```logType``` values are described as follows:
| logType: | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
| - | - | - | - | - | - | - | - |
| Meaning of logType: | BUY | SALE | RETRACT | ERROR | PROFIT | MESSAGE | RESTART |
- Log table of the profit chart in the database
The data in the chart's log table is consistent with the profit log in the strategy log table.
“Arr”: [ [202, 2515.44, 1575896700315], [201, 1415.44, 1575896341568] ]
Take one of the log data as an example:
[202, 2515.44, 1575896700315]
```202``` is log ```ID```; ```2515.44``` is profit value; ```1575896700315``` is timestamp.
- Chart log table in the database
“Arr”: [ [23637, 0, “{“close”:648,“high”:650.5,“low”:647,“open”:650,“x”:1575960300000}”], [23636, 5, “{“x”:1575960300000,“y”:3.0735}”] ]
Take one of the log data as an example:
[23637, 0, “{“close”:648,“high”:650.5,“low”:647,“open”:650,“x”:1575960300000}”],
```23637``` is the log ```ID```, ```0``` is the index of the chart data series, and the last data ```"{\"close\":648,\"high\":650.5,\"low\":647,\"open\":650,\"x\":1575960300000}"``` is the log data; This data is the K-line data on the chart.
Ways of Verification
Trading Terminal