vnpy/vn.trader/vtConstant.py
2017-03-07 22:22:21 +08:00

100 lines
3.0 KiB
Python
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.

# encoding: UTF-8
# 默认空值
EMPTY_STRING = ''
EMPTY_UNICODE = u''
EMPTY_INT = 0
EMPTY_FLOAT = 0.0
# 风控常量
RISK_OK = 0 # 风控正常
RISK_ERROR_ORDER_SIZE = 1 # 单笔委托数量超限
RISK_ERROR_TRADE_COUNT = 2 # 今日总成交合约数量超限
RISK_ERROR_ORDER_FLOW_COUNT = 3 # 委托流数量超限
RISK_ERROR_WORKING_ORDER = 4 # 当前活动委托数量超限
RISK_ERROR_ORDER_SEND = 5 # 当日单品种报撤次数超限
RISK_MESSAGE = {RISK_ERROR_ORDER_SIZE: u'单笔委托数量超限', RISK_ERROR_TRADE_COUNT: u'今日总成交合约数量超限',
RISK_ERROR_ORDER_FLOW_COUNT: u'委托流数量超限', RISK_ERROR_WORKING_ORDER: u'当前活动委托数量超限',
RISK_ERROR_ORDER_SEND: u'当日单品种报撤次数超限'}
# 方向常量
DIRECTION_NONE = u'无方向'
DIRECTION_LONG = u''
DIRECTION_SHORT = u''
DIRECTION_UNKNOWN = u'未知'
DIRECTION_NET = u''
DIRECTION_SELL = u'卖出' # IB接口
# 开平常量
OFFSET_NONE = u'无开平'
OFFSET_OPEN = u'开仓'
OFFSET_CLOSE = u'平仓'
OFFSET_CLOSETODAY = u'平今'
OFFSET_CLOSEYESTERDAY = u'平昨'
OFFSET_UNKNOWN = u'未知'
# 状态常量
STATUS_NOTTRADED = u'未成交'
STATUS_PARTTRADED = u'部分成交'
STATUS_ALLTRADED = u'全部成交'
STATUS_CANCELLED = u'已撤销'
STATUS_UNKNOWN = u'未知'
# 合约类型常量
PRODUCT_EQUITY = u'股票'
PRODUCT_FUTURES = u'期货'
PRODUCT_OPTION = u'期权'
PRODUCT_INDEX = u'指数'
PRODUCT_COMBINATION = u'组合'
PRODUCT_FOREX = u'外汇'
PRODUCT_UNKNOWN = u'未知'
PRODUCT_SPOT = u'现货'
PRODUCT_DEFER = u'延期'
PRODUCT_NONE = ''
# 价格类型常量
PRICETYPE_LIMITPRICE = u'限价'
PRICETYPE_MARKETPRICE = u'市价'
PRICETYPE_FAK = u'FAK'
PRICETYPE_FOK = u'FOK'
# 期权类型
OPTION_CALL = u'看涨期权'
OPTION_PUT = u'看跌期权'
# 交易所类型
EXCHANGE_SSE = 'SSE' # 上交所
EXCHANGE_SZSE = 'SZSE' # 深交所
EXCHANGE_CFFEX = 'CFFEX' # 中金所
EXCHANGE_SHFE = 'SHFE' # 上期所
EXCHANGE_CZCE = 'CZCE' # 郑商所
EXCHANGE_DCE = 'DCE' # 大商所
EXCHANGE_SGE = 'SGE' # 上金所
EXCHANGE_UNKNOWN = 'UNKNOWN'# 未知交易所
EXCHANGE_NONE = '' # 空交易所
EXCHANGE_HKEX = 'HKEX' # 港交所
EXCHANGE_HKFE = 'HKFE' # 香港期货交易所
EXCHANGE_SMART = 'SMART' # IB智能路由股票、期权
EXCHANGE_NYMEX = 'NYMEX' # IB 期货
EXCHANGE_GLOBEX = 'GLOBEX' # CME电子交易平台
EXCHANGE_IDEALPRO = 'IDEALPRO' # IB外汇ECN
EXCHANGE_CME = 'CME' # CME交易所
EXCHANGE_ICE = 'ICE' # ICE交易所
EXCHANGE_OANDA = 'OANDA' # OANDA外汇做市商
EXCHANGE_OKCOIN = 'OKCOIN' # OKCOIN比特币交易所
EXCHANGE_HUOBI = 'HUOBI' # 火币比特币交易所
EXCHANGE_LHANG = 'LHANG' # 链行比特币交易所
# 货币类型
CURRENCY_USD = 'USD' # 美元
CURRENCY_CNY = 'CNY' # 人民币
CURRENCY_HKD = 'HKD' # 港币
CURRENCY_UNKNOWN = 'UNKNOWN' # 未知货币
CURRENCY_NONE = '' # 空货币
# 数据库
LOG_DB_NAME = 'VnTrader_Log_Db'