PluginRun
The PluginRun method runs a piece of JavaScript code on a docker and returns the result. It uses the same execution mechanism as the "Debug Tool" among the development tools and trading terminal plugins (see Integrations → Trading Terminal → Plugin Principle and Development). No live trading bot is created and nothing is charged; one run lasts at most 5 minutes.
Returns
json
{
"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 result as a JSON string:
logsholds the logs written withLog(),resultthe JSON text of the value returned bymain().
Arguments
| Name | Type | Required | Description |
settings | JSON object | Yes | Run configuration, for example:
|
Remarks
exchanges can also pass the exchange configuration directly instead of referencing an exchange account on the platform, for example:
plaintext
{"eid": "Binance", "pair": "ETH_BTC", "meta": {"AccessKey": "...", "SecretKey": "..."}}
The field names of meta are given by the meta returned by GetExchangeList. Usually only one exchange object is set in exchanges (the debug tool page also supports only one); setting two causes no error, but accessing the second exchange object in the code does.