vnpy/vn.trader/vtMain.py

43 lines
1.2 KiB
Python
Raw Normal View History

2015-10-19 08:42:17 +00:00
# encoding: UTF-8
import sys
import ctypes
2016-02-14 05:03:41 +00:00
#import bsddb3 as bsddb
#sys.modules['bsddb'] = bsddb
2015-10-19 08:42:17 +00:00
from vtEngine import MainEngine
from uiMainWindow import *
2016-02-14 05:03:41 +00:00
from simple_monitor import *
from setup_logger import setup_logger
setup_logger(filename='vnpy.log',debug=True)
2015-11-15 07:53:54 +00:00
# ----------------------------------------------------------------------
2015-10-19 08:42:17 +00:00
def main():
"""主程序入口"""
# 设置底部任务栏图标win7以下请注释掉
2016-02-14 05:03:41 +00:00
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('vn.py demo')
2015-10-19 08:42:17 +00:00
app = QtGui.QApplication(sys.argv)
app.setWindowIcon(QtGui.QIcon('vnpy.ico'))
app.setFont(BASIC_FONT)
mainEngine = MainEngine()
mainWindow = MainWindow(mainEngine, mainEngine.eventEngine, mainEngine.dataEngine)
mainWindow.showMaximized()
2016-02-14 05:03:41 +00:00
logM = LogMonitor(mainEngine.eventEngine)
ctaLogM = CtaLogMonitor(mainEngine.eventEngine)
errorM = ErrorMonitor(mainEngine.eventEngine)
tradeM = TradeMonitor(mainEngine.eventEngine)
orderM = OrderMonitor(mainEngine.eventEngine, mainEngine)
positionM = PositionMonitor(mainEngine.eventEngine)
accountM = AccountMonitor(mainEngine.eventEngine)
2015-10-19 08:42:17 +00:00
sys.exit(app.exec_())
if __name__ == '__main__':
main()