vn.py官网
开源量化社区
Member
avatar
加入于:
帖子: 17
声望: 0

如题,文档里面没写脚本加载的方式

Member
avatar
加入于:
帖子: 3027
声望: 174

可以模仿no_ui脚本写一下https://github.com/vnpy/vnpy/blob/master/examples/no_ui/run.py

Member
avatar
加入于:
帖子: 17
声望: 0

xiaohe wrote:

可以模仿no_ui脚本写一下https://github.com/vnpy/vnpy/blob/master/examples/no_ui/run.py

其他模块都已经能加载,不知道算法交易的模块名称。

from vnpy.event import EventEngine
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import MainWindow, create_qapp
from vnpy.gateway.ctp import CtpGateway
from vnpy.app.cta_strategy import CtaStrategyApp
from vnpy.app.cta_backtester import CtaBacktesterApp
from vnpy.app.data_manager import DataManagerApp
from vnpy.app.option_master import OptionMasterApp
from vnpy.app.market_radar import MarketRadarApp
from vnpy.app.data_recorder import DataRecorderApp
from vnpy.app.risk_manager import RiskManagerApp
from vnpy.app.rpc_service import RpcServiceApp
from vnpy.gateway.rpc import RpcGateway
from vnpy.app.chart_wizard import ChartWizardApp
from vnpy.app.portfolio_manager import PortfolioManagerApp



def main():
    """Start VN 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_engine.add_app(DataManagerApp)
    main_engine.add_app(OptionMasterApp)
    main_engine.add_app(MarketRadarApp)
    main_engine.add_app(DataRecorderApp)
    main_engine.add_app(RiskManagerApp)
    main_engine.add_app(RpcServiceApp)
    main_engine.add_gateway(RpcGateway)
    main_engine.add_app(ChartWizardApp)
    main_engine.add_app(PortfolioManagerApp)

    main_window = MainWindow(main_engine, event_engine)
    main_window.showMaximized()

    qapp.exec()


if __name__ == "__main__":
    main()
Member
avatar
加入于:
帖子: 3027
声望: 174

from vnpy.app.algo_trading import AlgoTradingApp

Member
avatar
加入于:
帖子: 17
声望: 0

xiaohe wrote:

from vnpy.app.algo_trading import AlgoTradingApp

可以了,谢谢

© 2015-2019 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号-3

沪公网安备 31011502017034号