添加市价单
This commit is contained in:
parent
6c3afde1b2
commit
959a83d011
@ -310,7 +310,13 @@ class XtTrader(BaseTrader):
|
||||
return {"error": self.connection_error_message or "交易系统连接失败"}
|
||||
|
||||
# 确定价格类型
|
||||
price_type = xtconstant.MARKET_BEST if order_type == 'market' else xtconstant.FIX_PRICE
|
||||
if order_type == 'limit':
|
||||
price_type = xtconstant.FIX_PRICE
|
||||
else:
|
||||
if code.endswith('.SH'):
|
||||
price_type = xtconstant.MARKET_SH_CONVERT_5_CANCEL
|
||||
else:
|
||||
price_type = xtconstant.MARKET_SZ_CONVERT_5_CANCEL
|
||||
|
||||
# 如果是市价单,价格可以设为0
|
||||
if price_type != xtconstant.FIX_PRICE:
|
||||
@ -326,7 +332,13 @@ class XtTrader(BaseTrader):
|
||||
return {"error": self.connection_error_message or "交易系统连接失败"}
|
||||
|
||||
# 确定价格类型
|
||||
price_type = xtconstant.MARKET_BEST if order_type == 'market' else xtconstant.FIX_PRICE
|
||||
if order_type == 'limit':
|
||||
price_type = xtconstant.FIX_PRICE
|
||||
else:
|
||||
if code.endswith('.SH'):
|
||||
price_type = xtconstant.MARKET_SH_CONVERT_5_CANCEL
|
||||
else:
|
||||
price_type = xtconstant.MARKET_SZ_CONVERT_5_CANCEL
|
||||
|
||||
# 如果是市价单,价格可以设为0
|
||||
if price_type != xtconstant.FIX_PRICE:
|
||||
|
Loading…
x
Reference in New Issue
Block a user