Skip to content

sweihub/ctp-rs

This branch is 11 commits ahead of, 6 commits behind SheldonNico/ctp-rs:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Alex Wei
Nov 23, 2022
cb13003 · Nov 23, 2022

History

16 Commits
Nov 23, 2022
Nov 23, 2022
Nov 23, 2022
Oct 16, 2020
Nov 18, 2022
Nov 18, 2022
Nov 23, 2022
Nov 23, 2022
Nov 23, 2022

Repository files navigation

Fork of CTP-RS

  1. CTP SDK updated to v6.6.9_tradeapi_20220920, and the SDK was shipped.
  2. Rewrite the wrapper code generator, see build.rs for autogen(). Safe way of calling SPI instance.
  3. Success to compile examples on Linux
  4. Fail to link examples on Windows, linkage issue, yet to solve! Rust cannot link with Windows DLL, might be ABI issue, for you to solve if you need Windows version.

ctp-rs

CTP sdk version: 6.3.15_20190220 15:47:00

*.hpp and *.cpp are generated by autobind.py, then processed by rut_bindgen. Look at xtp-rs for detail.

Use at your own risk. The crate is unsafe, look at examples/tdapi.rs and examples/mdapi.rs for how to use it.

where to put my .so files

so files is not included, please put it like this:

$ tree shared

shared
├── data_collect
│   ├── unix.x86_64
│   │   ├── libLinuxDataCollect.so -> LinuxDataCollect.so
│   │   └── LinuxDataCollect.so
│   ├── windows.x86
│   │   ├── WinDataCollect.dll
│   │   └── WinDataCollect.lib
│   └── windows.x86_x64
│       ├── WinDataCollect.dll
│       └── WinDataCollect.lib
├── include
│   ├── DataCollect.h
│   ├── ThostFtdcMdApi.h
│   ├── ThostFtdcTraderApi.h
│   ├── ThostFtdcUserApiDataType.h
│   └── ThostFtdcUserApiStruct.h
├── md
│   ├── unix.x86_64
│   │   ├── libthostmduserapi_se.so -> thostmduserapi_se.so
│   │   └── thostmduserapi_se.so
│   ├── windows.x86
│   │   ├── thostmduserapi_se.dll
│   │   └── thostmduserapi_se.lib
│   └── windows.x86_x64
│       ├── thostmduserapi_se.dll
│       └── thostmduserapi_se.lib
└── td
    ├── unix.x86_64
    │   ├── libthosttraderapi_se.so -> thosttraderapi_se.so
    │   └── thosttraderapi_se.so
    ├── windows.x86
    │   ├── thosttraderapi_se.dll
    │   └── thosttraderapi_se.lib
    └── windows.x86_x64
        ├── thosttraderapi_se.dll
        └── thosttraderapi_se.lib

About

rust bindings for ctp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 45.5%
  • C 42.1%
  • C++ 12.4%