GithubHelp home page GithubHelp logo

fuwenbo2013 / ctp-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from keli/ctp-python

0.0 0.0 0.0 6.79 MB

穿透式监管版本CTP接口的Python封装

License: BSD 2-Clause "Simplified" License

C++ 87.19% C 2.93% Python 9.88%

ctp-python's Introduction

ctp-python

穿透式监管版本CTP接口的Python封装

安装说明

克隆代码到本地

[email protected]:keli/ctp-python.git
cd ctp-python

安装

python setup.py install

目前默认使用的是6.3.15版本。如果需要链接和使用6.3.13版,需要加一点步骤:

  1. 修改setup.py中的API_VER的值为'6.3.13'

  2. 用swig重新生成一下源码

cd ctp-python
swig -python -py3 -c++ -threads -I./api/6.3.13 -o ctp_wrap.cpp ctp.i
python setup.py install

跑一下测试

pytest -s tests/test_trader.py --front=tcp://180.168.146.187:13030 --broker=<broker_id> --user=<investor_id> --password=<password> --app=<app_id> --auth=<auth_code>

其他事项

  • 本项目中CTP返回的GBK编码字符串已经全部自动转换为UTF-8
  • 市场数据中的极大值代表无数据,为可读性起见打印整个结构体时会显示为None
  • 目前只支持了Python 3,测试环境Linux
  • simnow已经启用6.3.15版本

有用的参考链接

ctp-python's People

Contributors

keli 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.