回报查询
请求查询委托回报
返回所有已登入账号的委托回报 请求结果通过回调事件OnOrderReport(ByVal index As Integer, ByVal reportitem As RPTExecutionReport)返回
Public Sub trade_OnOrderReport(ByVal index As Integer, ByVal reportitem As RPTExecutionReport)
Debug.Print ("当日委托响应:" + reportitem.Account)
'reportitem.reportid
'reportitem.Account
'reportitem.BrokerID
'reportitem.symbol
'reportitem.Side
'reportitem.OrderID
'reportitem.OriginalQty
'reportitem.OrderQty
'reportitem.Price / 10000000000#
'reportitem.StopPrice / 10000000000#
'reportitem.OrderType
'reportitem.TradeType
'reportitem.ExCode
'reportitem.PositionEffect
'reportitem.DayTrade
'reportitem.TimeInForce
'reportitem.TrailingAmount
'reportitem.TouchCondition
'reportitem.Group
'reportitem.UserKey1
'reportitem.UserKey2
'reportitem.CumQty
'reportitem.LeavesQty
'reportitem.ExecType
'reportitem.ErrorCode
'reportitem.TriggeredPrice
'reportitem.TransactDate
'reportitem.TransactTime
'reportitem.AvgPrice
'reportitem.ExecTypeText
'reportitem.FilledOrdersCount
'reportitem.IsRestoreData
'reportitem.OrgSource
End Sub
'请求查询委托回报
Public Sub orderreport()
Call trade.ReqOrderReport
End Sub
回调方法reportitem对象字段说明
字段 | 类型 | 注释 | 结果 |
---|---|---|---|
Account | string | 账号 | "9999-044491" |
AvgPrice | float | 成交均价 | 0 |
BrokerID | string | 经纪商代码 | "CTP_SIMNOWSE662" |
CallPut | string | 合约认购/认沽标志 | "" |
CallPut2 | string | 合约认购/认沽标志(复式单脚2 ) | "" |
CumQty | int | 总成交手数(已成交) | 0 |
ErrorCode | int | 错误代码 | 0 |
Exchange | string | "SHFE" | |
ExecHis | string | "0" | |
ExecType | int | 委托执行状态 0:委托成功(包含改价改量) 1:部份委托成功其余处理中 2:部份委托成功其余错误 3:全部成交 4:部份成交其余委托处理中 5:部份成交其余删单 6:部分成交尚有有效单 7:部份成交其余错误 8:完全删单成功 9:部份删单成功 10:委托失败 11:委托处理中 12:删改单错误 13:洗价中 14:ITS主机已收单(增加中) 15:等待中(不可撤单) 16:洗价单触价送单 17:锁券成功 18:锁券失败 19:锁券已提交 20:等待中(可撤单) 21:下单锁定 22:撤单传送中 23:预约单 24:已挂起 31:洗价暂停中 |
0 |
ExecTypeText | string | 委托执行状态描述 | "Order Succeeded" |
LeavesQty | int | 委托剩余数量 | 1 |
Month | string | 合约月份 | "202302" |
Month2 | string | 合约月份(复式单脚2) | "" |
OrderID | string | 经纪商委托编号 | "SHFE-234058" |
OrderQty | int | 委托数量 | 1 |
OrderType | int | 委托单类型 1:Market Market order 2:Limit Limit order 3:Stop Stop order 4:StopLimit Stop limit order 5:Stop Stop order 6:StopLimit Stop limit order 7:Market if Touched Order 8:Limit if Touched Order 9:Trailing Limit 10:对方价(HIT) 11:本方价(JOIN) 15:中间价(MID) 20:最优价(BST) 21:最优价转限价(BSTL) 22:五档市价(5LvlMKT) 23:五档市价转限价(5LvlMTL) 24:市价转限价(MTL) 25:一定范围市价 |
2 |
OriginalQty | int | 原始委托数量 | 1 |
PositionEffect | int | 开/平 0:开仓 1:平仓 2:平今 3:平昨 4:自动选择开平 10:备兑开仓 11:备兑平仓 |
3 |
Price | float | 委托价格 | 4035 |
ReportID | string | 报单编号(内部指示) | "3135553907B" |
Security | string | 合约 | "rb" |
Security2 | string | 合约(复式单脚2) | "" |
SecurityType | string | 合约类型 | "F" |
Side | int | 买卖 1:Buy 2:Sell |
2 |
Side1 | int | 买卖 1:Buy 2:Sell(复式单脚1) |
0 |
Side2 | int | 买卖 1:Buy 2:Sell(复式单脚2) |
0 |
StopPrice | float | 停损价 | 0 |
Strategy | string | 策略名 | "" |
StrikePrice | float | 行权价 | 0 |
StrikePrice2 | float | 行权价(复式单脚2) | 0 |
Symbol | string | 合约代码 | "TC.F.SHFE.rb.202302" |
SymbolA | string | 合约代码(复式单脚1) | "" |
SymbolB | string | 合约代码 (复式单脚2) | "" |
TimeInForce | int | 委托单时间条件 1 : ROD当日有效 2 : IOC立即成交 3 : FOK立即全部成交否则取消 |
1 |
TouchCondition | string | 触价条件 | "" |
TradeDate | int | 交易日 | 0 |
TradeType | int | 0 : Normal 1 : Purchase on Margin 2 : ShortSell |
0 |
TransactDate | int | 更新日期 | 20230201 |
TransactTime | int | 更新時間 | 135606 |
UserKey1 | string | 用户自定义1 | "" |
UserKey2 | string | 用户自定义2 | "{"MSG":"Sell Qty=20"}" |
请求查询成交回报
返回所有已登入账号的成交回报 请求结果通过回调事件OnFilledReport(ByVal index As Integer, ByVal fillitem As RptFilledOrder)返回
Public Sub trade_OnFilledReport(ByVal index As Integer, ByVal fillitem As RptFilledOrder)
Debug.Print ("当日成交响应:" + fillitem.Account)
'fillitem.reportid
'fillitem.Account
'fillitem.BrokerID
'fillitem.symbol
'fillitem.Side
'fillitem.OrderID
'fillitem.MatchedQty
'fillitem.MatchedPrice
'fillitem.MatchedPrice1 / 10000000000#
'fillitem.MatchedPrice2 / 10000000000#
'fillitem.GetItemData ("OrderType")
'fillitem.TradeType
'fillitem.ExCode
'fillitem.PositionEffect
'fillitem.GetItemData ("DayTrade")
'fillitem.GetItemData ("TimeInForce")
'fillitem.GetItemData ("TrailingAmount")
'fillitem.GetItemData ("TouchCondition")
'fillitem.UserKey1
'fillitem.UserKey2
'fillitem.GetItemData ("CumQty")
'fillitem.GetItemData ("LeavesQty")
'fillitem.GetItemData ("ExecType")
'fillitem.GetItemData ("TriggeredPrice")
'fillitem.TransactDate
'fillitem.TransactTime
End Sub
'请求查询成交回报
Public Sub fillreport()
Call trade.ReqFillReport
End Sub
回调方法fillitem对象字段说明
字段 | 类型 | 注释 | 结果 |
---|---|---|---|
Account | string | 账号 | "9999-044491" |
BrokerID | string | 经纪商代码 | "CTP_SIMNOWSE662" |
CallPut | string | 合约认购/认沽标志 | "" |
CallPut2 | string | 合约认购/认沽标志(复式单脚2 ) | "" |
Exchange | string | 合约交易所 | "SHFE" |
MatchedPrice | float | 本次成交价格 | 4013 |
MatchedPrice1 | float | 本次成交价格 | 0 |
MatchedPrice2 | float | 本次成交价格 | 0 |
MatchedQty | int | 本次成交数量 | 20 |
Month | string | 合约月份 | "202302" |
Month2 | string | 合约月份(复式单脚2) | "" |
OrderID | string | 经纪商委托编号 | "SHFE-272096" |
PositionEffect | int | 开/平 0:开仓 1:平仓 2:平今 3:平昨 4:自动选择开平 10:备兑开仓 11:备兑平仓 |
3 |
DetailReportID | string | 成交明细单号 | "3144707897B-0" |
Security | string | 合约 | "rb" |
Security2 | string | 合约(复式单脚2) | "" |
SecurityType | string | 合约类型 | "F" |
Side | int | 买卖 1:Buy 2:Sell |
2 |
Side1 | int | 买卖 1:Buy 2:Sell(复式单脚1) |
0 |
Side2 | int | 买卖 1:Buy 2:Sell(复式单脚2) |
0 |
Strategy | string | 策略名 | "!!!{789F0756-A69F-4034-8713-8804B7EAD30A}" |
StrikePrice | float | 行权价 | 0 |
StrikePrice2 | float | 行权价(复式单脚2) | 0 |
Symbol | string | 合约代码 | "TC.F.SHFE.rb.202302" |
SymbolA | string | 合约代码(复式单脚1) | "" |
SymbolB | string | 合约代码 (复式单脚2) | "" |
TransactDate | int | 更新日期 | 20230201 |
TransactTime | int | 更新时间 | 64720 |
UserKey1 | string | 用户自定义1 | "" |
UserKey2 | string | 用户自定义2 | "{"MSG"Sell Qty=20"}" |
ReportID | string | 报单编号(内部指示) | "3144707897B" |
请求查询组合报单记录
允许缺省参数,参数缺省时,返回所有已登入账号的组合报单记录,例:Call trade.ReqCombinationOrder 带入账号参数时,返回对应账号的组合报单记录,参数格式:accountlistitem.BrokerID+"-"+accountlistitem.Account,例 Call trade.ReqCombinationOrder("CTP_SIMNOWSE662-9999-044491") 请求结果通过回调事件OnComOrderReport(ByVal index As Integer, ByVal AccMask As String, ByVal comborder As adiCombinationOrderItem)返回
Public Sub trade_OnComOrderReport(ByVal index As Integer, ByVal AccMask As String, ByVal comborder As adiCombinationOrderItem)
Debug.Print ("组合报单响应")
End Sub
'请求查询组合报单
Public Sub comborder()
Call trade.ReqCombinationOrder
End Sub
回调方法comborder对象字段说明
字段 | 类型 | 注释 | 结果 |
---|---|---|---|
Account | string | 账号 | |
BrokerID | string | 经纪商代码 | |
OrderID | string | 委托编号 | |
FilledID | string | 成交编号 | |
Symbol | string | 合约代码 | |
Quantity | int | 组合/拆分数量 | |
OptCombCode | int | 组合类型 | |
Side | int | 方向 1买 2卖 | |
CombSide | int | 组合方向 1 组合2拆分 | |
ExecType | int | 状态:0已经提交,1已经接受-1已经拒绝 |