vnpy/vn.trader/vtMain.py
2016-02-14 13:03:41 +08:00

43 lines
1.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# encoding: UTF-8
import sys
import ctypes
#import bsddb3 as bsddb
#sys.modules['bsddb'] = bsddb
from vtEngine import MainEngine
from uiMainWindow import *
from simple_monitor import *
from setup_logger import setup_logger
setup_logger(filename='vnpy.log',debug=True)
# ----------------------------------------------------------------------
def main():
"""主程序入口"""
# 设置底部任务栏图标win7以下请注释掉
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('vn.py demo')
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()
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)
sys.exit(app.exec_())
if __name__ == '__main__':
main()