Giter VIP home page Giter VIP logo

ctp_trader's Introduction

基于CTP接口开发的交易平台,目前尚在开发中,可以实现行情订阅、下单等功能,供学习参考使用
目前效果图如下,已经完成订阅实时期货行情,动态显示价格交易量等信息。

使用

代码大部分采用c++编写,编译如下

mkdir build
cd build && cmake ..
make

编译好之后需要在项目根目录下新建config文件夹,并在该目录下新建config.txt文件。文件内容如下,其中investorid和password为模拟账号的账号和密码,第四行为下单时设置的滑点(最小交易单位的多少倍)。

9999
investorid
password
2

行情获取及存储

行情获取通过上期ctp行情接口回报,保存至本地数据库,这里使用的是mysql数据库。

前端显示

为了实时显示行情数据及后续自定义交易信号,判断进场时机,使用pyecharts和flask显示数据。代码位于src\tools\flask

python3 server.py

显示效果如下:

image

ctp_trader's People

Contributors

zhouhy0903 avatar

Watchers

 avatar

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.