Giter VIP home page Giter VIP logo

vnpy_qmt's Introduction

vnpy_qmt

QMT Gateway for vnpy

实现功能

  • 连接mini客户端实现普通买卖

安装方式

  • pip源安装:已经发布到pypi仓库, 可以直接用pip命令安装
    pip install vnpy-qmt
    
  • 源码安装: 下载源码, 解压, 切换vnpy环境, 在cmd里执行
    (vnpyO) D:\work\my>cd vnpy_qmt
    (vnpyO) D:\work\my\vnpy_qmt>pip install .
    

启用通道

  1. 需要使用脚本启动方式启动vnpy, 下面是一个示例(文件名如:run.py)
  2. 切换到vnpy环境(或者使用vnpy对应的python绝对路径),运行 python run.py
# -*- coding:utf-8 -*-

from vnpy.event import EventEngine
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import MainWindow, create_qapp
# 导入QMT gateway
from vnpy_qmt.qmt_gateway import QmtGateway
from vnpy_ctastrategy import CtaEngine, CtaStrategyApp


def main():
    """Start VN Trader"""
    qapp = create_qapp()

    event_engine = EventEngine()
    main_engine = MainEngine(event_engine)
    main_engine.add_app(CtaStrategyApp)
    # 添加gateway
    main_engine.add_gateway(QmtGateway, gateway_name="QMT")

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

    qapp.exec()


if __name__ == "__main__":
    main()

依赖项目

迅投xtquant官网下载 迅投xtquant介绍

使用

  1. 启动、登录QMT mini客户端
  2. 在vn.py连接QMT login_qmt.png

vnpy_qmt's People

Contributors

ruyisee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vnpy_qmt's Issues

在UI界面下,配合recorder引擎,出错

-- coding:utf-8 --

from vnpy.event import EventEngine
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import MainWindow, create_qapp

导入QMT gateway

from vnpy_qmt.qmt_gateway import QmtGateway

from vnpy_ctastrategy import CtaEngine, CtaStrategyApp
from vnpy_ctastrategy import CtaStrategyApp

from vnpy_datarecorder import DataRecorderApp

from vnpy_ctabacktester import CtaBacktesterApp
from vnpy_datamanager import DataManagerApp

def main():
"""Start VN Trader"""
qapp = create_qapp()

event_engine = EventEngine()
main_engine = MainEngine(event_engine)
main_engine.add_app(CtaStrategyApp)
# 添加gateway
main_engine.add_gateway(QmtGateway, gateway_name="QMT")

main_engine.add_app(CtaStrategyApp)
main_engine.add_app(CtaBacktesterApp)

main_engine.add_app(DataRecorderApp)
main_engine.add_app(DataManagerApp)

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

qapp.exec()

if name == "main":
main()
在非交易时间段,显示正常,当然也没有数据产生
Snipaste_2024-01-30_06-15-50
但是,如果 在交易时间段,在界面阶段就出错
Snipaste_2024-01-30_09-45-08
Snipaste_2024-01-30_10-06-05

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.