GetRobotLogs
The GetRobotLogs method is used to get the live trading log information under the FMZ Quant Trading Platform account corresponding to the API KEY in the request. The live trading ID for which to get log information is specified by the robotId parameter.
Returns
json
{
"code": 0,
"data": {
"result": {
"chart": "",
"chartTime": 0,
"logs": [{
"Total": 20,
"Max": 20,
"Min": 1,
"Arr": []
}, {
"Total": 0,
"Max": 0,
"Min": 0,
"Arr": []
}, {
"Total": 0,
"Max": 0,
"Min": 0,
"Arr": []
}],
"node_id": 123,
"online": true,
"refresh": 1732201544000,
"status": 4,
"summary": "...",
"updateTime": 1732201532636,
"wd": 0
},
"error": null
}
}
- logs: Log information; the queried log data entries are stored in the Arr field.
The first data structure in logs contains log records from the strategy log table in the live trading database.
The second data structure in logs contains log records from the profit log table in the live trading database.
The third data structure in logs contains log records from the chart log table in the live trading database. - summary: Live trading status bar data.
Arguments
| Name | Type | Required | Description |
robotId | number | Yes | The |
logMinId | number | Yes | The |
logMaxId | number | Yes | The |
logOffset | number | Yes | The |
logLimit | number | Yes | The |
profitMinId | number | Yes | The |
profitMaxId | number | Yes | The |
profitOffset | number | Yes | The |
profitLimit | number | Yes | The |
chartMinId | number | Yes | The |
chartMaxId | number | Yes | The |
chartOffset | number | Yes | The |
chartLimit | number | Yes | The |
chartUpdateBaseId | number | Yes | The |
chartUpdateDate | number | Yes | The |
summaryLimit | number | Yes | The Setting it to 0 means not querying status bar information; setting it to a non-zero value indicates the number of bytes of status bar information to query (this interface does not limit the amount of data, you can specify a larger summaryLimit parameter to get all status bar information). The status bar data is stored in the |
Remarks
-
Strategy log table in database
The description of theArrattribute value in the first element (log data) of thelogsattribute value (array structure) in the returned data is as follows:plaintext"Arr": [ [3977, 3, "Futures_OKCoin", "", 0, 0, "Sell(688.9, 2): 20016", 1526954372591, "", ""], [3976, 5, "", "", 0, 0, "OKCoin:this_week Position too large, 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 Position too large, long: 2" 1526954372410 "" "" extrais the additional information for the printed log.The log type descriptions corresponding to
logTypevalues are as follows:logType: 0 1 2 3 4 5 6 logType meaning: BUY SALE RETRACT ERROR PROFIT MESSAGE RESTART English meaning Buy order log Sell order log Cancel order Error Profit Message Restart -
Profit chart log table in database
The data in this chart log table is consistent with the profit logs in the strategy log table.plaintext"Arr": [ [202, 2515.44, 1575896700315], [201, 1415.44, 1575896341568] ]Taking one log data as an example:
plaintext[202, 2515.44, 1575896700315]202is the log ID,2515.44is the profit value,1575896700315is the timestamp. -
Chart log table in database
plaintext"Arr": [ [23637, 0, "{\"close\":648,\"high\":650.5,\"low\":647,\"open\":650,\"x\":1575960300000}"], [23636, 5, "{\"x\":1575960300000,\"y\":3.0735}"] ]Taking one log data as an example:
plaintext[23637, 0, "{\"close\":648,\"high\":650.5,\"low\":647,\"open\":650,\"x\":1575960300000}"],23637is the log ID,0is the chart data series index, and the final data"{\"close\":648,\"high\":650.5,\"low\":647,\"open\":650,\"x\":1575960300000}"is the log data, which is the K-line data on the chart.