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. Send a new order.
""" """
self.stop_order_count += 1 self.stop_order_count += 1
direction, offset = ORDER_CTA2VT[order_type]
stop_orderid = f"{STOPORDER_PREFIX}.{self.stop_order_count}" stop_orderid = f"{STOPORDER_PREFIX}.{self.stop_order_count}"
stop_order = StopOrder( stop_order = StopOrder(
vt_symbol=strategy.vt_symbol, vt_symbol=strategy.vt_symbol,
direction=direction, order_type=order_type,
offset=offset,
price=price, price=price,
volume=volume, volume=volume,
stop_orderid=stop_orderid, stop_orderid=stop_orderid,
strategy_name=strategy.strategy_name, strategy_name=strategy.strategy_name
) )
self.stop_orders[stop_orderid] = stop_order self.stop_orders[stop_orderid] = stop_order