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 details)

Uploaded Source

File details

Details for the file py_ctp-1.1.3.tar.gz.

File metadata

  • Download URL: py_ctp-1.1.3.tar.gz
  • Upload date:
  • Size: 4.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for py_ctp-1.1.3.tar.gz
Algorithm Hash digest
SHA256 9e67ee6ba379ae11c56fc5bb9e6278e9ce466105576856caf50707cc1726250a
MD5 bfb676468a15a781e54fa7d0a77d13d7
BLAKE2b-256 5e9964f0285ec0765b086aa29e8a4ae34c5bb6a26376865d39cd98b8db328c77

See more details on using hashes here.

Supported by

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