增加CTA策略模块的回测引擎在收到限价委托后先推送未成交状态
This commit is contained in:
parent
fe92850996
commit
801e3edd1e
@ -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
|
||||
|
@ -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()
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user