Giter Club home page Giter Club logo

vnctp's Introduction

vnctp

vnpy 使用 的ctp python封装, 重写了编译脚本,可以通过cmake进行编辑

使用方法

Windows下编译请先安装miniconda、clang和msvc

Linux下编译请先安装python和gcc

CMake编译

cmake .
make

Windows手动编译

clang++ -c -o vnctpmd.o src/vnctpmd/vnctpmd.cpp -I C:/ProgramData/miniconda3/include -I ./include/
clang++ -shared -o vnctpmd.pyd vnctpmd.o -L ./lib -lthostmduserapi_se -L C:/ProgramData/miniconda3/libs

clang++ -c -o vnctptd.o src/vnctptd/vnctptd.cpp -I C:/ProgramData/miniconda3/include -I ./include/
clang++ -shared -o vnctptd.pyd vnctptd.o -L ./lib -lthosttraderapi_se -L C:/ProgramData/miniconda3/libs

Linux手动编译

g++ -c -fPIC -o vnctpmd.o src/vnctpmd/vnctpmd.cpp -I /usr/include/python3.6/ -I ./include/
g++ -shared -o vnctpmd.so vnctpmd.o -L ./lib -lthostmduserapi_se

g++ -c -fPIC -o vnctptd.o src/vnctptd/vnctptd.cpp -I /usr/include/python3.6/ -I ./include/
g++ -shared -o vnctptd.so vnctptd.o -L ./lib -lthosttraderapi_se

使用

将vnctpmd.pyd 和 vnctptd.pyd 复制出来(Linux下是vnctpmd.so和vnctptd.so),并和thostmduserapi_se.dll thosttraderapi_se.dll放在同一目录(Linux下是libthostmduserapi_se.so 和 libthosttraderapi_se.so)。

from vnctpmd import MdApi
from vnctptd import TdApi
md = MdApi()
td = TdApi()
print(md.GetApiVersion())
print(td.GetApiVersion())

输出:

v6.3.19_P1_20200106 15:21:32
v6.3.19_P1_20200106 15:21:32

vnctp's People

Contributors

shunfang avatar

Stargazers

 avatar  avatar  avatar 许江 avatar colin avatar Stubblef avatar kannon01  avatar  avatar cheng avatar  avatar  avatar Zhang Hao avatar  avatar cococo avatar ChandlerChan 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.