weekly update

This commit is contained in:
msincenselee 2016-09-12 10:58:24 +08:00
parent fd4e377df7
commit e373f16ac0
2 changed files with 11 additions and 3 deletions

View File

@ -640,7 +640,7 @@ class CtpTdApi(TdApi):
#----------------------------------------------------------------------
def onRspRemoveParkedOrderAction(self, data, error, n, last):
""""""
pass
pas
#----------------------------------------------------------------------
def onRspExecOrderInsert(self, data, error, n, last):

View File

@ -42,7 +42,7 @@ class MainWindow(QtGui.QMainWindow):
widgetMarketM, dockMarketM = self.createDock(MarketMonitor, u'行情', QtCore.Qt.RightDockWidgetArea)
widgetLogM, dockLogM = self.createDock(LogMonitor, u'日志', QtCore.Qt.BottomDockWidgetArea)
widgetErrorM, dockErrorM = self.createDock(ErrorMonitor, u'错误', QtCore.Qt.BottomDockWidgetArea)
widgetTradeM, dockTradeM = self.createDock(TradeMonitor, u'成交', QtCore.Qt.BottomDockWidgetArea)
self.widgetTradeM, dockTradeM = self.createDock(TradeMonitor, u'成交', QtCore.Qt.BottomDockWidgetArea)
self.widgetOrderM, dockOrderM = self.createDock(OrderMonitor, u'委托', QtCore.Qt.RightDockWidgetArea)
widgetPositionM, dockPositionM = self.createDock(PositionMonitor, u'持仓', QtCore.Qt.BottomDockWidgetArea)
widgetAccountM, dockAccountM = self.createDock(AccountMonitor, u'资金', QtCore.Qt.BottomDockWidgetArea)
@ -197,10 +197,18 @@ class MainWindow(QtGui.QMainWindow):
self.sbCount = 0
self.statusLabel.setText(self.getCpuMemory())
if self.connectGatewayName != EMPTY_STRING:
self.setWindowTitle(self.connectGatewayName)
# 定时重连
dt = datetime.now()
if dt.hour == 20 or dt.hour == 8:
if (dt.hour == 20 or dt.hour == 8) and dt.weekday() < 5:
if dt.minute == 40 and dt.second == 0 and self.connectGatewayName != EMPTY_STRING:
self.mainEngine.writeLog(u'清空委托列表')
self.widgetOrderM.dataDict.clear()
self.mainEngine.writeLog(u'清空交易列表')
self.widgetTradeM.dataDict.clear()
self.mainEngine.writeLog(u'重新连接{0}'.format(self.connectGatewayName))
self.mainEngine.connect(self.connectGatewayName)