增加CTA策略模块的回测引擎在收到限价委托后先推送未成交状态

This commit is contained in:
vn.py 2017-07-10 20:22:31 +08:00
parent fe92850996
commit 801e3edd1e
2 changed files with 8 additions and 2 deletions

View File

@ -228,7 +228,6 @@ class BacktestingEngine(object):
order.vtSymbol = vtSymbol
order.price = self.roundToPriceTick(price)
order.totalVolume = volume
order.status = STATUS_NOTTRADED # 刚提交尚未成交
order.orderID = orderID
order.vtOrderID = orderID
order.orderTime = str(self.dt)
@ -321,6 +320,11 @@ class BacktestingEngine(object):
# 遍历限价单字典中的所有限价单
for orderID, order in self.workingLimitOrderDict.items():
# 推送委托进入队列(未成交)的状态更新
if not order.status:
order.status = STATUS_NOTTRADED
self.strategy.onOrder(order)
# 判断是否会成交
buyCross = (order.direction==DIRECTION_LONG and
order.price>=buyCrossPrice and

View File

@ -1305,10 +1305,12 @@ class SettingEditor(QtWidgets.QWidget):
#----------------------------------------------------------------------
def show(self):
"""显示"""
# 更新配置文件下拉框
self.comboFileName.clear()
self.comboFileName.addItems(jsonPathDict.keys())
super(SettingEditor, self).showMaximized()
# 显示界面
super(SettingEditor, self).show()