资源加载中... loading...

PluginRun

The PluginRun method is used to call the debug tool function of the FMZ Quant Trading Platform; Only JavaScript language is supported.

{
    "code": 0,
    "data": {
        "result": "{\"logs\":[{\"PlatformId\":\"\",\"OrderId\":\"0\",\"LogType\":5,\"Price\":0,\"Amount\":0,\"Extra\":\"Hello FMZ\",\"Currency\":\"\",\"Instrument\":\"\",\"Direction\":\"\",\"Time\":1732267473108}],\"result\":\"\"}",
        "error": null
    }
}
  • result: The debugging tool returns the test result data after executing the passed JavaScript code successfully.

The settings parameters in the debugging tool, settings configuration, include the test code in the source attribute. The settings parameter format is as follows:

{
    "exchanges":[{"pair":"SOL_USDT","pid":123}],
    "node":123,
    "period":60,
    "source":"function main() {Log(\"Hello FMZ\")}"
}
  • source: Code that needs debugging.
  • node: Docker ID, you can specify which docker to run the live trading on. If the value is -1, it means automatic allocation.
  • exchanges: For exchange object configuration, please refer to the RestartRobot interface.

settings true JSON object

{"eid": "OKEX", "pair": "ETH_BTC", "meta" :{"AccessKey": "123", "SecretKey": "123"}} {"eid": "Huobi", "pair": "BCH_BTC", "meta" :{"AccessKey": "123", "SecretKey": "123"}}

For the exchanges attribute in settings, only one needs to be set when calling the PluginRun method (only one exchange object is supported when used in 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.

NewRobot GetRobotLogs