输入/搜索内容
入门
平台基础
编写策略
开发工具
回测系统
进阶专题
数据与研究
扩展API接口
AI接入
创建ApiKey
验证方式
扩展API接口详解
GetAccount
GetNodeList
DeleteNode
GetExchangeList
GetPlatformList
GetStrategyList
GetRobotGroupList
GetRobotList
GetRobotDetail
GetRobotLogs
NewRobot
RestartRobot
StopRobot
CommandRobot
DeleteRobot
PluginRun
pub
扩展API接口返回码
实盘状态码

获取当前账号下一个实盘的详细信息,包括状态、计费、交易所配置和策略参数。

示例

查询实盘123的状态和交易所配置。

python
# api() 见「签名验证」页面的Python示例 r = api('GetRobotDetail', 123) robot = r['data']['result']['robot'] print(robot['status'], robot['pexchanges'], robot['strategy_exchange_pairs'])

返回值

类型描述

object

成功时data.result.robot为实盘信息,字段见下方属性表。

参数

名称类型必填描述

robotId

number

是

实盘Id,可以用GetRobotList查询。

属性

名称类型描述

robot.status

number

实盘状态码,见实盘状态码。

robot.name

string

实盘名称。

robot.date

string

创建日期。

robot.charge_time

number

下次扣费时间(Unix时间戳,秒),即当前已付费时段的截止时间。

robot.charged

number

累计计费时长,单位为秒。

robot.consumed

number

累计扣费金额,单位为USD,按1e8放大为整数;示例中5375000000即53.75 USD。

robot.node_id

number

托管者Id。

robot.fixed_id

number

实盘配置中指定的托管者Id;自动分配时为-1。

robot.is_manager

bool

是否有权限管理该实盘。

robot.is_sandbox

number

是否是模拟盘。

robot.pexchanges

object

实盘配置的交易所对象:键为pid,值为交易所Id(eid),如{"123": "Futures_OKX"}。

robot.plabels

object

实盘配置的交易所对象的标签,键为pid。

robot.strategy_exchange_pairs

string

默认K线周期、交易所对象和交易对(JSON文本),格式见备注。

robot.profit

number

实盘收益。

robot.public

number

实盘是否公开。

robot.refresh

number

最近活跃时间(毫秒时间戳)。

robot.wd

number

是否开启离线报警。

备注

strategy_exchange_pairs是一个JSON数组的文本,例如"[60,[44314,42960,15445,14703],[\"BTC_USDT\",\"BTC_USDT\",\"ETH_USDT\",\"ETH_USDT\"]]":

  • 60:实盘设置的默认K线周期,单位为秒(这里为1分钟)。
  • [44314,42960,15445,14703]:实盘配置的交易所对象的pid,按添加顺序排列。
  • ["BTC_USDT","BTC_USDT","ETH_USDT","ETH_USDT"]:各交易所对象设置的交易对,与pid按顺序一一对应。

返回示例
json
{ "code": 0, "data": { "result": { "robot": { "charge_time": 1732246539, "charged": 5850000, "consumed": 5375000000, "date": "2018-12-28 14:34:51", "favorite": { "added": false, "type": "R" }, "fixed_id": 123, "hits": 1, "id": 123, "is_deleted": 0, "is_manager": true, "is_sandbox": 0, "name": "测试", "node_id": 123, "pexchanges": { "123": "Futures_OKX" }, "phash": { "123": "ca1aca74b9cf7d8624f2af2dac01e36d" }, "plabels": { "123": "OKX期货" }, "priority": 0, "profit": 0, "public": 0, "refresh": 1732244453000, "robot_args": "[]", "start_time": "2024-11-22 11:00:48", "status": 1, "strategy_args": "[]", "strategy_exchange_pairs": "[60,[123],[\"ETH_USDT\"]]", "strategy_id": 123, "strategy_last_modified": "2024-11-21 16:49:25", "strategy_name": "测试", "strategy_public": "0", "uid": "105ed6e51bcc17792a610fdbb7e2a1d6", "username": "abc", "wd": 0 } }, "error": null } }