Type/to search
Getting Started
Platform Basics
Writing Strategies
Development Tools
Backtesting System
Advanced Topics
Data and Research
Extended API Interface
AI Integration
Create ApiKey
Authentication Methods
Extended API Interface Details
GetAccount
GetNodeList
DeleteNode
GetExchangeList
GetPlatformList
GetStrategyList
GetRobotGroupList
GetRobotList
GetRobotDetail
GetRobotLogs
NewRobot
RestartRobot
StopRobot
CommandRobot
DeleteRobot
PluginRun
pub
Extended API Interface Return Codes
Live Trading Status Codes

Gets the strategy log, profit log, chart data and status bar data of one robot of the account.

Examples

Query the latest 10 strategy log entries and the status bar of robot 123, passing arguments by name.

python
# api() is the function in the Python example on the signature authentication page r = api('GetRobotLogs', robotId=123, logLimit=10, summaryLimit=1) result = r['data']['result'] for row in result['logs'][0]['Arr']: print(row) print(result['summary']) # status bar data

Returns

TypeDescription

object

On success data.result holds the logs logs, the status bar data summary and more; fields are in the attributes table below.

Arguments

NameTypeRequiredDescription

robotId

number

Yes

Robot ID; see GetRobotList.

logMinId

number

Yes

Minimum ID of strategy log entries.

logMaxId

number

Yes

Maximum ID of strategy log entries.

logOffset

number

Yes

Number of records to skip within the range given by logMinId and logMaxId.

logLimit

number

Yes

Number of records to return from the starting position.

profitMinId

number

Yes

Minimum ID of profit log entries.

profitMaxId

number

Yes

Maximum ID of profit log entries.

profitOffset

number

Yes

Number of records to skip.

profitLimit

number

Yes

Number of records to return.

chartMinId

number

Yes

Minimum ID of chart log entries.

chartMaxId

number

Yes

Maximum ID of chart log entries.

chartOffset

number

Yes

Number of records to skip.

chartLimit

number

Yes

Number of records to return.

chartUpdateBaseId

number

Yes

Base ID for querying updates.

chartUpdateDate

number

Yes

Update timestamp; only newer records are returned.

summaryLimit

number

Yes

Whether to return status bar data: 0 does not; greater than 0 returns it in summary (the value itself has no effect; at most 2MB).

logExchange

string

No

Return only logs of this exchange object (by label); an empty string means no filter.

logKeyword

string

No

Return only logs whose content contains this keyword; an empty string means no filter.

logTypes

string

No

Return only these log types, comma-separated type numbers, e.g. "0,1,2" for buy, sell and cancel logs; an empty string means all types.

Attributes

NameTypeDescription

logs

array

Three objects: the query results of the strategy log, profit log and chart log tables of the robot database, in that order; the Arr of each holds the records, formatted as described in the remarks.

summary

string

Status bar data of the robot (returned when summaryLimit is greater than 0).

status

number

Robot status code, see Live Trading Status Codes.

Remarks

With this many parameters, passing them by name is recommended (missing ones take their defaults); positional calls take 15 to 19 arguments (with 15 the status bar is not queried). The three filters logExchange, logKeyword and logTypes work only on new dockers; old dockers ignore them and return all logs.

logs[0]: strategy log

Each entry of logs[0].Arr is an array of: log ID (id), log type (logType), label of the exchange object (platformId), order ID (orderId), price (price), amount (amount), extra message of the log (extra), timestamp (date), contract code (contractType), direction (direction). For example:

plaintext
"Arr": [ [3977, 3, "Futures_OKX", "", 0, 0, "Sell(688.9, 2): 20016", 1526954372591, "", ""], [3976, 5, "", "", 0, 0, "this_week too many positions, long: 2", 1526954372410, "", ""] ]

Values of logType:

logTypeNameMeaning
0BUYBuy order
1SALESell order
2RETRACTOrder cancelled
3ERRORError
4PROFITProfit
5MESSAGELog message
6RESTARTRestart

logs[1]: profit log

The same as the profit entries of the strategy log; each entry is log ID, profit value, timestamp. In [202, 2515.44, 1575896700315], 202 is the log ID, 2515.44 the profit and 1575896700315 the timestamp:

plaintext
"Arr": [ [202, 2515.44, 1575896700315], [201, 1415.44, 1575896341568] ]

logs[2]: chart log

Each entry is log ID, chart series index, data (JSON text). In [23637, 0, "{\"close\":648, ...}"], 23637 is the log ID, 0 the series index, and the JSON text is one K-line on the chart:

plaintext
"Arr": [ [23637, 0, "{\"close\":648,\"high\":650.5,\"low\":647,\"open\":650,\"x\":1575960300000}"], [23636, 5, "{\"x\":1575960300000,\"y\":3.0735}"] ]

Example response
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 } }