This commit is contained in:
vn.py 2019-03-14 09:10:57 +08:00
parent bea1facfaf
commit 7711825486

View File

@ -301,17 +301,15 @@ class CtaEngine(BaseEngine):
Send a new order.
"""
self.stop_order_count += 1
direction, offset = ORDER_CTA2VT[order_type]
stop_orderid = f"{STOPORDER_PREFIX}.{self.stop_order_count}"
stop_order = StopOrder(
vt_symbol=strategy.vt_symbol,
direction=direction,
offset=offset,
order_type=order_type,
price=price,
volume=volume,
stop_orderid=stop_orderid,
strategy_name=strategy.strategy_name,
strategy_name=strategy.strategy_name
)
self.stop_orders[stop_orderid] = stop_order