This commit is contained in:
vn.py 2018-08-05 22:03:43 +08:00
parent 1cba50e41c
commit a674c1c72b
4 changed files with 15 additions and 8 deletions

View File

@ -497,10 +497,11 @@ class LogMonitor(BasicMonitor):
cellLogContent = BasicCell(logContent) cellLogContent = BasicCell(logContent)
cellGatewayName = BasicCell(error.gatewayName) cellGatewayName = BasicCell(error.gatewayName)
self.setItem(0, 0, cellLogTime) self.setItem(0, 0, cellGatewayName)
self.setItem(0, 1, cellLogContent) self.setItem(0, 1, cellLogTime)
self.setItem(0, 2, cellGatewayName) self.setItem(0, 2, cellLogContent)
######################################################################## ########################################################################
class TradeMonitor(BasicMonitor): class TradeMonitor(BasicMonitor):

View File

@ -188,7 +188,7 @@ class BlWidget(AlgoWidget):
def getAlgoSetting(self): def getAlgoSetting(self):
"""""" """"""
setting = OrderedDict() setting = OrderedDict()
setting['templateName'] = StopAlgo.templateName setting['templateName'] = self.templateName
setting['vtSymbol'] = str(self.lineVtSymbol.text()) setting['vtSymbol'] = str(self.lineVtSymbol.text())
setting['direction'] = text_type(self.comboDirection.currentText()) setting['direction'] = text_type(self.comboDirection.currentText())
setting['offset'] = text_type(self.comboOffset.currentText()) setting['offset'] = text_type(self.comboOffset.currentText())

View File

@ -34,7 +34,7 @@ class IcebergAlgo(AlgoTemplate):
self.price = float(setting['price']) # 价格 self.price = float(setting['price']) # 价格
self.volume = float(setting['volume']) # 数量 self.volume = float(setting['volume']) # 数量
self.display = float(setting['display']) # 挂出数量 self.display = float(setting['display']) # 挂出数量
self.interval = text_type(setting['interval']) # 间隔 self.interval = int(setting['interval']) # 间隔
self.offset = text_type(setting['offset']) # 开平 self.offset = text_type(setting['offset']) # 开平
self.count = 0 # 执行计数 self.count = 0 # 执行计数
@ -73,12 +73,18 @@ class IcebergAlgo(AlgoTemplate):
def onTimer(self): def onTimer(self):
"""""" """"""
self.count += 1 self.count += 1
if self.count < self.interval: if self.count < self.interval:
self.varEvent() self.varEvent()
return return
self.count = 0 self.count = 0
contract = self.getContract(self.vtSymbol)
if not contract:
self.writeLog(u'找不到合约%s' %self.vtSymbol)
return
if not self.vtOrderID: if not self.vtOrderID:
orderVolume = self.volume - self.tradedVolume orderVolume = self.volume - self.tradedVolume
orderVolume = min(orderVolume, self.display) orderVolume = min(orderVolume, self.display)
@ -193,7 +199,7 @@ class IcebergWidget(AlgoWidget):
def getAlgoSetting(self): def getAlgoSetting(self):
"""""" """"""
setting = OrderedDict() setting = OrderedDict()
setting['templateName'] = StopAlgo.templateName setting['templateName'] = self.templateName
setting['vtSymbol'] = str(self.lineVtSymbol.text()) setting['vtSymbol'] = str(self.lineVtSymbol.text())
setting['direction'] = text_type(self.comboDirection.currentText()) setting['direction'] = text_type(self.comboDirection.currentText())
setting['offset'] = text_type(self.comboOffset.currentText()) setting['offset'] = text_type(self.comboOffset.currentText())

View File

@ -178,7 +178,7 @@ class SniperWidget(AlgoWidget):
def getAlgoSetting(self): def getAlgoSetting(self):
"""""" """"""
setting = OrderedDict() setting = OrderedDict()
setting['templateName'] = StopAlgo.templateName setting['templateName'] = self.templateName
setting['vtSymbol'] = str(self.lineVtSymbol.text()) setting['vtSymbol'] = str(self.lineVtSymbol.text())
setting['direction'] = text_type(self.comboDirection.currentText()) setting['direction'] = text_type(self.comboDirection.currentText())
setting['offset'] = text_type(self.comboOffset.currentText()) setting['offset'] = text_type(self.comboOffset.currentText())