PDF下载 下载

枚举常量

阅读 104715

OrderStatus - 委托状态

  1. OrderStatus_Unknown = 0
  2. OrderStatus_New = 1 # 已报
  3. OrderStatus_PartiallyFilled = 2 # 部成
  4. OrderStatus_Filled = 3 # 已成
  5. OrderStatus_Canceled = 5 # 已撤
  6. OrderStatus_PendingCancel = 6 # 待撤
  7. OrderStatus_Rejected = 8 # 已拒绝
  8. OrderStatus_Suspended = 9 # 挂起 (无效)
  9. OrderStatus_PendingNew = 10 # 待报
  10. OrderStatus_Expired = 12 # 已过期

OrderSide - 委托方向

  1. OrderSide_Unknown = 0
  2. OrderSide_Buy = 1 # 买入
  3. OrderSide_Sell = 2 # 卖出

OrderType - 委托类型

  1. OrderType_Unknown = 0
  2. OrderType_Limit = 1 # 限价委托
  3. OrderType_Market = 2 # 市价委托
  4. OrderType_Stop = 3 # 止损止盈委托 (还不支持)

OrderDuration - 委托时间属性

仅在实盘模式生效,具体执行模式请参考交易所给出的定义,请参考

  1. OrderDuration_Unknown = 0
  2. OrderDuration_FAK = 1 # 即时成交剩余撤销(fill and kill)
  3. OrderDuration_FOK = 2 # 即时全额成交或撤销(fill or kill)
  4. OrderDuration_GFD = 3 # 当日有效(good for day)
  5. OrderDuration_GFS = 4 # 本节有效(good for section)
  6. OrderDuration_GTD = 5 # 指定日期前有效(goodltilldate)
  7. OrderDuration_GTC = 6 # 撤销前有效(goodtillcancel)
  8. OrderDuration_GFA = 7 # 集合竞价前有效(good for auction)
  9. OrderDuration_AHT = 8 # 盘后定价交易(after hour trading)

OrderQualifier - 委托成交属性

仅在实盘模式生效,具体执行模式请参考交易所给出的定义,请参考

  1. OrderQualifier_Unknown = 0
  2. OrderQualifier_BOC = 1 # 对方最优价格(best of counterparty)
  3. OrderQualifier_BOP = 2 # 己方最优价格(best of party)
  4. OrderQualifier_B5TC = 3 # 最优五档剩余撤销(best 5 then cancel)
  5. OrderQualifier_B5TL = 4 # 最优五档剩余转限价(best 5 then limit)

OrderBusiness - 委托业务类型

  1. OrderBusiness_NORMAL = 0 # 普通交易。默认值为空,以保持向前兼容
  2. OrderBusiness_CREDIT_BOM = 200 # 融资买入(buying on margin)
  3. OrderBusiness_CREDIT_SS = 201 # 融券卖出(short selling)
  4. OrderBusiness_CREDIT_RSBBS = 202 # 买券还券(repay share by buying share)
  5. OrderBusiness_CREDIT_RCBSS = 203 # 卖券还款(repay cash by selling share)
  6. OrderBusiness_CREDIT_DRS = 204 # 直接还券(directly repay share)
  7. # 直接还款: 不通过委托,参考接口...
  8. OrderBusiness_CREDIT_BOC = 207 # 担保品买入(buying on collateral)
  9. OrderBusiness_CREDIT_SOC = 208 # 担保品卖出(selling on collateral)
  10. OrderBusiness_CREDIT_CI = 209 # 担保品转入(collateral in)
  11. OrderBusiness_CREDIT_CO = 210 # 担保品转出(collateral out)
  12. OrderBusiness_BOND_CONVERTIBLE_CALL = 402 #可转债转股
  13. OrderBusiness_BOND_CONVERTIBLE_PUT = 403 #可转债回售
  14. OrderBusiness_BOND_CONVERTIBLE_PUT_CANCEL = 404 #可转债回售撤销

ExecType - 执行回报类型

  1. ExecType_Unknown = 0
  2. ExecType_Trade = 15 # 成交
  3. ExecType_CancelRejected = 19 # 撤单被拒绝

PositionEffect - 开平仓类型

  1. PositionEffect_Unknown = 0
  2. PositionEffect_Open = 1 # 开仓
  3. PositionEffect_Close = 2 # 平仓, 具体语义取决于对应的交易所
  4. PositionEffect_CloseToday = 3 # 平今仓
  5. PositionEffect_CloseYesterday = 4 # 平昨仓

