Skip to main content

Python CTP futures api

Project description

hf\_ctp\_py\_proxy
==================

上期技术期货交易api之python封装,实现接口调用。支持windows linux.

环境需求
--------

- VS2017
- python 3.6+
- 64位

使用说明
--------

- 运行 ``pyton generate\\run.py`` 生成所有文件
- C++编译

- Windows

- 环境要求 ``vs2017`` ``64位``
- 设置项目为x64,否则会提示找不到windows.h
- 打开ctp\_c\\ctp.sln
- 编译ctp\_quote 和 ctp\_trade项目
- 编译后生成的dll放在dll目录下

- Linux

- 设置系统语言为:zh\_CN.UTF-8
- 复制文件到linux ctp\_c\\\ *.h *.cpp 到ctp\_c目录下
- 复制 ctp\_20180109\\\*.so到dll目录下
- 复制 py\_ctp\\\*.py到py\_ctp目录下
- 进入dll目录,执行以下指令

- g++ -shared -fPIC ../ctp\_c/trade.cpp -o ./ctp\_trade.so
./thosttraderapi.so
- g++ -shared -fPIC ../ctp\_c/quote.cpp -o ./ctp\_quote.so
./thostmduserapi.so

- 测试

- 执行 ``copy ctp_20180109\\*.dll dll\``
- Python

- 运行 ``python py_ctp\test_api.py``

- C#

- ``copy cs_ctp\*.cs cs_ctp\ctp_test\``
- 打开cs\_ctp\_test 项目进行调试
- ``copy cs_ctp\*.cs cs_ctp\proxy\``
- 打开cs\_ctp项目编译.net封装
- 打开cs\_ctp项目测试.net封装

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_ctp-1.1.3.tar.gz (4.2 MB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page