The resource loading... loading...

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.

PluginRun Trading Terminal