PositionSide - 持仓方向

  1. PositionSide_Unknown = 0
  2. PositionSide_Long = 1 # 多方向
  3. PositionSide_Short = 2 # 空方向

OrderRejectReason - 订单拒绝原因

(仿真有效,实盘需要参考具体的拒绝原因)

  1. OrderRejectReason_Unknown = 0 # 未知原因
  2. OrderRejectReason_RiskRuleCheckFailed = 1 # 不符合风控规则
  3. OrderRejectReason_NoEnoughCash = 2 # 资金不足
  4. OrderRejectReason_NoEnoughPosition = 3 # 仓位不足
  5. OrderRejectReason_IllegalAccountId = 4 # 非法账户ID
  6. OrderRejectReason_IllegalStrategyId = 5 # 非法策略ID
  7. OrderRejectReason_IllegalSymbol = 6 # 非法交易标的
  8. OrderRejectReason_IllegalVolume = 7 # 非法委托量
  9. OrderRejectReason_IllegalPrice = 8 # 非法委托价
  10. OrderRejectReason_AccountDisabled = 10 # 交易账号被禁止交易
  11. OrderRejectReason_AccountDisconnected = 11 # 交易账号未连接
  12. OrderRejectReason_AccountLoggedout = 12 # 交易账号未登录
  13. OrderRejectReason_NotInTradingSession = 13 # 非交易时段
  14. OrderRejectReason_OrderTypeNotSupported = 14 # 委托类型不支持
  15. OrderRejectReason_Throttle = 15 # 流控限制

CancelOrderRejectReason - 取消订单拒绝原因

  1. CancelOrderRejectReason_OrderFinalized = 101 # 委托已完成
  2. CancelOrderRejectReason_UnknownOrder = 102 # 未知委托
  3. CancelOrderRejectReason_BrokerOption = 103 # 柜台设置
  4. CancelOrderRejectReason_AlreadyInPendingCancel = 104 # 委托撤销中

OrderStyle - 委托风格

  1. OrderStyle_Unknown = 0
  2. OrderStyle_Volume = 1 # 按指定量委托
  3. OrderStyle_Value = 2 # 按指定价值委托
  4. OrderStyle_Percent = 3 # 按指定比例委托
  5. OrderStyle_TargetVolume = 4 # 调仓到目标持仓量
  6. OrderStyle_TargetValue = 5 # 调仓到目标持仓额
  7. OrderStyle_TargetPercent = 6 # 调仓到目标持仓比例

CashPositionChangeReason - 仓位变更原因

  1. CashPositionChangeReason_Unknown = 0
  2. CashPositionChangeReason_Trade = 1 # 交易
  3. CashPositionChangeReason_Inout = 2 # 出入金 / 出入持仓

SecType - 标的类别

  1. SEC_TYPE_STOCK = 1 # 股票
  2. SEC_TYPE_FUND = 2 # 基金
  3. SEC_TYPE_INDEX = 3 # 指数
  4. SEC_TYPE_FUTURE = 4 # 期货
  5. SEC_TYPE_OPTION = 5 # 期权
  6. SEC_TYPE_CREDIT = 6 # 信用交易
  7. SEC_TYPE_BOND = 7 # 债券
  8. SEC_TYPE_BOND_CONVERTIBLE = 8 # 可转债
  9. SEC_TYPE_CONFUTURE = 10 # 虚拟合约

AccountStatus - 交易账户状态

  1. State_UNKNOWN = 0 #未知
  2. State_CONNECTING = 1 #连接中
  3. State_CONNECTED = 2 #已连接
  4. State_LOGGEDIN = 3 #已登录
  5. State_DISCONNECTING = 4 #断开中
  6. State_DISCONNECTED = 5 #已断开
  7. State_ERROR = 6 #错误

PositionSrc - 头寸来源(仅适用融券融券)

  1. PositionSrc_Unknown = 0
  2. PositionSrc_L1 = 1 #普通池
  3. PositionSrc_L2 = 2 #专项池

AlgoOrderStatus 算法单状态,暂停/恢复算法单时有效

  1. AlgoOrderStatus_Unknown = 0,
  2. AlgoOrderStatus_Resume = 1, #恢复母单
  3. AlgoOrderStatus_Pause = 2, #暂停母单
  4. AlgoOrderStatus_PauseAndCancelSubOrders = 3 #暂停母单并撤子单
0 篇笔记