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

Creates a robot in the account and starts it; like creating a robot on the website, this charges fees and the robot trades for real.

Examples

Create and start a robot with an added exchange account (pid).

python
# api() is the function in the Python example on the signature authentication page settings = { "name": "test", "strategy": 123, "args": [], "exchanges": [ {"pid": 123, "pair": "SOL_USDT"} ], "period": 60, "node": 123, "group": 123, "appid": "test" } r = api('NewRobot', settings) print(r['data']['result']) # output: 591988 (ID of the new robot)

Returns

TypeDescription

number

data.result: the ID of the new robot on success; 0 when args in settings is not an array; a negative number when no robot was created, see the remarks.

Arguments

NameTypeRequiredDescription

settings

object

Yes

Robot configuration; fields are described under "Robot configuration (settings)" in Extended API Interface Details.

Remarks

When created through the extended API, the call returns after the start-up has run. If start-up fails (e.g. the strategy does not compile), the ID of the new robot is still returned and the robot is in the "strategy error" state (status code 5), so check its status with GetRobotDetail after creating it.

A negative result means no robot was created; see "Return values of failed starts" in Live Trading Status Codes, e.g. -2 no docker found, -5 insufficient balance. When the account exceeds the number of robots it may run, an error with code 6 is returned.

When an exchange configuration is passed directly with eid, the platform does not store the keys in meta, so every later restart of the robot with RestartRobot must pass settings again.