This commit is contained in:
vnpy 2016-05-03 23:42:06 +08:00
commit ef639ecff6
3 changed files with 13 additions and 5 deletions

View File

@ -278,6 +278,9 @@ class IbWrapper(EWrapper):
tick = self.tickDict[tickerId]
key = tickFieldMap[field]
tick.__setattr__(key, price)
# 行情数据更新
newtick = copy(tick)
self.gateway.onTick(newtick)
else:
print field

View File

@ -9,7 +9,7 @@
import json
import os
import winsound
import platform
from eventEngine import *
from vtConstant import *
@ -118,6 +118,9 @@ class RmEngine(object):
def writeRiskLog(self, content):
"""快速发出日志事件"""
# 发出报警提示音
if platform.uname() == 'Windows':
import winsound
winsound.PlaySound("SystemHand", winsound.SND_ASYNC)
# 发出日志事件

View File

@ -395,6 +395,7 @@ class MarketMonitor(BasicMonitor):
d['symbol'] = {'chinese':u'合约代码', 'cellType':BasicCell}
d['vtSymbol'] = {'chinese':u'名称', 'cellType':NameCell}
d['lastPrice'] = {'chinese':u'最新价', 'cellType':BasicCell}
d['preClosePrice'] = {'chinese':u'昨收盘价', 'cellType':BasicCell}
d['volume'] = {'chinese':u'成交量', 'cellType':BasicCell}
d['openInterest'] = {'chinese':u'持仓量', 'cellType':BasicCell}
d['openPrice'] = {'chinese':u'开盘价', 'cellType':BasicCell}
@ -650,7 +651,8 @@ class TradingWidget(QtGui.QFrame):
productClassList = [PRODUCT_NONE,
PRODUCT_EQUITY,
PRODUCT_FUTURES,
PRODUCT_OPTION]
PRODUCT_OPTION,
PRODUCT_FOREX]
gatewayList = ['']