[bug fix]
This commit is contained in:
parent
c76202586c
commit
e7c7c209c1
@ -1001,8 +1001,8 @@ class BackTestingEngine(object):
|
|||||||
order.status = Status.CANCELLED
|
order.status = Status.CANCELLED
|
||||||
order.cancel_time = str(self.last_dt)
|
order.cancel_time = str(self.last_dt)
|
||||||
del self.active_limit_orders[vt_orderid]
|
del self.active_limit_orders[vt_orderid]
|
||||||
if strategy:
|
if order_strategy:
|
||||||
strategy.on_order(order)
|
order_strategy.on_order(order)
|
||||||
|
|
||||||
# 撤销本地停止单
|
# 撤销本地停止单
|
||||||
for stop_orderid in list(self.active_stop_orders.keys()):
|
for stop_orderid in list(self.active_stop_orders.keys()):
|
||||||
|
@ -873,8 +873,8 @@ class CtaStockTemplate(CtaTemplate):
|
|||||||
网格逐一止损/止盈检查 (根据指数价格进行止损止盈)
|
网格逐一止损/止盈检查 (根据指数价格进行止损止盈)
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
if self.entrust != 0:
|
#if self.entrust != 0:
|
||||||
return
|
# return
|
||||||
|
|
||||||
if not self.trading and not self.inited:
|
if not self.trading and not self.inited:
|
||||||
self.write_error(u'当前不允许交易')
|
self.write_error(u'当前不允许交易')
|
||||||
|
@ -983,8 +983,8 @@ class BackTestingEngine(object):
|
|||||||
order.status = Status.CANCELLED
|
order.status = Status.CANCELLED
|
||||||
order.cancel_time = str(self.last_dt)
|
order.cancel_time = str(self.last_dt)
|
||||||
del self.active_limit_orders[vt_orderid]
|
del self.active_limit_orders[vt_orderid]
|
||||||
if strategy:
|
if order_strategy:
|
||||||
strategy.on_order(order)
|
order_strategy.on_order(order)
|
||||||
|
|
||||||
# 撤销本地停止单
|
# 撤销本地停止单
|
||||||
for stop_orderid in list(self.active_stop_orders.keys()):
|
for stop_orderid in list(self.active_stop_orders.keys()):
|
||||||
|
@ -1076,7 +1076,7 @@ class CtaEngine(BaseEngine):
|
|||||||
|
|
||||||
if strategy.trading:
|
if strategy.trading:
|
||||||
msg = f"{strategy_name}已经启动,请勿重复操作"
|
msg = f"{strategy_name}已经启动,请勿重复操作"
|
||||||
self.write_error(msg)
|
self.write_log(msg)
|
||||||
return False, msg
|
return False, msg
|
||||||
|
|
||||||
self.call_strategy_func(strategy, strategy.on_start)
|
self.call_strategy_func(strategy, strategy.on_start)
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user