添加市价单

This commit is contained in:
zhiyong 2025-05-12 14:52:27 +08:00
parent 6c3afde1b2
commit 959a83d011

View File

@ -310,7 +310,13 @@ class XtTrader(BaseTrader):
return {"error": self.connection_error_message or "交易系统连接失败"} 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 # 如果是市价单价格可以设为0
if price_type != xtconstant.FIX_PRICE: if price_type != xtconstant.FIX_PRICE:
@ -326,7 +332,13 @@ class XtTrader(BaseTrader):
return {"error": self.connection_error_message or "交易系统连接失败"} 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 # 如果是市价单价格可以设为0
if price_type != xtconstant.FIX_PRICE: if price_type != xtconstant.FIX_PRICE: