Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions docs/trade/definition.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,59 @@ slug: trade-definition
| HK | 港股 |
| US | 美股 |

## WebSocket 推送通知

* WebSocket 推送通知字段说明

| 字段名 | 类型 | 注释 |
| ----------------- | ------ | ------------------------------------------------------------ |
| side | string | 买卖方向<br />Buy: 买入<br />Sell: 卖出 |
| stock_name | string | 公司名称 |
| quantity | string | 委托数量 |
| symbol | string | 订单标的 |
| order_type | string | 订单类型 |
| price | string | 委托价格 |
| executed_quantity | string | 成交数量 |
| executed_price | string | 成交价格 |
| order_id | string | 订单 id |
| currency | string | 结算货币 |
| status | string | 订单状态 |
| submitted_at | string | 下单时间,格式为时间戳 (秒) |
| updated_at | string | 最近更新时间 |
| trigger_price | string | 触发价格 |
| msg | string | 拒绝理由,备注信息 |
| tag | string | 订单标记<br />Normal 普通订单<br />GTC 长期单<br />Grey 暗盘单 |
| trigger_status | string | 条件单触发状态<br />NOT_ACTIVE 未激活 <br />DEACTIVE 已失效<br />ACTIVE 已激活 <br />RELEASED 已触发 |
| trigger_at | string | 触发时间 |
| tailing_amount | string | 条件单跟踪金额 |
| tailing_percent | string | 条件单跟踪涨跌幅 |
| limit_offset | string | 指定价差 |
| account_no | string | 用户端账号 |

### 示例

```JSON
{
"side": "Buy",
"stock_name": "腾讯控股",
"quantity": "1000",
"symbol": "700.HK",
"order_type": "LO",
"price": "213.2",
"executed_quantity": "1000",
"executed_price": "213.2",
"order_id": "27",
"currency": "HKD",
"status": "NewStatus",
"submitted_at": "1562761893",
"updated_at": "1562761893",
"trigger_price": "213.0",
"msg": "Insufficient Qty - 1000",
"tag": "Normal",
"trigger_status": "NOT_ACTIVE",
"trigger_at": "1562761893",
"tailing_amount": "5",
"tailing_percent": "0.01",
"limit_offset": "0.01"
}
```
92 changes: 46 additions & 46 deletions docs/trade/orders/history-orders.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,60 +27,60 @@ title: 历史订单

### 请求参数

