Type/to search
Welcome to FMZ Quant Trading Platform
Programming Languages
JavaScript
TypeScript
Python
C++
MyLanguage
PINE Language
Blockly Visual Programming
Workflow
Key Security
Live Trading
Strategy Library
Docker
Deploy Docker
One-Click Docker Rental
Manual Deployment of Bot
Docker Operation Precautions
Global IP Address Specification
Command Line Parameters for Bot Program
Live Trading Data Migration
Docker Monitor
Exchange
Strategy Editor
Backtesting System
Strategy Entry Functions
Strategy Framework and API Functions
Template Library
Strategy Parameters
Interactive Controls
Options Trading
C++ Strategy Writing Guide
JavaScript Strategy Writing Guide
Web3
Built-in Libraries
Extended API Interface
MCP Service
Trading Terminal
Data Explorer
Alpha Factor Analysis Tool
General Protocol
Debugging Tool
Remote Editing
Import and Export of Complete Strategies
Multi-language Support
Live Trading and Strategy Grouping
Live Trading Display
Strategy Sharing and Renting
Live Trading Message Push
Common Causes of Live Trading Errors and Abnormal Exits
Exchange-Specific Notes

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

NameTypeRequiredDescription

robotId

number

Yes

The robotId parameter is used to specify the live trading ID for which to get log information. You can use the GetRobotList method to get the live trading information under the account, which includes the live trading ID.

logMinId

number

Yes

The logMinId parameter is used to specify the minimum ID of log records.

logMaxId

number

Yes

The logMaxId parameter is used to specify the maximum ID of log records.

logOffset

number

Yes

The logOffset parameter is used to set the offset. Within the range determined by logMinId and logMaxId, skip the specified number of records according to logOffset to determine the starting position for data retrieval.

logLimit

number

Yes

The logLimit parameter is used to set the number of data records to retrieve starting from the initial position.

profitMinId

number

Yes

The profitMinId parameter is used to set the minimum ID of profit logs.

profitMaxId

number

Yes

The profitMaxId parameter is used to set the maximum ID of profit logs.

profitOffset

number

Yes

The profitOffset parameter is used to set the offset, i.e., skip the specified number of records as the starting position.

profitLimit

number

Yes

The profitLimit parameter is used to set the number of data records to retrieve starting from the initial position.

chartMinId

number

Yes

The chartMinId parameter is used to set the minimum ID of chart data records.

chartMaxId

number

Yes

The chartMaxId parameter is used to set the maximum ID of chart data records.

chartOffset

number

Yes

The chartOffset parameter is used to set the offset.

chartLimit

number

Yes

The chartLimit parameter is used to set the number of records to retrieve.

chartUpdateBaseId

number

Yes

The chartUpdateBaseId parameter is used to set the base ID for querying update records.

chartUpdateDate

number

Yes

The chartUpdateDate parameter is used to set the update timestamp of data records, and the system will filter out records greater than this timestamp.

summaryLimit

number

Yes

The summaryLimit parameter is used to set the number of bytes of status bar data to query. This parameter is an integer used to query the status bar data of live trading.

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 summary field of the returned data.

Remarks

  • Strategy log table in database
    The description of the Arr attribute value in the first element (log data) of the logs attribute 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, "", ""] ],
    idlogTypeeidorderIdpriceamountextradatecontractTypedirection
    39773"Futures_OKCoin"""00"Sell(688.9, 2): 20016"1526954372591""""
    39765""""00"OKCoin:this_week Position too large, long: 2"1526954372410""""

    extra is the additional information for the printed log.

    The log type descriptions corresponding to logType values are as follows:

    logType:0123456
    logType meaning:BUYSALERETRACTERRORPROFITMESSAGERESTART
    English meaningBuy order logSell order logCancel orderErrorProfitMessageRestart
  • 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]

    202 is the log ID, 2515.44 is the profit value, 1575896700315 is 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}"],

    23637 is the log ID, 0 is 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.