vnpy 首次运行:启动 VeighNa Trader

365bet导航 admin 2026-11-06 20:54:50

Official example官方 run.py 示例以下为 vnpy 官方 README 提供的首次运行脚本(2026-08 核验)。

from vnpy.event import EventEngine

from vnpy.trader.engine import MainEngine

from vnpy.trader.ui import MainWindow, create_qapp

from vnpy_ctp import CtpGateway

from vnpy_ctastrategy import CtaStrategyApp

from vnpy_ctabacktester import CtaBacktesterApp

def main():

# Start VeighNa Trader

qapp = create_qapp()

event_engine = EventEngine()

main_engine = MainEngine(event_engine)

main_engine.add_gateway(CtpGateway)

main_engine.add_app(CtaStrategyApp)

main_engine.add_app(CtaBacktesterApp)

main_window = MainWindow(main_engine, event_engine)

main_window.showMaximized()

qapp.exec()

if __name__ == "__main__":

main()运行:在脚本目录打开命令行(Windows 用 CMD/PowerShell),执行 python run.py 启动 VeighNa Trader。

相关文章

乒乓球团体世界杯历届冠军 中国女团实现9连冠

各类活期理财大比拼,哪类产品收益更高? 去年12月27日,人民银行起草了《关于规范现金管理类理财产品管理有关事项的通知(征求意见稿)》,对银行现金管理类产品在投...

杨浠月名字测试评分

troop什么意思 怎么快速记忆

冬天最值得去的12个地方

炽玫瑰 (Thermalily) - [BOT]植物魔法 (Botania) - MC百科

赖昌星可能将被遣返回国

DNF万世荣光如何获得

Android 上关闭应用程序的 5 种最佳方法