Coder Social home page Coder Social logo

capitalapipy's Introduction

CapitalApiPY

群益Api_2.1.3.6 Python 串接範例

Last Modified 2017/07/29
V_0.0.0.1
適用Python 版本:3.5.2 |Anaconda custom (64-bit)|

目錄結構簡介:

[lib]

nPython.exe : Python DotNet執行檔,測試時請把python exe 環境指到此目錄下的 nPython.exe
如果是其他Python 版本,請至 https://github.com/pythonnet/pythonnet 自行編譯成需要的版本 
(在project property e.g.改成 PYTHON2;PYTHON27;UCS2)  

SKCOMTester.exe  : 實際運行python時調用,內容物跟群益給的 2.1.3.6 範例相似,
只是大部分的 Member 被我改成了Public
額外增加了以下兩個監聽消息的方法讓Python這邊收聽:
SendReturnMessageINT_PY (監聽都是int的回傳消息)
SendReturnMessageSTR_PY (監聽都是string的回傳消息,如果有混合的一律轉成Str)
修改過的Code都放在 SKCOMTester 目錄,皆有標註 Kang Added

[CapitalPYClass]

eventEngine.py : vnpy 的事件引擎主體,一行未改

eventType.py : 定義自己的Event名稱,這裡目前只有把群益 Quote Demo 的Event 加進去

SKPY.py  : python 的Api串接主體,在這邊定義Event 的轉發,主要內容引用了 vn.py 
(http://www.vnpy.org/) 的事件引擎,讓Capital傳來的事件進入 Queue隊列避免阻塞

UserInfo.cfg : 在這裡改上自己的帳號 & 密碼

執行方法:

lib/Startup.bat 

目前進度:

目前完成:收到Initialize之後開始接收 TX00 的 History Ticks,並在event隊列上把收到的Tick
列印出來
ToDo : 繼續完成 OnReply SendOrder 等細節完善

capitalapipy's People

Contributors

kangchihlun avatar

Watchers

James Cloos 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.