文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
枚举常量
OrderStatus委托状态
OrderStatus_New = 1 # 已报
OrderStatus_PartiallyFilled = 2 # 部成
OrderStatus_Filled = 3 # 已成
OrderStatus_Canceled = 5 # 已撤
OrderStatus_Rejected = 8 # 已拒绝
OrderStatus_PendingNew = 10 # 待报
OrderStatus_Expired = 12 # 已过期
OrderSide委托方向
OrderSide_Buy = 1 # 买入
OrderSide_Sell = 2 # 卖出
OrderType委托类型
用于映射OrderDuration和OrderQualifier的参数组合,推荐下单时直接指定OrderType,可无需额外指定OrderDuration和OrderQualifier
OrderType_Limit = 1 # 限价委托 (全部交易所支持)
OrderType_Market = 2 # 市价委托 (上期所和上能所不支持,中金所远期合约不支持,可转债不支持,上交所需要填上price保护限价)
# 终端3.18.0.0以上新增,终端低于3.18.0.0的版本的请看具体[组合参数](/faq/实盘问题.html#实盘市价单和限价单)填写
# 上交所
OrderType_Limit = 1 # 限价
OrderType_Market = 2 # 市价(默认五档即成转限)
OrderType_Market_BOC = 20 # 市价对方最优价格(best of counterparty)
OrderType_Market_BOP = 21 # 市价己方最优价格(best of party)
OrderType_Market_B5TC = 24 # 市价最优五档剩余撤销(best 5 then cancel)
OrderType_Market_B5TL = 25 # 市价最优五档剩余转限价(best 5 then limit)
# 深交所
OrderType_Limit = 1 # 限价
OrderType_Market = 2 # 市价(默认对方最优价)
OrderType_Market_BOC = 20 # 市价对方最优价格(best of counterparty)
OrderType_Market_BOP = 21 # 市价己方最优价格(best of party)
OrderType_Market_FAK = 22 # 市价即时成交剩余撤销(fill and kill)
OrderType_Market_FOK = 23 # 市价即时全额成交或撤销(fill or kill)
OrderType_Market_B5TC = 24 # 市价最优五档剩余撤销(best 5 then cancel)
# 大商所
OrderType_Limit = 1 # 限价
OrderType_Limit_FAK = 10 # 限价即时成交剩余撤销 (fill and kill)
OrderType_Limit_FOK = 11 # 限价即时全额成交或撤销 (fill or kill)
OrderType_Market = 2 # 市价
OrderType_Market_FAK = 22 # 市价即时成交剩余撤销(fill and kill)
OrderType_Market_FOK = 23 # 市价即时全额成交或撤销(fill or kill)
# 郑商所
OrderType_Limit = 1 # 限价
OrderType_Market = 2 # 市价
OrderType_Market_FOK = 23 # 市价即时全额成交或撤销(fill or kill)
# 上期所和上能所
OrderType_Limit = 1 # 限价
OrderType_Limit_FAK = 10 # 限价即时成交剩余撤销 (fill and kill)
OrderType_Limit_FOK = 11 # 限价即时全额成交或撤销 (fill or kill)
# 中金所
OrderType_Limit = 1 # 限价
OrderType_Limit_FAK = 10 # 限价即时成交剩余撤销 (fill and kill)
OrderType_Limit_FOK = 11 # 限价即时全额成交或撤销 (fill or kill)
OrderType_Market_B5TC = 24 # 市价最优五档剩余撤销(best 5 then cancel)
OrderType_Market_B5TL = 25 # 市价最优五档剩余转限价(best 5 then limit)
OrderType_Market_BOPC = 27 # 市价最优价即时成交剩余撤销(best of price then cancel)
OrderType_Market_BOPL = 28 # 市价最优价即时成交剩余转限价(best of price then limit)
# 广期所
OrderType_Limit = 1 # 限价
OrderType_Limit_FAK = 10 # 限价即时成交剩余撤销 (fill and kill)
OrderType_Limit_FOK = 11 # 限价即时全额成交或撤销 (fill or kill)
OrderType_Market = 2 # 市价
OrderType_Market_FAK = 22 # 市价即时成交剩余撤销(fill and kill)
OrderType_Market_FOK = 23 # 市价即时全额成交或撤销(fill or kill)
OrderDuration委托时间属性
仅在实盘模式生效,具体执行模式请参考交易所给出的定义,请参考
OrderDuration_FAK = 1 # 即时成交剩余撤销(fill and kill)
OrderDuration_FOK = 2 # 即时全额成交或撤销(fill or kill)
OrderDuration_GFD = 3 # 当日有效(good for day)
OrderDuration_GFS = 4 # 本节有效(good for section)
OrderDuration_GTD = 5 # 指定日期前有效(goodltilldate)
OrderDuration_GTC = 6 # 撤销前有效(goodtillcancel)
OrderDuration_GFA = 7 # 集合竞价前有效(good for auction)
OrderDuration_AHT = 8 # 盘后定价交易(after hour trading)
OrderQualifier委托成交属性
仅在实盘模式生效,具体执行模式请参考交易所给出的定义,请参考
OrderQualifier_BOC = 1 # 对方最优价格(best of counterparty)
OrderQualifier_BOP = 2 # 己方最优价格(best of party)
OrderQualifier_B5TC = 3 # 最优五档剩余撤销(best 5 then cancel)
OrderQualifier_B5TL = 4 # 最优五档剩余转限价(best 5 then limit)
OrderBusiness委托业务类型
用于映射OrderSide和PositionEffect的参数组合,新增业务类型
OrderBusiness_NORMAL = 0 # 普通交易。默认值为空,以保持向前兼容
OrderBusiness_STOCK_BUY = 1 # 股票,基金,可转债买入(映射OrderSide_Buy和PositionEffect_Open)
OrderBusiness_STOCK_SELL = 2 # 股票,基金,可转债卖出(映射OrderSide_Buy和PositionEffect_Close)
OrderBusiness_FUTURE_BUY_OPEN = 10 # 期货买入开仓(映射OrderSide_Buy和PositionEffect_Open)
OrderBusiness_FUTURE_SELL_CLOSE = 11 # 期货卖出平仓(映射OrderSide_Sell和PositionEffect_Open)
OrderBusiness_FUTURE_SELL_CLOSE_TODAY = 12 # 期货卖出平仓,优先平今(映射OrderSide_Sell和PositionEffect_CloseToday)
OrderBusiness_FUTURE_SELL_CLOSE_YESTERDAY = 13 # 期货卖出平仓,优先平昨(映射OrderSide_Sell和PositionEffect_CloseYesterday)
OrderBusiness_FUTURE_SELL_OPEN = 14 # 期货卖出开仓(映射OrderSide_Sell和PositionEffect_Open)
OrderBusiness_FUTURE_BUY_CLOSE = 15 # 期货买入平仓(映射OrderSide_Buy和PositionEffect_Close)
OrderBusiness_FUTURE_BUY_CLOSE_TODAY = 16 # 期货买入平仓,优先平今(映射OrderSide_Buy和PositionEffect_CloseToday)
OrderBusiness_FUTURE_BUY_CLOSE_YESTERDAY = 17 # 期货买入平仓,优先平昨(映射OrderSide_Buy和PositionEffect_CloseYesterday)
OrderBusiness_IPO_BUY = 100 # 新股申购 100
OrderBusiness_CREDIT_BOM = 200 # 融资买入(buying on margin)
OrderBusiness_CREDIT_SS = 201 # 融券卖出(short selling)
OrderBusiness_CREDIT_RSBBS = 202 # 买券还券(repay share by buying share)
OrderBusiness_CREDIT_RCBSS = 203 # 卖券还款(repay cash by selling share)
OrderBusiness_CREDIT_DRS = 204 # 直接还券(directly repay share)
OrderBusiness_CREDIT_BOC = 207 # 担保品买入(buying on collateral)
OrderBusiness_CREDIT_SOC = 208 # 担保品卖出(selling on collateral)
OrderBusiness_CREDIT_CI = 209 # 担保品转入(collateral in)
OrderBusiness_CREDIT_CO = 210 # 担保品转出(collateral out)
OrderBusiness_CREDIT_DRC = 211 # 直接还款(directly repay cash)
OrderBusiness_CREDIT_BOM_VIP = 212 # 专项融资买入(buying on margin for vip)
OrderBusiness_CREDIT_SS_VIP = 213 # 专项融券卖出(short selling for vip)
OrderBusiness_CREDIT_RSBBS_VIP = 214 # 专项买券还券(repay share by buying share for vip)
OrderBusiness_CREDIT_RCBSS_VIP = 215 # 专项卖券还款(repay cash by selling share for vip)
OrderBusiness_CREDIT_DRS_VIP = 216 # 专项直接还券(directly repay share for vip)
OrderBusiness_CREDIT_DRC_VIP = 217 # 专项直接还款(directly repay cash for vip)
OrderBusiness_ETF_BUY = 301 # ETF申购(purchase)
OrderBusiness_ETF_RED = 302 # ETF赎回(redemption)
OrderBusiness_FUND_SUB = 303 # 基金认购(subscribing)
OrderBusiness_FUND_BUY = 304 # 基金申购(purchase)
OrderBusiness_FUND_RED = 305 # 基金赎回(redemption)
OrderBusiness_FUND_CONVERT = 306 # 基金转换(convert)
OrderBusiness_FUND_SPLIT = 307 # 基金分拆(split)
OrderBusiness_FUND_MERGE = 308 # 基金合并(merge)
OrderBusiness_BOND_RRP = 400 # 债券逆回购
OrderBusiness_BOND_CONVERTIBLE_BUY = 401 # 可转债申购(purchase)
OrderBusiness_BOND_CONVERTIBLE_CALL = 402 # 可转债转股
OrderBusiness_BOND_CONVERTIBLE_PUT = 403 # 可转债回售
OrderBusiness_BOND_CONVERTIBLE_PUT_CANCEL = 404 # 可转债回售撤销
OrderBusiness_OPTION_BUY_OPEN = 500 # 期权买入开仓(映射OrderSide_Buy和PositionEffect_Open)
OrderBusiness_OPTION_SELL_CLOSE = 501 # 期权卖出平仓(映射OrderSide_Sell和PositionEffect_Open)
OrderBusiness_OPTION_SELL_OPEN = 502 # 期权卖出开仓(映射OrderSide_Sell和PositionEffect_Open)
OrderBusiness_OPTION_BUY_CLOSE = 503 # 期权买入平仓(映射OrderSide_Buy和PositionEffect_Close)
OrderBusiness_OPTION_COVERED_SELL_OPEN = 504 # 期权备兑开仓(备兑卖出开仓,只适用认购合约)
OrderBusiness_OPTION_COVERED_BUY_CLOSE = 505 # 期权备兑平仓(备兑买入平仓,只适用认购合约)
OrderBusiness_OPTION_EXERCISE = 506 # 期权行权
ExecType执行回报类型
ExecType_Trade = 15 # 成交
ExecType_CancelRejected = 19 # 撤单被拒绝
PositionEffect开平仓类型
PositionEffect_Open = 1 # 开仓
PositionEffect_Close = 2 # 平仓, 具体语义取决于对应的交易所(实盘上期所和上海能源所不适用,上期所和上海能源所严格区分平今平昨,需要用3和4)
PositionEffect_CloseToday = 3 # 平今仓
PositionEffect_CloseYesterday = 4 # 平昨仓(只适用于期货,不适用股票,股票用2平仓)
PositionSide持仓方向
PositionSide_Long = 1 # 多方向
PositionSide_Short = 2 # 空方向
OrderRejectReason订单拒绝原因
(仿真有效,实盘需要参考具体的拒绝原因)
OrderRejectReason_Unknown = 0 # 未知原因
OrderRejectReason_RiskRuleCheckFailed = 1 # 不符合风控规则
OrderRejectReason_NoEnoughCash = 2 # 资金不足
OrderRejectReason_NoEnoughPosition = 3 # 仓位不足
OrderRejectReason_IllegalAccountId = 4 # 非法账户ID
OrderRejectReason_IllegalStrategyId = 5 # 非法策略ID
OrderRejectReason_IllegalSymbol = 6 # 非法交易标的
OrderRejectReason_IllegalVolume = 7 # 非法委托量
OrderRejectReason_IllegalPrice = 8 # 非法委托价
OrderRejectReason_AccountDisabled = 10 # 交易账号被禁止交易
OrderRejectReason_AccountDisconnected = 11 # 交易账号未连接
OrderRejectReason_AccountLoggedout = 12 # 交易账号未登录
OrderRejectReason_NotInTradingSession = 13 # 非交易时段
OrderRejectReason_OrderTypeNotSupported = 14 # 委托类型不支持
OrderRejectReason_Throttle = 15 # 流控限制
CancelOrderRejectReason取消订单拒绝原因
CancelOrderRejectReason_OrderFinalized = 101 # 委托已完成
CancelOrderRejectReason_UnknownOrder = 102 # 未知委托
CancelOrderRejectReason_BrokerOption = 103 # 柜台设置
CancelOrderRejectReason_AlreadyInPendingCancel = 104 # 委托撤销中
OrderStyle委托风格
OrderStyle_Unknown = 0
OrderStyle_Volume = 1 # 按指定量委托
OrderStyle_Value = 2 # 按指定价值委托
OrderStyle_Percent = 3 # 按指定比例委托
OrderStyle_TargetVolume = 4 # 调仓到目标持仓量
OrderStyle_TargetValue = 5 # 调仓到目标持仓额
OrderStyle_TargetPercent = 6 # 调仓到目标持仓比例
CashPositionChangeReason仓位变更原因
CashPositionChangeReason_Trade = 1 # 交易
CashPositionChangeReason_Inout = 2 # 出入金 / 出入持仓
SecType标的类别
SEC_TYPE_STOCK = 1 # 股票
SEC_TYPE_FUND = 2 # 基金
SEC_TYPE_INDEX = 3 # 指数
SEC_TYPE_FUTURE = 4 # 期货
SEC_TYPE_OPTION = 5 # 期权
SEC_TYPE_CREDIT = 6 # 信用交易
SEC_TYPE_BOND = 7 # 债券
SEC_TYPE_BOND_CONVERTIBLE = 8 # 可转债
SEC_TYPE_CONFUTURE = 10 # 期货连续合约
AccountStatus交易账户状态
State_CONNECTING = 1 # 连接中
State_CONNECTED = 2 # 已连接
State_LOGGEDIN = 3 # 已登录
State_DISCONNECTING = 4 # 断开中
State_DISCONNECTED = 5 # 已断开
State_ERROR = 6 # 错误
PositionSrc头寸来源(仅适用融券融券)
PositionSrc_L1 = 1 # 普通池
PositionSrc_L2 = 2 # 专项池
AlgoOrderStatus算法单状态,暂停/恢复算法单时有效
AlgoOrderStatus_Resume = 1 # 恢复母单
AlgoOrderStatus_Pause = 2 # 暂停母单
AlgoOrderStatus_PauseAndCancelSubOrders = 3 # 暂停母单并撤子单
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论