Files
playbook/docs/tsl/codegen/dotnet/trading/trade_command.md
T

73 lines
5.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 算法交易 / 交易指令
## `TT_CancelWT(h, entrust_id, batch_flag, timeout, comment, _async)`
撤单接口。
| 参数 | 类型 | 说明 |
| ------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `h` | any | 整数,交易客户登入成功返回的句柄,输入; |
| `entrust_id` | string | 字符串,委托号或委托批号,输入;;(说明:以具体的柜台约定为准;1、单笔撤单,当输入的是委托号时,BatchFlag必须为0;;2、多笔撤单,输入必须是委托号,用\\ |
| `batch_flag` | any | 整数,委托批号,输入;;(描述EntrustID参数输入的是委托号或委托批号。0-委托号,1-委托批号。以具体的柜台约定为准) |
| `timeout` | any | 整数,超时(单位毫秒),输入; |
| `comment` | string | 字符串,可选参数,说明信息,输入;(可以为每笔操作添加描述信息,以便区分每笔交易) |
| `_async` | any | 整数,可选参数,委托模式,输入;(0--同步模式、1--异步模式) |
返回:array
## `TT_MultiWT(h, order_str, batch_no, timeout)`
批量委托接口。
| 参数 | 类型 | 说明 |
| ----------- | ------ | ---------------------------------------------------------------------------------------------------- |
| `h` | any | 整数,交易客户登入成功返回的句柄,输入; |
| `order_str` | string | 字符串,批量委托串输入;;具体格式为:两笔委托间用分号;隔开。一笔委托用\\ |
| `batch_no` | string | 字符串,委托批号,输入;;以具体柜台接口约定为准,当委托成功后,我们可以用此批号查询、撤单本次委托。 |
| `timeout` | any | 整数,超时(单位毫秒),输入 |
返回:array
## `TT_UserLogin(gate_way, account_type, account_id, account_pwd, timeout, errmsg)`
交易账户登入接口。
| 参数 | 类型 | 说明 |
| -------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------- |
| `gate_way` | string | 字符串,网关支持的柜台接口名称,输入;(:如xxx证券、XXX期货、AAA证券恒生柜台等。) |
| `account_type` | string | 字符串,账号属性,输入;(输入柜台地址、资金账号、股东卡号、牛卡号等。如果是CTP账号则输入柜台地址,如果是天软模拟柜台输入为空) |
| `account_id` | string | 字符串,交易账号,输入; |
| `account_pwd` | string | 字符串,交易密码,输入 |
| `timeout` | any | 整数,超时(单位毫秒),输入 |
| `errmsg` | string | 字符串,登陆错误信息,输出值 |
返回:any
## `TT_UserLogout(h, timeout)`
交易账户注销接口。
| 参数 | 类型 | 说明 |
| --------- | ---- | ---------------------------------------- |
| `h` | any | 整数,交易客户登入成功返回的句柄,输入; |
| `timeout` | any | 整数,超时(单位毫秒),输入 |
返回:array
## `TT_WT(h, bs, stk_id, price, vol, timeout, comment, _async)`
委托接口。
| 参数 | 类型 | 说明 |
| --------- | ------ | ---------------------------------------------------------------------------------- |
| `h` | any | 整数,交易客户登入成功返回的句柄,输入; |
| `bs` | string | 字符串,委托属性,输入;指令如下: |
| `stk_id` | string | 字符串,股票代码,输入;(如SH600000,SZ000002,IF1109 |
| `price` | float | 实数,委托价格价格,输入; |
| `vol` | any | 整数,委托数量,输入; |
| `timeout` | any | 整数,超时(单位毫秒),输入; |
| `comment` | string | 字符串,可选参数,说明信息,输入;(可以为每笔操作添加描述信息,以便区分每笔交易) |
| `_async` | any | 整数,可选参数,委托模式,输入;(0--同步模式、1--异步模式) |
返回:array