| 名称 | 类型 | 必须 | 描述 | 默认值 | 示例 |
|----------|----------|-----|-----------------------------------------|-----|-----------------------------------------|
| symbol | string | | 股票代码,使用 ticker.region 格式 | | 700.HK |
| status | []string | | [订单状态](../trade-definition#orderstatus) | | ["FilledStatus", "PartialFilledStatus"] |
| side | string | | 买卖方向<br/>Buy: 买入<br/>Sell: 卖出 | | Buy |
| market | string | | [市场](../trade-definition#market) | | US |
| start_at | int64 | | 开始时间,格式为时间戳 (秒) | | 1650410999 |
| end_at | int64 | | 结束时间,格式为时间戳 (秒) | | 1650510999 |
| 名称 | 类型 | 必须 | 描述 | 默认值 | 示例 |
| -------- | -------- | ---- | ------------------------------------------- | ------ | --------------------------------------- |
| symbol | string | | 股票代码,使用 ticker.region 格式 | | 700.HK |
| status | []string | | [订单状态](../trade-definition#orderstatus) | | ["FilledStatus", "PartialFilledStatus"] |
| side | string | | 买卖方向<br/>Buy: 买入<br/>Sell: 卖出 | | Buy |
| market | string | | [市场](../trade-definition#market) | | US |
| start_at | string | | 开始时间,格式为时间戳 (秒) | | 1650410999 |
| end_at | string | | 结束时间,格式为时间戳 (秒) | | 1650510999 |

start_at 和 end_at 的组合如下

| Start 类型 | End 类型 | 说明 |
|:---------|:-------|:------------------------|
| int64 | int64 | start 和 end 分别为指定的时间 |
| None | int64 | start 为 end 往前 90 天 |
| int64 | None | end 为 start 往后 90 天 |
| None | None | start 为往前 90 天,end 当前日期 |
| Start 类型 | End 类型 | 说明 |
| :--------- | :------- | :------------------------------- |
| string | string | start 和 end 分别为指定的时间 |
| None | string | start 为 end 往前 90 天 |
| string | None | end 为 start 往后 90 天 |
| None | None | start 为往前 90 天,end 当前日期 |

## 响应

### 响应体

| 名称 | 类型 | 描述 |
|------------------------------------------------------------------------|----------|-----------------------------------------------------------------------------------|
| code | int | 错误码,非 0 表示失败 |
| msg | string | 错误描述 |
| data | object | |
| <font color='grey'>∟</font>has_more | bool | 是否还有数据,如果为 true,则需要通过最后的时间再次请求。 |
| <font color='grey'>∟</font>orders | []object | 订单详情列表 |
| <font color='grey'>∟</font><font color='grey'>∟</font>order_id | int64 | 订单 id |
| <font color='grey'>∟</font><font color='grey'>∟</font>status | string | 订单状态 |
| <font color='grey'>∟</font><font color='grey'>∟</font>stock_name | string | 股票名称 |
| <font color='grey'>∟</font><font color='grey'>∟</font>quantity | string | 下单数量 |
| <font color='grey'>∟</font><font color='grey'>∟</font>executed_qty | string | 成交数量 |
| <font color='grey'>∟</font><font color='grey'>∟</font>price | string | 下单价格 |
| <font color='grey'>∟</font><font color='grey'>∟</font>executed_price | string | 成交价格 |
| <font color='grey'>∟</font><font color='grey'>∟</font>submitted_at | int64 | 下单时间 |
| <font color='grey'>∟</font><font color='grey'>∟</font>action | string | 买卖方向<br />Buy: 买入<br />Sell: 卖出 |
| <font color='grey'>∟</font><font color='grey'>∟</font>symbol | string | 股票代码,使用 ticker.region 格式 |
| <font color='grey'>∟</font><font color='grey'>∟</font>order_type | string | 订单类型 |
| <font color='grey'>∟</font><font color='grey'>∟</font>last_done | string | 最近成交价格 |
| <font color='grey'>∟</font><font color='grey'>∟</font>trigger_price | string | LIT / MIT 订单触发价格 |
| <font color='grey'>∟</font><font color='grey'>∟</font>msg | string | 拒绝信息或备注 |
| <font color='grey'>∟</font><font color='grey'>∟</font>tag | string | 订单标记<br />Normal 普通订单<br />GTC 长期单<br />Grey 暗盘单 |
| <font color='grey'>∟</font><font color='grey'>∟</font>time_in_force | string | 订单有效期类型<br />Day 当日有效<br />GTC 撤单前有效<br />GTD 到期前有效 |
| <font color='grey'>∟</font><font color='grey'>∟</font>gtd | string | 长期单的有效时间 格式: 2020-01-01 |
| <font color='grey'>∟</font><font color='grey'>∟</font>updated_at | int64 | 最近更新时间 |
| <font color='grey'>∟</font><font color='grey'>∟</font>trigger_at | int64 | 条件单触发时间 |
| <font color='grey'>∟</font><font color='grey'>∟</font>trailing_amount | string | 条件单跟踪金额 |
| <font color='grey'>∟</font><font color='grey'>∟</font>trailing_percent | string | 条件单跟踪涨跌幅 |
| <font color='grey'>∟</font><font color='grey'>∟</font>limit_offset | string | 指定价差 |
| <font color='grey'>∟</font><font color='grey'>∟</font>trigger_status | number | 条件单触发状态<br />NOT_ACTIVE 未激活 <br />DEACTIVE 已失效<br />ACTIVE 已激活 <br />RELEASED 已触发 |
| <font color='grey'>∟</font><font color='grey'>∟</font>currency | string | 结算货币 |
| <font color='grey'>∟</font><font color='grey'>∟</font>outside_rth | string | 美股是否允许盘前盘后<br /> RTH_ONLY 不允许盘前盘后<br />ANY_TIME 允许盘前盘后 |
| 名称 | 类型 | 描述 |
| ------------------------------------------------------------ | -------- | ------------------------------------------------------------ |
| code | int | 错误码,非 0 表示失败 |
| msg | string | 错误描述 |
| data | object | |
| <font color="grey">∟</font>has_more | bool | 是否还有数据,如果为 true,则需要通过最后的时间再次请求。 |
| <font color="grey">∟</font>orders | []object | 订单详情列表 |
| <font color="grey">∟</font><font color="grey">∟</font>order_id | string | 订单 id |
| <font color="grey">∟</font><font color="grey">∟</font>status | string | 订单状态 |
| <font color="grey">∟</font><font color="grey">∟</font>stock_name | string | 股票名称 |
| <font color="grey">∟</font><font color="grey">∟</font>quantity | string | 下单数量 |
| <font color="grey">∟</font><font color="grey">∟</font>executed_qty | string | 成交数量 |
| <font color="grey">∟</font><font color="grey">∟</font>price | string | 下单价格 |
| <font color="grey">∟</font><font color="grey">∟</font>executed_price | string | 成交价格 |
| <font color="grey">∟</font><font color="grey">∟</font>submitted_at | string | 下单时间 |
| <font color="grey">∟</font><font color="grey">∟</font>side | string | 买卖方向<br />Buy: 买入<br />Sell: 卖出 |
| <font color="grey">∟</font><font color="grey">∟</font>symbol | string | 股票代码,使用 ticker.region 格式 |
| <font color="grey">∟</font><font color="grey">∟</font>order_type | string | 订单类型 |
| <font color="grey">∟</font><font color="grey">∟</font>last_done | string | 最近成交价格 |
| <font color="grey">∟</font><font color="grey">∟</font>trigger_price | string | LIT / MIT 订单触发价格 |
| <font color="grey">∟</font><font color="grey">∟</font>msg | string | 拒绝信息或备注 |
| <font color="grey">∟</font><font color="grey">∟</font>tag | string | 订单标记<br />Normal 普通订单<br />GTC 长期单<br />Grey 暗盘单 |
| <font color="grey">∟</font><font color="grey">∟</font>time_in_force | string | 订单有效期类型<br />Day 当日有效<br />GTC 撤单前有效<br />GTD 到期前有效 |
| <font color="grey">∟</font><font color="grey">∟</font>expire_date | string | 长期单的有效时间 格式: 2020-01-01 |
| <font color="grey">∟</font><font color="grey">∟</font>updated_at | string | 最近更新时间 |
| <font color="grey">∟</font><font color="grey">∟</font>trigger_at | string | 条件单触发时间 |
| <font color="grey">∟</font><font color="grey">∟</font>trailing_amount | string | 条件单跟踪金额 |
| <font color="grey">∟</font><font color="grey">∟</font>trailing_percent | string | 条件单跟踪涨跌幅 |
| <font color="grey">∟</font><font color="grey">∟</font>limit_offset | string | 指定价差 |
| <font color="grey">∟</font><font color="grey">∟</font>trigger_status | string | 条件单触发状态<br />NOT_ACTIVE 未激活 <br />DEACTIVE 已失效<br />ACTIVE 已激活 <br />RELEASED 已触发 |
| <font color="grey">∟</font><font color="grey">∟</font>currency | string | 结算货币 |
| <font color="grey">∟</font><font color="grey">∟</font>outside_rth | string | 美股是否允许盘前盘后<br /> RTH_ONLY 不允许盘前盘后<br />ANY_TIME 允许盘前盘后 |



Expand Down
Loading