├── .gitattributes ├── .gitignore ├── Matlab ├── README.md └── test │ ├── BuyLimit.m │ ├── NLog.dll │ ├── NLog.xml │ ├── OnMdConnectionStatus.m │ ├── OnRtnDepthMarketData.m │ ├── OnRtnOrder.m │ ├── OnTdConnectionStatus.m │ ├── QuantBox.XAPI.dll │ ├── QuantBox_CTP_Quote.dll │ ├── QuantBox_CTP_Trade.dll │ ├── QuantBox_Queue_x86.dll │ ├── msvcp120.dll │ ├── msvcp120d.dll │ ├── msvcr120.dll │ ├── msvcr120d.dll │ ├── test.asv │ ├── test.m │ ├── thostmduserapi.dll │ └── thosttraderapi.dll ├── Python ├── base │ ├── __init__.py │ ├── abstract_xapi.py │ ├── callbacks.py │ └── comm.py ├── include │ └── LTS │ │ ├── SecurityFtdcMdApi.h │ │ ├── SecurityFtdcTraderApi.h │ │ ├── SecurityFtdcUserApiDataType.h │ │ ├── SecurityFtdcUserApiStruct.h │ │ ├── linux64 │ │ ├── libsecuritymduserapi.so │ │ └── libsecuritytraderapi.so │ │ └── version.txt ├── logger │ ├── __init__.py │ ├── file_logger.py │ └── logger.py ├── tests │ ├── __init__.py │ ├── lts_market_tests.py │ └── lts_trade_tests.py ├── xapi.py └── xapi_backtesting.py ├── QuantBox_CTP_Quote ├── MdUserApi.cpp ├── MdUserApi.h ├── QuantBox_CTP_Quote.cbp ├── QuantBox_CTP_Quote.depend ├── QuantBox_CTP_Quote.vcxproj ├── QuantBox_CTP_Quote.vcxproj.filters ├── QuantBox_CTP_Quote.vcxproj.user ├── ReadMe.txt ├── dllmain.cpp ├── main.cpp ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── QuantBox_CTP_Trade ├── QuantBox_CTP_Trade.cbp ├── QuantBox_CTP_Trade.vcxproj ├── QuantBox_CTP_Trade.vcxproj.filters ├── ReadMe.txt ├── TraderApi.cpp ├── TraderApi.h ├── TypeConvert.cpp ├── TypeConvert.h ├── dllmain.cpp ├── main.cpp ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── QuantBox_DFITC_Level2 ├── Level2UserApi.cpp ├── Level2UserApi.h ├── QuantBox_DFITC_Level2.cbp ├── QuantBox_DFITC_Level2.vcxproj ├── QuantBox_DFITC_Level2.vcxproj.filters ├── ReadMe.txt ├── dllmain.cpp ├── main.cpp ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── QuantBox_Esunny_HistoricalData ├── HistoricalDataApi.cpp ├── HistoricalDataApi.h ├── QuantBox_Esunny_HistoricalData.vcxproj ├── QuantBox_Esunny_HistoricalData.vcxproj.filters ├── ReadMe.txt ├── dllmain.cpp ├── main.cpp ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── QuantBox_Femas_Quote ├── MdUserApi.cpp ├── MdUserApi.h ├── QuantBox_CTP_Quote.cbp ├── QuantBox_Femas_Quote.vcxproj ├── QuantBox_Femas_Quote.vcxproj.filters ├── QuantBox_Femas_Quote.vcxproj.user ├── ReadMe.txt ├── dllmain.cpp ├── main.cpp ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── QuantBox_Femas_Trade ├── QuantBox_Femas_Trade.cbp ├── QuantBox_Femas_Trade.def ├── QuantBox_Femas_Trade.vcxproj ├── QuantBox_Femas_Trade.vcxproj.filters ├── QuantBox_Femas_Trade.vcxproj.user ├── ReadMe.txt ├── TraderApi.cpp ├── TraderApi.h ├── TypeConvert.cpp ├── TypeConvert.h ├── dllmain.cpp ├── main.cpp ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── QuantBox_KingstarGold ├── QuantBox_KingstarGold.vcxproj ├── QuantBox_KingstarGold.vcxproj.filters ├── ReadMe.txt ├── TraderApi.cpp ├── TraderApi.h ├── TypeConvert.cpp ├── TypeConvert.h ├── dllmain.cpp ├── main.cpp ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── QuantBox_KingstarStock_Trade ├── QuantBox_KingstarStock_Trade.vcxproj ├── QuantBox_KingstarStock_Trade.vcxproj.filters ├── ReadMe.txt ├── TraderApi.cpp ├── TraderApi.h ├── TypeConvert.cpp ├── TypeConvert.h ├── dllmain.cpp ├── main.cpp ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── QuantBox_Kingstar_Quote ├── MdUserApi.cpp ├── MdUserApi.h ├── QuantBox_Kingstar_Quote.vcxproj ├── QuantBox_Kingstar_Quote.vcxproj.filters ├── ReadMe.txt ├── dllmain.cpp ├── main.cpp ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── QuantBox_Kingstar_Trade ├── QuantBox_Kingstar_Trade.vcxproj ├── QuantBox_Kingstar_Trade.vcxproj.filters ├── ReadMe.txt ├── TraderApi.cpp ├── TraderApi.h ├── TypeConvert.cpp ├── TypeConvert.h ├── dllmain.cpp ├── main.cpp ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── QuantBox_LTS_Level2 ├── Level2UserApi.cpp ├── Level2UserApi.h ├── QuantBox_LTS_Level2.cbp ├── QuantBox_LTS_Level2.vcxproj ├── QuantBox_LTS_Level2.vcxproj.filters ├── ReadMe.txt ├── dllmain.cpp ├── main.cpp ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── QuantBox_LTS_Quote ├── MdUserApi.cpp ├── MdUserApi.h ├── QuantBox_LTS_Quote.cbp ├── QuantBox_LTS_Quote.vcxproj ├── QuantBox_LTS_Quote.vcxproj.filters ├── ReadMe.txt ├── dllmain.cpp ├── main.cpp ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── QuantBox_LTS_Trade ├── QuantBox_LTS_Trade.cbp ├── QuantBox_LTS_Trade.vcxproj ├── QuantBox_LTS_Trade.vcxproj.filters ├── ReadMe.txt ├── TraderApi.cpp ├── TraderApi.h ├── TypeConvert.cpp ├── TypeConvert.h ├── dllmain.cpp ├── main.cpp ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── QuantBox_Queue ├── ArrayLockFreeQueue.h ├── ArrayLockFreeQueueImp.h ├── MsgQueue.cpp ├── MsgQueue.h ├── QuantBox_Queue.cbp ├── QuantBox_Queue.depend ├── QuantBox_Queue.vcxproj ├── QuantBox_Queue.vcxproj.filters ├── QuantBox_Queue.vcxproj.user ├── ReadMe.txt ├── RemoteQueue.cpp ├── RemoteQueue.h ├── atom_opt.h ├── atomicops.h ├── concurrentqueue.h ├── dllmain.cpp ├── main.cpp ├── readerwriterqueue.h ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── QuantBox_TongShi_Quote ├── DialogStockDrv.cpp ├── DialogStockDrv.h ├── MdUserApi.cpp ├── MdUserApi.h ├── QuantBox_TongShi_Quote.cpp ├── QuantBox_TongShi_Quote.h ├── QuantBox_TongShi_Quote.rc ├── QuantBox_TongShi_Quote.vcxproj ├── QuantBox_TongShi_Quote.vcxproj.filters ├── ReadMe.txt ├── Stockdrv.h ├── TypeConvert.cpp ├── TypeConvert.h ├── main.cpp ├── res │ └── QuantBox_TongShi_Quote.rc2 ├── resource.h ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── QuantBox_XAPI ├── QuantBox_XAPI.cbp ├── QuantBox_XAPI.cpp ├── QuantBox_XAPI.vcxproj ├── QuantBox_XAPI.vcxproj.filters ├── ReadMe.txt ├── XApiC.cpp ├── XApiCpp.cpp ├── XApiImpl.cpp ├── XApiImpl.h ├── dllmain.cpp ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── QuantBox_XAPI_CSharp_Linux.sln ├── QuantBox_XAPI_C_Linux.workspace ├── QuantBox_XAPI_TEST ├── QuantBox_XAPI_TEST.cbp ├── QuantBox_XAPI_TEST.cpp ├── QuantBox_XAPI_TEST.vcxproj ├── QuantBox_XAPI_TEST.vcxproj.filters ├── ReadMe.txt ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── QuantBox_XAPI_Windows.sln ├── QuantBox_XSpeedStock_Quote ├── MdUserApi.cpp ├── MdUserApi.h ├── QuantBox_XSpeedStock_Quote.vcxproj ├── QuantBox_XSpeedStock_Quote.vcxproj.filters ├── QuantBox_XSpeedStock_Quote.vcxproj.user ├── ReadMe.txt ├── dllmain.cpp ├── main.cpp ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── QuantBox_XSpeedStock_Trade ├── QuantBox_XSpeedStock_Trade.vcxproj ├── QuantBox_XSpeedStock_Trade.vcxproj.filters ├── ReadMe.txt ├── TraderApi.cpp ├── TraderApi.h ├── TypeConvert.cpp ├── TypeConvert.h ├── dllmain.cpp ├── main.cpp ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── QuantBox_XSpeed_Quote ├── MdUserApi.cpp ├── MdUserApi.h ├── QuantBox_XSpeed_Quote.cbp ├── QuantBox_XSpeed_Quote.vcxproj ├── QuantBox_XSpeed_Quote.vcxproj.filters ├── QuantBox_XSpeed_Quote.vcxproj.user ├── ReadMe.txt ├── dllmain.cpp ├── main.cpp ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── QuantBox_XSpeed_Trade ├── QuantBox_XSpeed_Trade.cbp ├── QuantBox_XSpeed_Trade.vcxproj ├── QuantBox_XSpeed_Trade.vcxproj.filters ├── ReadMe.txt ├── TraderApi.cpp ├── TraderApi.h ├── TypeConvert.cpp ├── TypeConvert.h ├── dllmain.cpp ├── main.cpp ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── README.md ├── clear.bat ├── csharp └── QuantBox.XAPI │ ├── Callback │ ├── BaseApi.cs │ ├── XApi.HistoricalData.cs │ ├── XApi.Instrument.cs │ ├── XApi.MarketData.cs │ ├── XApi.QuoteRequest.cs │ ├── XApi.Trade.cs │ └── XApi.cs │ ├── Delegate.cs │ ├── DllInvoke.cs │ ├── Enum.cs │ ├── Event │ ├── EventArgs.cs │ └── XApiWrapper.cs │ ├── Extensions.cs │ ├── GB2312Marshaler.cs │ ├── Interface │ └── IXApi.cs │ ├── InvokeBase.cs │ ├── OptimizedEnum.cs │ ├── PInvokeUtility.cs │ ├── PositionFieldEx.cs │ ├── Program.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── Proxy.cs │ ├── QuantBox.XAPI.csproj │ ├── QuantBox.XAPI_Linux.csproj │ ├── RequestType.cs │ ├── ResponeType.cs │ ├── SoInvoke.cs │ ├── Struct.cs │ └── packages.config ├── include ├── ApiDataType.h ├── ApiEnum.h ├── ApiHeader.def ├── ApiHeader.h ├── ApiProcess.cpp ├── ApiProcess.h ├── ApiStruct.h ├── CTP │ ├── ThostFtdcMdApi.h │ ├── ThostFtdcTraderApi.h │ ├── ThostFtdcUserApiDataType.h │ ├── ThostFtdcUserApiStruct.h │ ├── error.dtd │ ├── error.xml │ ├── linux32 │ │ ├── libthostmduserapi.so │ │ └── libthosttraderapi.so │ ├── linux64 │ │ ├── libthostmduserapi.so │ │ └── libthosttraderapi.so │ ├── md5.txt │ ├── version.txt │ └── win32 │ │ ├── thostmduserapi.dll │ │ ├── thostmduserapi.lib │ │ ├── thosttraderapi.dll │ │ └── thosttraderapi.lib ├── ChinaStock.cpp ├── ChinaStock.h ├── CrossPlatform.h ├── DFITC_L2 │ ├── BasicDataType.h │ ├── DFITCL2Api.h │ ├── DFITCL2ApiDataType.h │ ├── linux64 │ │ └── liblevel2Api.so │ └── win32 │ │ ├── level2Api.dll │ │ └── level2Api.lib ├── Esunny_HistoricalData │ ├── EsunnyQuot.h │ ├── EsunnyQuot.lib │ ├── EsunnyQuot_20110908.dll │ ├── EsunnyQuot_20140812.dll │ ├── win32 │ │ ├── EsunnyQuot.lib │ │ ├── EsunnyQuot_20110908.dll │ │ └── EsunnyQuot_20140812.dll │ └── 易盛行情接口说明.pdf ├── Femas │ ├── USTPFtdcMduserApi.h │ ├── USTPFtdcTraderApi.h │ ├── USTPFtdcUserApiDataType.h │ ├── USTPFtdcUserApiStruct.h │ ├── linux64 │ │ ├── libUSTPmduserapi.so │ │ └── libUSTPtraderapi.so │ ├── version.txt │ └── win32 │ │ ├── USTPmduserapi.dll │ │ ├── USTPmduserapi.lib │ │ ├── USTPtraderapi.dll │ │ └── USTPtraderapi.lib ├── Kingstar │ ├── IncEx │ │ ├── KSCosApi.h │ │ ├── KSMdApiEx.h │ │ ├── KSOptionApi.h │ │ ├── KSTraderApiEx.h │ │ ├── KSUserApiDataTypeEx.h │ │ ├── KSUserApiStructEx.h │ │ ├── KSVocApi.h │ │ ├── KSVocApiDataType.h │ │ └── KSVocApiStruct.h │ ├── inc │ │ ├── KSMarketDataAPI.h │ │ └── KSTradeAPI.h │ └── win32 │ │ ├── KSMarketDataAPI.dll │ │ ├── KSMarketDataAPI.lib │ │ ├── KSTradeAPI.dll │ │ ├── KSTradeAPI.lib │ │ ├── SSPXEncode.dll │ │ ├── ksPortalAPI.dll │ │ └── lkcdll.dll ├── Kingstar_Gold │ ├── APIError.h │ ├── Constant.h │ ├── GoldTradeApi.h │ ├── KSUserApiDataTypeEx.h │ ├── KSUserApiStructEx.h │ └── win32 │ │ ├── KSInterMG.dll │ │ ├── KSLOG.dll │ │ ├── KSRsaCrypto.dll │ │ ├── SLEdll │ │ ├── KSCA │ │ │ ├── KS_SafeEngine.dll │ │ │ ├── SLE_KSCA.dll │ │ │ ├── ksca │ │ │ │ ├── client.crt │ │ │ │ ├── client.key │ │ │ │ ├── ksca.crt │ │ │ │ ├── ksca.key │ │ │ │ ├── server.crt │ │ │ │ └── server.key │ │ │ ├── libeay32.dll │ │ │ ├── libssl32.dll │ │ │ └── ssleay32.dll │ │ └── SafeLoginEngine.ini │ │ ├── goldtradeapi.dll │ │ ├── goldtradeapi.lib │ │ ├── ksSafeLoginEngineG.dll │ │ └── xSafeEngine.dll ├── Kingstar_Stock │ ├── SPXAPI.h │ ├── SPXAPI_struct.h │ ├── SPXAPI_type.h │ └── win32 │ │ ├── JGJRGL.lkc │ │ ├── SPXAPI.dll │ │ ├── SPXAPI.lib │ │ └── SPXInter.dll ├── LTS │ ├── SecurityFtdcMdApi.h │ ├── SecurityFtdcTraderApi.h │ ├── SecurityFtdcUserApiDataType.h │ ├── SecurityFtdcUserApiStruct.h │ ├── linux64 │ │ ├── libsecuritymduserapi.so │ │ └── libsecuritytraderapi.so │ ├── version.txt │ └── win32 │ │ ├── securitymduserapi.dll │ │ ├── securitymduserapi.lib │ │ ├── securitytraderapi.dll │ │ └── securitytraderapi.lib ├── LTS_L2 │ ├── LTS_ns.h │ ├── SecurityFtdcL2MDUserApi.h │ ├── SecurityFtdcL2MDUserApiDataType.h │ ├── SecurityFtdcL2MDUserApiStruct.h │ ├── linux64 │ │ └── libL2mduserapi.so │ ├── version.txt │ └── win32 │ │ ├── L2mduserapi.dll │ │ └── L2mduserapi.lib ├── QueueEnum.h ├── QueueHeader.h ├── QueueStruct.h ├── XApiC.def ├── XApiC.h ├── XApiCpp.h ├── XSpeed │ ├── DFITCApiDataType.h │ ├── DFITCApiStruct.h │ ├── DFITCMdApi.h │ ├── DFITCTraderApi.h │ ├── error.dtd │ ├── error.xml │ ├── linux64 │ │ ├── libDFITCMdApi.so │ │ └── libDFITCTraderApi.so │ ├── version.txt │ └── win32 │ │ ├── DFITCMdApi.dll │ │ ├── DFITCMdApi.lib │ │ ├── DFITCTraderApi.dll │ │ └── DFITCTraderApi.lib ├── XSpeed_Stock │ ├── DFITCSECApiDataType.h │ ├── DFITCSECApiStruct.h │ ├── DFITCSECMdApi.h │ ├── DFITCSECTraderApi.h │ ├── error.dtd │ ├── error.xml │ ├── version.txt │ └── win32 │ │ ├── DFITCSECMdApi.dll │ │ ├── DFITCSECMdApi.lib │ │ ├── DFITCSECTraderApi.dll │ │ └── DFITCSECTraderApi.lib ├── ZeroMQ │ ├── ZeroMQ.zip │ ├── x86 │ │ ├── czmq.dll │ │ ├── czmq.lib │ │ ├── libsodium.dll │ │ ├── libzmq.dll │ │ └── libzmq.lib │ └── 说明.txt ├── stdafx.h ├── toolkit.cpp └── toolkit.h ├── lib ├── QuantBox_Queue_x86.lib └── QuantBox_XAPI.lib └── packages └── repositories.config /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /Matlab/README.md: -------------------------------------------------------------------------------- 1 | # Matlab接.Net版的接口 2 | 3 | 目标是能用Matlab也进行交易,已经测试通过。能接收行情,能下单,能撤单。
4 | 用户要使用时应当要在Matlab中对一些API进行封装,否则用起来太麻烦。
5 | 后期考虑模仿Trading Toolbox的调用方式
6 | 指定要加载的库即可使用对应版本的API 7 | 8 | 1. 将C#接口的回调函数的方式改成了事件方式 9 | 2. 在Matlab中用addlistener来注册事件处理函数 10 | 3. 用global来实现变量引用 -------------------------------------------------------------------------------- /Matlab/test/BuyLimit.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Matlab/test/BuyLimit.m -------------------------------------------------------------------------------- /Matlab/test/NLog.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Matlab/test/NLog.dll -------------------------------------------------------------------------------- /Matlab/test/OnMdConnectionStatus.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Matlab/test/OnMdConnectionStatus.m -------------------------------------------------------------------------------- /Matlab/test/OnRtnDepthMarketData.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Matlab/test/OnRtnDepthMarketData.m -------------------------------------------------------------------------------- /Matlab/test/OnRtnOrder.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Matlab/test/OnRtnOrder.m -------------------------------------------------------------------------------- /Matlab/test/OnTdConnectionStatus.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Matlab/test/OnTdConnectionStatus.m -------------------------------------------------------------------------------- /Matlab/test/QuantBox.XAPI.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Matlab/test/QuantBox.XAPI.dll -------------------------------------------------------------------------------- /Matlab/test/QuantBox_CTP_Quote.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Matlab/test/QuantBox_CTP_Quote.dll -------------------------------------------------------------------------------- /Matlab/test/QuantBox_CTP_Trade.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Matlab/test/QuantBox_CTP_Trade.dll -------------------------------------------------------------------------------- /Matlab/test/QuantBox_Queue_x86.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Matlab/test/QuantBox_Queue_x86.dll -------------------------------------------------------------------------------- /Matlab/test/msvcp120.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Matlab/test/msvcp120.dll -------------------------------------------------------------------------------- /Matlab/test/msvcp120d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Matlab/test/msvcp120d.dll -------------------------------------------------------------------------------- /Matlab/test/msvcr120.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Matlab/test/msvcr120.dll -------------------------------------------------------------------------------- /Matlab/test/msvcr120d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Matlab/test/msvcr120d.dll -------------------------------------------------------------------------------- /Matlab/test/test.asv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Matlab/test/test.asv -------------------------------------------------------------------------------- /Matlab/test/test.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Matlab/test/test.m -------------------------------------------------------------------------------- /Matlab/test/thostmduserapi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Matlab/test/thostmduserapi.dll -------------------------------------------------------------------------------- /Matlab/test/thosttraderapi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Matlab/test/thosttraderapi.dll -------------------------------------------------------------------------------- /Python/base/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | __author__ = 'Chunyou' -------------------------------------------------------------------------------- /Python/include/LTS/SecurityFtdcMdApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Python/include/LTS/SecurityFtdcMdApi.h -------------------------------------------------------------------------------- /Python/include/LTS/SecurityFtdcTraderApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Python/include/LTS/SecurityFtdcTraderApi.h -------------------------------------------------------------------------------- /Python/include/LTS/SecurityFtdcUserApiDataType.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Python/include/LTS/SecurityFtdcUserApiDataType.h -------------------------------------------------------------------------------- /Python/include/LTS/SecurityFtdcUserApiStruct.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Python/include/LTS/SecurityFtdcUserApiStruct.h -------------------------------------------------------------------------------- /Python/include/LTS/linux64/libsecuritymduserapi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Python/include/LTS/linux64/libsecuritymduserapi.so -------------------------------------------------------------------------------- /Python/include/LTS/linux64/libsecuritytraderapi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/Python/include/LTS/linux64/libsecuritytraderapi.so -------------------------------------------------------------------------------- /Python/include/LTS/version.txt: -------------------------------------------------------------------------------- 1 | 20150402 -------------------------------------------------------------------------------- /Python/logger/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | __author__ = 'Chunyou' -------------------------------------------------------------------------------- /Python/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | __author__ = 'Chunyou' -------------------------------------------------------------------------------- /QuantBox_CTP_Quote/MdUserApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_CTP_Quote/MdUserApi.h -------------------------------------------------------------------------------- /QuantBox_CTP_Quote/QuantBox_CTP_Quote.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | C:\Program Files\SmartQuant Ltd\OpenQuant 2014\OpenQuant.x86.exe 5 | WindowsLocalDebugger 6 | 7 | 8 | C:\Program Files\SmartQuant Ltd\OpenQuant 2014\OpenQuant.x86.exe 9 | WindowsLocalDebugger 10 | 11 | 12 | C:\Program Files\SmartQuant Ltd\OpenQuant 2014\OpenQuant.x86.exe 13 | WindowsLocalDebugger 14 | 15 | 16 | C:\Program Files\SmartQuant Ltd\OpenQuant 2014\OpenQuant.x64.exe 17 | WindowsLocalDebugger 18 | 19 | -------------------------------------------------------------------------------- /QuantBox_CTP_Quote/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /QuantBox_CTP_Quote/main.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "../include/ApiHeader.h" 3 | 4 | #include "../include/QueueEnum.h" 5 | #include "MdUserApi.h" 6 | 7 | inline CMdUserApi* GetApi(void* pApi) 8 | { 9 | return static_cast(pApi); 10 | } 11 | 12 | void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) 13 | { 14 | RequestType rt = (RequestType)type; 15 | switch (rt) 16 | { 17 | case GetApiType: 18 | return (void*)(ApiType::MarketData | ApiType::QuoteRequest); 19 | case GetApiVersion: 20 | return (void*)"0.2.0.20150226"; 21 | case GetApiName: 22 | return (void*)"CTP"; 23 | case Create: 24 | return new CMdUserApi(); 25 | default: 26 | break; 27 | } 28 | 29 | if (pApi1 == nullptr) 30 | { 31 | return nullptr; 32 | } 33 | 34 | CMdUserApi* pApi = GetApi(pApi1); 35 | 36 | switch (rt) 37 | { 38 | case Release: 39 | delete pApi; 40 | return 0; 41 | case Register: 42 | pApi->Register(ptr1,ptr2); 43 | break; 44 | case Config: 45 | return (void*)pApi->Config((ConfigInfoField*)ptr1); 46 | case Connect: 47 | pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2,size2); 48 | break; 49 | case Disconnect: 50 | pApi->Disconnect(); 51 | break; 52 | case Subscribe: 53 | pApi->Subscribe((const char*)ptr1, (const char*)ptr2); 54 | break; 55 | case Unsubscribe: 56 | pApi->Unsubscribe((const char*)ptr1, (const char*)ptr2); 57 | break; 58 | case SubscribeQuote: 59 | pApi->SubscribeQuote((const char*)ptr1, (const char*)ptr2); 60 | break; 61 | case UnsubscribeQuote: 62 | pApi->UnsubscribeQuote((const char*)ptr1, (const char*)ptr2); 63 | break; 64 | default: 65 | break; 66 | } 67 | 68 | return pApi1; 69 | } 70 | -------------------------------------------------------------------------------- /QuantBox_CTP_Quote/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // QuantBox_CTP_Quote.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /QuantBox_CTP_Quote/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | //#include "targetver.h" 9 | // 10 | //#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | //// Windows Header Files: 12 | //#include 13 | 14 | // TODO: reference additional headers your program requires here 15 | #if defined _WIN32 || WIN32 || _WINDOWS 16 | #include "targetver.h" 17 | 18 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 19 | // Windows Header Files: 20 | #include 21 | #else 22 | 23 | #endif // defined 24 | -------------------------------------------------------------------------------- /QuantBox_CTP_Quote/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /QuantBox_CTP_Trade/TraderApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_CTP_Trade/TraderApi.h -------------------------------------------------------------------------------- /QuantBox_CTP_Trade/TypeConvert.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../include/CTP/ThostFtdcUserApiDataType.h" 4 | #include "../include/CTP/ThostFtdcUserApiStruct.h" 5 | #include "../include/ApiStruct.h" 6 | 7 | 8 | PutCall TThostFtdcOptionsTypeType_2_PutCall(TThostFtdcOptionsTypeType In); 9 | 10 | HedgeFlagType TThostFtdcHedgeFlagType_2_HedgeFlagType(TThostFtdcHedgeFlagType In); 11 | TThostFtdcHedgeFlagType HedgeFlagType_2_TThostFtdcHedgeFlagType(HedgeFlagType In); 12 | 13 | TThostFtdcOffsetFlagType OpenCloseType_2_TThostFtdcOffsetFlagType(OpenCloseType In); 14 | OpenCloseType TThostFtdcOffsetFlagType_2_OpenCloseType(TThostFtdcOffsetFlagType In); 15 | 16 | TThostFtdcDirectionType OrderSide_2_TThostFtdcDirectionType(OrderSide In); 17 | OrderSide TThostFtdcDirectionType_2_OrderSide(TThostFtdcDirectionType In); 18 | PositionSide TThostFtdcPosiDirectionType_2_PositionSide(TThostFtdcPosiDirectionType In); 19 | PositionSide TradeField_2_PositionSide(TradeField* pIn); 20 | 21 | TThostFtdcOrderPriceTypeType OrderType_2_TThostFtdcOrderPriceTypeType(OrderType In); 22 | 23 | OrderType CThostFtdcOrderField_2_OrderType(CThostFtdcOrderField* pIn); 24 | TimeInForce CThostFtdcOrderField_2_TimeInForce(CThostFtdcOrderField* pIn); 25 | 26 | OrderStatus CThostFtdcOrderField_2_OrderStatus(CThostFtdcOrderField* pIn); 27 | ExecType CThostFtdcOrderField_2_ExecType(CThostFtdcOrderField* pIn); 28 | 29 | OrderStatus CThostFtdcQuoteField_2_OrderStatus(CThostFtdcQuoteField* pIn); 30 | ExecType CThostFtdcQuoteField_2_ExecType(CThostFtdcQuoteField* pIn); 31 | 32 | InstrumentType CThostFtdcInstrumentField_2_InstrumentType(CThostFtdcInstrumentField* pIn); 33 | 34 | IdCardType TThostFtdcIdCardTypeType_2_IdCardType(TThostFtdcIdCardTypeType In); 35 | 36 | ExchangeType TThostFtdcExchangeIDType_2_ExchangeType(TThostFtdcExchangeIDType In); 37 | -------------------------------------------------------------------------------- /QuantBox_CTP_Trade/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /QuantBox_CTP_Trade/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // QuantBox_CTP_Trade.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /QuantBox_CTP_Trade/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | //#include "targetver.h" 9 | // 10 | //#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | //// Windows Header Files: 12 | //#include 13 | 14 | // TODO: reference additional headers your program requires here 15 | #if defined _WIN32 || WIN32 || _WINDOWS 16 | #include "targetver.h" 17 | 18 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 19 | // Windows Header Files: 20 | #include 21 | #else 22 | 23 | #endif // defined 24 | -------------------------------------------------------------------------------- /QuantBox_CTP_Trade/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /QuantBox_DFITC_Level2/Level2UserApi.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_DFITC_Level2/Level2UserApi.cpp -------------------------------------------------------------------------------- /QuantBox_DFITC_Level2/Level2UserApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_DFITC_Level2/Level2UserApi.h -------------------------------------------------------------------------------- /QuantBox_DFITC_Level2/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /QuantBox_DFITC_Level2/main.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "../include/ApiHeader.h" 3 | 4 | #include "../include/QueueEnum.h" 5 | #include "Level2UserApi.h" 6 | 7 | inline CLevel2UserApi* GetApi(void* pApi) 8 | { 9 | return static_cast(pApi); 10 | } 11 | 12 | void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) 13 | { 14 | RequestType rt = (RequestType)type; 15 | switch (rt) 16 | { 17 | case GetApiType: 18 | return (void*)(ApiType::MarketData | ApiType::Level2); 19 | case GetApiVersion: 20 | return (void*)"0.3.0.20150407"; 21 | case GetApiName: 22 | return (void*)"DFITC_Level2"; 23 | case Create: 24 | return new CLevel2UserApi(); 25 | default: 26 | break; 27 | } 28 | 29 | if (pApi1 == nullptr) 30 | { 31 | return nullptr; 32 | } 33 | 34 | CLevel2UserApi* pApi = GetApi(pApi1); 35 | 36 | switch (rt) 37 | { 38 | case Release: 39 | delete pApi; 40 | return nullptr; 41 | case Register: 42 | pApi->Register(ptr1, ptr2); 43 | break; 44 | case Connect: 45 | pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2); 46 | break; 47 | case Disconnect: 48 | pApi->Disconnect(); 49 | break; 50 | case Subscribe: 51 | if (ptr1 == nullptr) 52 | { 53 | pApi->SubscribeAll(); 54 | } 55 | else 56 | { 57 | pApi->Subscribe((const char*)ptr1, (const char*)ptr2); 58 | } 59 | break; 60 | case Unsubscribe: 61 | if (ptr1 == nullptr) 62 | { 63 | pApi->UnsubscribeAll(); 64 | } 65 | else 66 | { 67 | pApi->Unsubscribe((const char*)ptr1, (const char*)ptr2); 68 | } 69 | break; 70 | //case SubscribeQuote: 71 | // pApi->SubscribeQuote((const char*)ptr1, (const char*)ptr2); 72 | // break; 73 | //case UnsubscribeQuote: 74 | // pApi->UnsubscribeQuote((const char*)ptr1, (const char*)ptr2); 75 | // break; 76 | default: 77 | break; 78 | } 79 | 80 | return pApi1; 81 | } 82 | -------------------------------------------------------------------------------- /QuantBox_DFITC_Level2/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // QuantBox_DFITC_Level2.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /QuantBox_DFITC_Level2/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | //#include "targetver.h" 9 | // 10 | //#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | //// Windows Header Files: 12 | //#include 13 | 14 | // TODO: reference additional headers your program requires here 15 | #if defined _WIN32 || WIN32 || _WINDOWS 16 | #include "targetver.h" 17 | 18 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 19 | // Windows Header Files: 20 | #include 21 | #else 22 | 23 | #endif // defined 24 | -------------------------------------------------------------------------------- /QuantBox_DFITC_Level2/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /QuantBox_Esunny_HistoricalData/HistoricalDataApi.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_Esunny_HistoricalData/HistoricalDataApi.cpp -------------------------------------------------------------------------------- /QuantBox_Esunny_HistoricalData/HistoricalDataApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_Esunny_HistoricalData/HistoricalDataApi.h -------------------------------------------------------------------------------- /QuantBox_Esunny_HistoricalData/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /QuantBox_Esunny_HistoricalData/main.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "../include/ApiHeader.h" 3 | #include "../include/QueueEnum.h" 4 | #include "HistoricalDataApi.h" 5 | 6 | inline CHistoricalDataApi* GetApi(void* pApi) 7 | { 8 | return static_cast(pApi); 9 | } 10 | 11 | void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) 12 | { 13 | RequestType rt = (RequestType)type; 14 | switch (rt) 15 | { 16 | case GetApiType: 17 | return (void*)(ApiType::HistoricalData | ApiType::Instrument); 18 | case GetApiVersion: 19 | return (void*)"0.3.0.20150407"; 20 | case GetApiName: 21 | return (void*)"Esunny"; 22 | case Create: 23 | return new CHistoricalDataApi(); 24 | default: 25 | break; 26 | } 27 | 28 | if (pApi1 == nullptr) 29 | { 30 | return nullptr; 31 | } 32 | 33 | CHistoricalDataApi* pApi = GetApi(pApi1); 34 | 35 | switch (rt) 36 | { 37 | case Release: 38 | delete pApi; 39 | return nullptr; 40 | case Register: 41 | pApi->Register(ptr1, ptr2); 42 | break; 43 | case Connect: 44 | pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2); 45 | break; 46 | case Disconnect: 47 | pApi->Disconnect(); 48 | break; 49 | case ReqQryHistoricalTicks: 50 | return (void*)pApi->ReqQryHistoricalTicks((HistoricalDataRequestField*)ptr1); 51 | case ReqQryHistoricalBars: 52 | return (void*)pApi->ReqQryHistoricalBars((HistoricalDataRequestField*)ptr1); 53 | default: 54 | break; 55 | } 56 | 57 | return pApi1; 58 | } 59 | -------------------------------------------------------------------------------- /QuantBox_Esunny_HistoricalData/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // QuantBox_Esunny_HistoricalData.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /QuantBox_Esunny_HistoricalData/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | // Windows Header Files: 12 | #include 13 | 14 | 15 | 16 | // TODO: reference additional headers your program requires here 17 | -------------------------------------------------------------------------------- /QuantBox_Esunny_HistoricalData/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /QuantBox_Femas_Quote/MdUserApi.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_Femas_Quote/MdUserApi.cpp -------------------------------------------------------------------------------- /QuantBox_Femas_Quote/MdUserApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_Femas_Quote/MdUserApi.h -------------------------------------------------------------------------------- /QuantBox_Femas_Quote/QuantBox_Femas_Quote.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | C:\Program Files\SmartQuant Ltd\OpenQuant 2014\OpenQuant.x86.exe 5 | WindowsLocalDebugger 6 | 7 | -------------------------------------------------------------------------------- /QuantBox_Femas_Quote/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /QuantBox_Femas_Quote/main.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "../include/ApiHeader.h" 3 | 4 | #include "../include/QueueEnum.h" 5 | #include "MdUserApi.h" 6 | 7 | inline CMdUserApi* GetApi(void* pApi) 8 | { 9 | return static_cast(pApi); 10 | } 11 | 12 | void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) 13 | { 14 | RequestType rt = (RequestType)type; 15 | switch (rt) 16 | { 17 | case GetApiType: 18 | return (void*)(ApiType::MarketData | ApiType::Level2); 19 | case GetApiVersion: 20 | return (void*)"0.3.0.20150407"; 21 | case GetApiName: 22 | return (void*)"Femas"; 23 | case Create: 24 | return new CMdUserApi(); 25 | default: 26 | break; 27 | } 28 | 29 | if (pApi1 == nullptr) 30 | { 31 | return nullptr; 32 | } 33 | 34 | CMdUserApi* pApi = GetApi(pApi1); 35 | 36 | switch (rt) 37 | { 38 | case Release: 39 | delete pApi; 40 | return nullptr; 41 | case Register: 42 | pApi->Register(ptr1, ptr2); 43 | break; 44 | case Config: 45 | return (void*)pApi->Config((ConfigInfoField*)ptr1); 46 | break; 47 | case Connect: 48 | pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2); 49 | break; 50 | case Disconnect: 51 | pApi->Disconnect(); 52 | break; 53 | case Subscribe: 54 | pApi->Subscribe((const char*)ptr1, (const char*)ptr2); 55 | break; 56 | case Unsubscribe: 57 | pApi->Unsubscribe((const char*)ptr1, (const char*)ptr2); 58 | break; 59 | //case SubscribeQuote: 60 | // pApi->SubscribeQuote((const char*)ptr1, (const char*)ptr2); 61 | // break; 62 | //case UnsubscribeQuote: 63 | // pApi->UnsubscribeQuote((const char*)ptr1, (const char*)ptr2); 64 | // break; 65 | default: 66 | // 通知 67 | break; 68 | } 69 | 70 | return pApi1; 71 | } 72 | -------------------------------------------------------------------------------- /QuantBox_Femas_Quote/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // QuantBox_Femas_Quote.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /QuantBox_Femas_Quote/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | //#include "targetver.h" 9 | // 10 | //#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | //// Windows Header Files: 12 | //#include 13 | 14 | // TODO: reference additional headers your program requires here 15 | #if defined _WIN32 || WIN32 || _WINDOWS 16 | #include "targetver.h" 17 | 18 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 19 | // Windows Header Files: 20 | #include 21 | #else 22 | 23 | #endif // defined 24 | -------------------------------------------------------------------------------- /QuantBox_Femas_Quote/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /QuantBox_Femas_Trade/QuantBox_Femas_Trade.def: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_Femas_Trade/QuantBox_Femas_Trade.def -------------------------------------------------------------------------------- /QuantBox_Femas_Trade/QuantBox_Femas_Trade.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | C:\Program Files\SmartQuant Ltd\OpenQuant 2014\OpenQuant.x86.exe 5 | WindowsLocalDebugger 6 | 7 | -------------------------------------------------------------------------------- /QuantBox_Femas_Trade/TraderApi.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_Femas_Trade/TraderApi.cpp -------------------------------------------------------------------------------- /QuantBox_Femas_Trade/TraderApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_Femas_Trade/TraderApi.h -------------------------------------------------------------------------------- /QuantBox_Femas_Trade/TypeConvert.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_Femas_Trade/TypeConvert.cpp -------------------------------------------------------------------------------- /QuantBox_Femas_Trade/TypeConvert.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../include/Femas/USTPFtdcUserApiDataType.h" 4 | #include "../include/Femas/USTPFtdcUserApiStruct.h" 5 | #include "../include/ApiStruct.h" 6 | 7 | 8 | PutCall TUstpFtdcOptionsTypeType_2_PutCall(TUstpFtdcOptionsTypeType In); 9 | 10 | HedgeFlagType TUstpFtdcHedgeFlagType_2_HedgeFlagType(TUstpFtdcHedgeFlagType In); 11 | TUstpFtdcHedgeFlagType HedgeFlagType_2_TUstpFtdcHedgeFlagType(HedgeFlagType In); 12 | 13 | TUstpFtdcOffsetFlagType OpenCloseType_2_TUstpFtdcOffsetFlagType(OpenCloseType In); 14 | OpenCloseType TUstpFtdcOffsetFlagType_2_OpenCloseType(TUstpFtdcOffsetFlagType In); 15 | 16 | TUstpFtdcDirectionType OrderSide_2_TUstpFtdcDirectionType(OrderSide In); 17 | OrderSide TUstpFtdcDirectionType_2_OrderSide(TUstpFtdcDirectionType In); 18 | PositionSide TUstpFtdcDirectionType_2_PositionSide(TUstpFtdcDirectionType In); 19 | 20 | TUstpFtdcOrderPriceTypeType OrderType_2_TUstpFtdcOrderPriceTypeType(OrderType In); 21 | 22 | OrderType CUstpFtdcOrderField_2_OrderType(CUstpFtdcOrderField* pIn); 23 | TimeInForce CUstpFtdcOrderField_2_TimeInForce(CUstpFtdcOrderField* pIn); 24 | 25 | OrderStatus CUstpFtdcOrderField_2_OrderStatus(CUstpFtdcOrderField* pIn); 26 | ExecType CUstpFtdcOrderField_2_ExecType(CUstpFtdcOrderField* pIn); 27 | 28 | //OrderStatus CUstpFtdcRtnQuoteField_2_OrderStatus(CUstpFtdcRtnQuoteField* pIn); 29 | //ExecType CUstpFtdcRtnQuoteField_2_ExecType(CUstpFtdcRtnQuoteField* pIn); 30 | 31 | InstrumentType CUstpFtdcRspInstrumentField_2_InstrumentType(CUstpFtdcRspInstrumentField* pIn); 32 | -------------------------------------------------------------------------------- /QuantBox_Femas_Trade/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /QuantBox_Femas_Trade/main.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "../include/ApiHeader.h" 3 | #include "../include/QueueEnum.h" 4 | #include "TraderApi.h" 5 | 6 | inline CTraderApi* GetApi(void* pApi) 7 | { 8 | return static_cast(pApi); 9 | } 10 | 11 | void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) 12 | { 13 | RequestType rt = (RequestType)type; 14 | switch (rt) 15 | { 16 | case GetApiType: 17 | return (void*)(ApiType::Trade | ApiType::Instrument); 18 | case GetApiVersion: 19 | return (void*)"0.3.0.20150407"; 20 | case GetApiName: 21 | return (void*)"Femas"; 22 | case Create: 23 | return new CTraderApi(); 24 | default: 25 | break; 26 | } 27 | 28 | if (pApi1 == nullptr) 29 | { 30 | return nullptr; 31 | } 32 | 33 | CTraderApi* pApi = GetApi(pApi1); 34 | 35 | switch (rt) 36 | { 37 | case Release: 38 | delete pApi; 39 | return nullptr; 40 | case Register: 41 | pApi->Register(ptr1, ptr2); 42 | break; 43 | case Connect: 44 | pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2); 45 | break; 46 | case Disconnect: 47 | pApi->Disconnect(); 48 | break; 49 | case ReqQryInstrument: 50 | pApi->ReqQryInstrument((const char*)ptr1, (const char*)ptr2); 51 | break; 52 | case ReqQryTradingAccount: 53 | pApi->ReqQryInvestorAccount(); 54 | break; 55 | case ReqOrderInsert: 56 | return (void*)pApi->ReqOrderInsert((OrderField*)ptr1, size1, (OrderIDType*)ptr2); 57 | //case ReqQuoteInsert: 58 | // return pApi->ReqQuoteInsert((int)double1, (OrderField*)ptr1, (OrderField*)ptr2); 59 | case ReqOrderAction: 60 | return (void*)pApi->ReqOrderAction((OrderIDType*)ptr1, size1, (OrderIDType*)ptr2); 61 | //case RequestType::SubscribeQuote: 62 | // pApi->ReqQuoteSubscribe((const char*)ptr2, DFITC_OPT_TYPE); 63 | // break; 64 | //case RequestType::UnsubscribeQuote: 65 | // pApi->ReqQuoteUnSubscribe((const char*)ptr2, DFITC_OPT_TYPE); 66 | // break; 67 | default: 68 | // 通知 69 | break; 70 | } 71 | 72 | return pApi1; 73 | } 74 | -------------------------------------------------------------------------------- /QuantBox_Femas_Trade/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // QuantBox_Femas_Trade.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /QuantBox_Femas_Trade/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | //#include "targetver.h" 9 | // 10 | //#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | //// Windows Header Files: 12 | //#include 13 | 14 | // TODO: reference additional headers your program requires here 15 | #if defined _WIN32 || WIN32 || _WINDOWS 16 | #include "targetver.h" 17 | 18 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 19 | // Windows Header Files: 20 | #include 21 | #else 22 | 23 | #endif // defined 24 | -------------------------------------------------------------------------------- /QuantBox_Femas_Trade/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /QuantBox_KingstarGold/TraderApi.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_KingstarGold/TraderApi.cpp -------------------------------------------------------------------------------- /QuantBox_KingstarGold/TraderApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_KingstarGold/TraderApi.h -------------------------------------------------------------------------------- /QuantBox_KingstarGold/TypeConvert.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_KingstarGold/TypeConvert.cpp -------------------------------------------------------------------------------- /QuantBox_KingstarGold/TypeConvert.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../include/Kingstar_Gold/KSUserApiDataTypeEx.h" 4 | #include "../include/Kingstar_Gold/KSUserApiStructEx.h" 5 | #include "../include/Kingstar_Gold/Constant.h" 6 | #include "../include/ApiStruct.h" 7 | 8 | 9 | //PutCall TThostFtdcOptionsTypeType_2_PutCall(TThostFtdcOptionsTypeType In); 10 | 11 | HedgeFlagType TThostFtdcHedgeFlagType_2_HedgeFlagType(TThostFtdcHedgeFlagType In); 12 | TThostFtdcHedgeFlagType HedgeFlagType_2_TThostFtdcHedgeFlagType(HedgeFlagType In); 13 | 14 | TThostFtdcOffsetFlagType OpenCloseType_2_TThostFtdcOffsetFlagType(OpenCloseType In); 15 | OpenCloseType TThostFtdcOffsetFlagType_2_OpenCloseType(TThostFtdcOffsetFlagType In); 16 | 17 | TThostFtdcBsFlagType OrderSide_2_TThostFtdcBsFlagType(OrderSide In); 18 | OrderSide TThostFtdcDirectionType_2_OrderSide(TThostFtdcDirectionType In); 19 | PositionSide TThostFtdcPosiDirectionType_2_PositionSide(TThostFtdcPosiDirectionType In); 20 | 21 | TThostFtdcOrderPriceTypeType OrderType_2_TThostFtdcOrderPriceTypeType(OrderType In); 22 | 23 | OrderStatus CThostFtdcOrderField_2_OrderStatus(CThostFtdcOrderField* pIn); 24 | OrderType CThostFtdcOrderField_2_OrderType(CThostFtdcOrderField* pIn); 25 | TimeInForce CThostFtdcOrderField_2_TimeInForce(CThostFtdcOrderField* pIn); 26 | ExecType CThostFtdcOrderField_2_ExecType(CThostFtdcOrderField* pIn); 27 | 28 | InstrumentType CThostFtdcInstrumentField_2_InstrumentType(CThostFtdcInstrumentField* pIn); 29 | -------------------------------------------------------------------------------- /QuantBox_KingstarGold/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /QuantBox_KingstarGold/main.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "../include/ApiHeader.h" 3 | #include "../include/QueueEnum.h" 4 | #include "TraderApi.h" 5 | 6 | inline CTraderApi* GetApi(void* pApi) 7 | { 8 | return static_cast(pApi); 9 | } 10 | 11 | void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) 12 | { 13 | RequestType rt = (RequestType)type; 14 | switch (rt) 15 | { 16 | case GetApiType: 17 | return (void*)(ApiType::Trade | ApiType::MarketData | ApiType::Instrument); 18 | case GetApiVersion: 19 | return (void*)"0.3.0.20150407"; 20 | case GetApiName: 21 | return (void*)"KingstarGold"; 22 | case Create: 23 | return new CTraderApi(); 24 | default: 25 | break; 26 | } 27 | 28 | if (pApi1 == nullptr) 29 | { 30 | return nullptr; 31 | } 32 | 33 | CTraderApi* pApi = GetApi(pApi1); 34 | 35 | switch (rt) 36 | { 37 | case Release: 38 | delete pApi; 39 | return nullptr; 40 | case Register: 41 | pApi->Register(ptr1, ptr2); 42 | break; 43 | case Connect: 44 | pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2); 45 | break; 46 | case Disconnect: 47 | pApi->Disconnect(); 48 | break; 49 | case Subscribe: 50 | pApi->Subscribe((const char*)ptr1, (const char*)ptr2); 51 | break; 52 | case Unsubscribe: 53 | pApi->Unsubscribe((const char*)ptr1, (const char*)ptr2); 54 | break; 55 | case ReqQryInstrument: 56 | pApi->ReqQryInstrument((const char*)ptr1, (const char*)ptr2); 57 | break; 58 | case ReqQryTradingAccount: 59 | pApi->ReqQryTradingAccount(); 60 | break; 61 | //case ReqQrySettlementInfo: 62 | // pApi->ReqQrySettlementInfo((const char*)ptr1); 63 | // break; 64 | case ReqOrderInsert: 65 | return (void*)pApi->ReqOrderInsert((OrderField*)ptr1, size1, (OrderIDType*)ptr2); 66 | case ReqOrderAction: 67 | return (void*)pApi->ReqOrderAction((OrderIDType*)ptr1, size1, (OrderIDType*)ptr2); 68 | break; 69 | default: 70 | break; 71 | } 72 | 73 | return pApi1; 74 | } 75 | -------------------------------------------------------------------------------- /QuantBox_KingstarGold/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // QuantBox_KingstarGold.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /QuantBox_KingstarGold/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | // Windows Header Files: 12 | #include 13 | 14 | 15 | 16 | // TODO: reference additional headers your program requires here 17 | -------------------------------------------------------------------------------- /QuantBox_KingstarGold/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /QuantBox_KingstarStock_Trade/QuantBox_KingstarStock_Trade.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | Header Files 35 | 36 | 37 | 38 | 39 | Source Files 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | Source Files 55 | 56 | 57 | -------------------------------------------------------------------------------- /QuantBox_KingstarStock_Trade/TraderApi.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_KingstarStock_Trade/TraderApi.cpp -------------------------------------------------------------------------------- /QuantBox_KingstarStock_Trade/TraderApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_KingstarStock_Trade/TraderApi.h -------------------------------------------------------------------------------- /QuantBox_KingstarStock_Trade/TypeConvert.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_KingstarStock_Trade/TypeConvert.cpp -------------------------------------------------------------------------------- /QuantBox_KingstarStock_Trade/TypeConvert.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../include/Kingstar_Stock/SPXAPI_struct.h" 4 | #include "../include/ApiStruct.h" 5 | #include 6 | 7 | //PutCall TThostFtdcOptionsTypeType_2_PutCall(TThostFtdcOptionsTypeType In); 8 | 9 | //HedgeFlagType TThostFtdcHedgeFlagType_2_HedgeFlagType(TThostFtdcHedgeFlagType In); 10 | //TThostFtdcHedgeFlagType HedgeFlagType_2_TThostFtdcHedgeFlagType(HedgeFlagType In); 11 | // 12 | //TThostFtdcOffsetFlagType OpenCloseType_2_TThostFtdcOffsetFlagType(OpenCloseType In); 13 | //OpenCloseType TThostFtdcOffsetFlagType_2_OpenCloseType(TThostFtdcOffsetFlagType In); 14 | 15 | void OrderField_2_TBSType(OrderField* pIn, PSTOrder pOut); 16 | OrderSide TBSFLAG_2_OrderSide(TBSFLAG In); 17 | void OrderField_2_TMarketOrderFlagType(OrderField* pIn, PSTOrder pOut); 18 | TMarketCodeType OrderField_2_TMarketCodeType(OrderField* pIn); 19 | 20 | //OrderSide TThostFtdcDirectionType_2_OrderSide(TThostFtdcDirectionType In); 21 | //PositionSide TThostFtdcPosiDirectionType_2_PositionSide(TThostFtdcPosiDirectionType In); 22 | //PositionSide TradeField_2_PositionSide(TradeField* pIn); 23 | // 24 | //TThostFtdcOrderPriceTypeType OrderType_2_TThostFtdcOrderPriceTypeType(OrderType In); 25 | // 26 | //OrderType CThostFtdcOrderField_2_OrderType(CThostFtdcOrderField* pIn); 27 | //TimeInForce CThostFtdcOrderField_2_TimeInForce(CThostFtdcOrderField* pIn); 28 | // 29 | OrderStatus TOrderStatusType_2_OrderStatus(TOrderStatusType In); 30 | ExecType TOrderStatusType_2_ExecType(TOrderStatusType In); 31 | // 32 | //OrderStatus CThostFtdcQuoteField_2_OrderStatus(CThostFtdcQuoteField* pIn); 33 | //ExecType CThostFtdcQuoteField_2_ExecType(CThostFtdcQuoteField* pIn); 34 | // 35 | //InstrumentType CThostFtdcInstrumentField_2_InstrumentType(CThostFtdcInstrumentField* pIn); 36 | -------------------------------------------------------------------------------- /QuantBox_KingstarStock_Trade/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /QuantBox_KingstarStock_Trade/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // QuantBox_KingstarStock_Trade.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /QuantBox_KingstarStock_Trade/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | // Windows Header Files: 12 | #include 13 | 14 | 15 | 16 | // TODO: reference additional headers your program requires here 17 | -------------------------------------------------------------------------------- /QuantBox_KingstarStock_Trade/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /QuantBox_Kingstar_Quote/MdUserApi.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_Kingstar_Quote/MdUserApi.cpp -------------------------------------------------------------------------------- /QuantBox_Kingstar_Quote/MdUserApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_Kingstar_Quote/MdUserApi.h -------------------------------------------------------------------------------- /QuantBox_Kingstar_Quote/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /QuantBox_Kingstar_Quote/main.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "../include/ApiHeader.h" 3 | 4 | #include "../include/QueueEnum.h" 5 | #include "MdUserApi.h" 6 | 7 | inline CMdUserApi* GetApi(void* pApi) 8 | { 9 | return static_cast(pApi); 10 | } 11 | 12 | void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) 13 | { 14 | RequestType rt = (RequestType)type; 15 | switch (rt) 16 | { 17 | case GetApiType: 18 | return (void*)(ApiType::MarketData | ApiType::QuoteRequest); 19 | case GetApiVersion: 20 | return (void*)"0.3.0.20150407"; 21 | case GetApiName: 22 | return (void*)"Kingstar"; 23 | case Create: 24 | return new CMdUserApi(); 25 | default: 26 | break; 27 | } 28 | 29 | if (pApi1 == nullptr) 30 | { 31 | return nullptr; 32 | } 33 | 34 | CMdUserApi* pApi = GetApi(pApi1); 35 | 36 | switch (rt) 37 | { 38 | case Release: 39 | delete pApi; 40 | return 0; 41 | case Register: 42 | pApi->Register(ptr1, ptr2); 43 | break; 44 | case Config: 45 | return (void*)pApi->Config((ConfigInfoField*)ptr1); 46 | case Connect: 47 | pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2, size2); 48 | break; 49 | case Disconnect: 50 | pApi->Disconnect(); 51 | break; 52 | case Subscribe: 53 | pApi->Subscribe((const char*)ptr1, (const char*)ptr2); 54 | break; 55 | case Unsubscribe: 56 | pApi->Unsubscribe((const char*)ptr1, (const char*)ptr2); 57 | break; 58 | case SubscribeQuote: 59 | pApi->SubscribeQuote((const char*)ptr1, (const char*)ptr2); 60 | break; 61 | case UnsubscribeQuote: 62 | pApi->UnsubscribeQuote((const char*)ptr1, (const char*)ptr2); 63 | break; 64 | default: 65 | break; 66 | } 67 | 68 | return pApi1; 69 | } 70 | -------------------------------------------------------------------------------- /QuantBox_Kingstar_Quote/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // QuantBox_Kingstar_Quote.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /QuantBox_Kingstar_Quote/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | // Windows Header Files: 12 | #include 13 | 14 | 15 | 16 | // TODO: reference additional headers your program requires here 17 | -------------------------------------------------------------------------------- /QuantBox_Kingstar_Quote/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /QuantBox_Kingstar_Trade/QuantBox_Kingstar_Trade.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | Header Files 35 | 36 | 37 | 38 | 39 | Source Files 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | Source Files 55 | 56 | 57 | -------------------------------------------------------------------------------- /QuantBox_Kingstar_Trade/TraderApi.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_Kingstar_Trade/TraderApi.cpp -------------------------------------------------------------------------------- /QuantBox_Kingstar_Trade/TraderApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_Kingstar_Trade/TraderApi.h -------------------------------------------------------------------------------- /QuantBox_Kingstar_Trade/TypeConvert.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../include/Kingstar/IncEx/KSUserApiDataTypeEx.h" 4 | #include "../include/Kingstar/IncEx/KSUserApiStructEx.h" 5 | #include "../include/ApiStruct.h" 6 | 7 | using namespace KingstarAPI; 8 | 9 | PutCall TThostFtdcOptionsTypeType_2_PutCall(TThostFtdcOptionsTypeType In); 10 | 11 | HedgeFlagType TThostFtdcHedgeFlagType_2_HedgeFlagType(TThostFtdcHedgeFlagType In); 12 | TThostFtdcHedgeFlagType HedgeFlagType_2_TThostFtdcHedgeFlagType(HedgeFlagType In); 13 | 14 | TThostFtdcOffsetFlagType OpenCloseType_2_TThostFtdcOffsetFlagType(OpenCloseType In); 15 | OpenCloseType TThostFtdcOffsetFlagType_2_OpenCloseType(TThostFtdcOffsetFlagType In); 16 | 17 | TThostFtdcDirectionType OrderSide_2_TThostFtdcDirectionType(OrderSide In); 18 | OrderSide TThostFtdcDirectionType_2_OrderSide(TThostFtdcDirectionType In); 19 | PositionSide TThostFtdcPosiDirectionType_2_PositionSide(TThostFtdcPosiDirectionType In); 20 | PositionSide TradeField_2_PositionSide(TradeField* pIn); 21 | 22 | TThostFtdcOrderPriceTypeType OrderType_2_TThostFtdcOrderPriceTypeType(OrderType In); 23 | 24 | OrderType CThostFtdcOrderField_2_OrderType(CThostFtdcOrderField* pIn); 25 | TimeInForce CThostFtdcOrderField_2_TimeInForce(CThostFtdcOrderField* pIn); 26 | 27 | OrderStatus CThostFtdcOrderField_2_OrderStatus(CThostFtdcOrderField* pIn); 28 | ExecType CThostFtdcOrderField_2_ExecType(CThostFtdcOrderField* pIn); 29 | 30 | OrderStatus CThostFtdcQuoteField_2_OrderStatus(CThostFtdcQuoteField* pIn); 31 | ExecType CThostFtdcQuoteField_2_ExecType(CThostFtdcQuoteField* pIn); 32 | 33 | InstrumentType CThostFtdcInstrumentField_2_InstrumentType(CThostFtdcInstrumentField* pIn); 34 | 35 | IdCardType TThostFtdcIdCardTypeType_2_IdCardType(TThostFtdcIdCardTypeType In); 36 | 37 | ExchangeType TThostFtdcExchangeIDType_2_ExchangeType(TThostFtdcExchangeIDType In); -------------------------------------------------------------------------------- /QuantBox_Kingstar_Trade/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /QuantBox_Kingstar_Trade/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // QuantBox_Kingstar_Trade.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /QuantBox_Kingstar_Trade/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | // Windows Header Files: 12 | #include 13 | 14 | 15 | 16 | // TODO: reference additional headers your program requires here 17 | -------------------------------------------------------------------------------- /QuantBox_Kingstar_Trade/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /QuantBox_LTS_Level2/Level2UserApi.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_LTS_Level2/Level2UserApi.cpp -------------------------------------------------------------------------------- /QuantBox_LTS_Level2/Level2UserApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_LTS_Level2/Level2UserApi.h -------------------------------------------------------------------------------- /QuantBox_LTS_Level2/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /QuantBox_LTS_Level2/main.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "../include/ApiHeader.h" 3 | 4 | #include "../include/QueueEnum.h" 5 | #include "Level2UserApi.h" 6 | 7 | inline CLevel2UserApi* GetApi(void* pApi) 8 | { 9 | return static_cast(pApi); 10 | } 11 | 12 | void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) 13 | { 14 | RequestType rt = (RequestType)type; 15 | switch (rt) 16 | { 17 | case GetApiType: 18 | return (void*)(ApiType::MarketData | ApiType::Level2); 19 | case GetApiVersion: 20 | return (void*)"0.4.0.20150527"; 21 | case GetApiName: 22 | return (void*)"LTS"; 23 | case Create: 24 | return new CLevel2UserApi(); 25 | default: 26 | break; 27 | } 28 | 29 | if (pApi1 == nullptr) 30 | { 31 | return nullptr; 32 | } 33 | 34 | CLevel2UserApi* pApi = GetApi(pApi1); 35 | 36 | switch (rt) 37 | { 38 | case Release: 39 | delete pApi; 40 | return nullptr; 41 | case Register: 42 | pApi->Register(ptr1,ptr2); 43 | break; 44 | case Connect: 45 | pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2); 46 | break; 47 | case Disconnect: 48 | pApi->Disconnect(); 49 | break; 50 | case Subscribe: 51 | pApi->Subscribe((const char*)ptr1, (const char*)ptr2); 52 | break; 53 | case Unsubscribe: 54 | pApi->Unsubscribe((const char*)ptr1, (const char*)ptr2); 55 | break; 56 | //case SubscribeQuote: 57 | // pApi->SubscribeQuote((const char*)ptr1, (const char*)ptr2); 58 | // break; 59 | //case UnsubscribeQuote: 60 | // pApi->UnsubscribeQuote((const char*)ptr1, (const char*)ptr2); 61 | // break; 62 | default: 63 | break; 64 | } 65 | 66 | return pApi1; 67 | } 68 | -------------------------------------------------------------------------------- /QuantBox_LTS_Level2/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // QuantBox_LTS_Level2.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /QuantBox_LTS_Level2/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | //#include "targetver.h" 9 | // 10 | //#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | //// Windows Header Files: 12 | //#include 13 | 14 | // TODO: reference additional headers your program requires here 15 | #if defined _WIN32 || WIN32 || _WINDOWS 16 | #include "targetver.h" 17 | 18 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 19 | // Windows Header Files: 20 | #include 21 | #else 22 | 23 | #endif // defined 24 | -------------------------------------------------------------------------------- /QuantBox_LTS_Level2/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /QuantBox_LTS_Quote/MdUserApi.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_LTS_Quote/MdUserApi.cpp -------------------------------------------------------------------------------- /QuantBox_LTS_Quote/MdUserApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_LTS_Quote/MdUserApi.h -------------------------------------------------------------------------------- /QuantBox_LTS_Quote/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /QuantBox_LTS_Quote/main.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "../include/ApiHeader.h" 3 | 4 | #include "../include/QueueEnum.h" 5 | #include "MdUserApi.h" 6 | 7 | inline CMdUserApi* GetApi(void* pApi) 8 | { 9 | return static_cast(pApi); 10 | } 11 | 12 | void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) 13 | { 14 | RequestType rt = (RequestType)type; 15 | switch (rt) 16 | { 17 | case GetApiType: 18 | return (void*)(ApiType::MarketData); 19 | case GetApiVersion: 20 | return (void*)"0.3.0.20150407"; 21 | case GetApiName: 22 | return (void*)"LTS"; 23 | case Create: 24 | return new CMdUserApi(); 25 | default: 26 | break; 27 | } 28 | if (pApi1 == nullptr) 29 | { 30 | return nullptr; 31 | } 32 | 33 | CMdUserApi* pApi = GetApi(pApi1); 34 | 35 | switch (rt) 36 | { 37 | case Release: 38 | delete pApi; 39 | return nullptr; 40 | case Register: 41 | pApi->Register(ptr1, ptr2); 42 | break; 43 | case Connect: 44 | pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2); 45 | break; 46 | case Disconnect: 47 | pApi->Disconnect(); 48 | break; 49 | case Subscribe: 50 | pApi->Subscribe((const char*)ptr1, (const char*)ptr2); 51 | break; 52 | case Unsubscribe: 53 | pApi->Unsubscribe((const char*)ptr1, (const char*)ptr2); 54 | break; 55 | //case SubscribeQuote: 56 | // pApi->SubscribeQuote((const char*)ptr1, (const char*)ptr2); 57 | // break; 58 | //case UnsubscribeQuote: 59 | // pApi->UnsubscribeQuote((const char*)ptr1, (const char*)ptr2); 60 | // break; 61 | default: 62 | break; 63 | } 64 | 65 | return pApi1; 66 | } 67 | -------------------------------------------------------------------------------- /QuantBox_LTS_Quote/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // QuantBox_LTS_Quote.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /QuantBox_LTS_Quote/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | //#include "targetver.h" 9 | // 10 | //#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | //// Windows Header Files: 12 | //#include 13 | 14 | // TODO: reference additional headers your program requires here 15 | #if defined _WIN32 || WIN32 || _WINDOWS 16 | #include "targetver.h" 17 | 18 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 19 | // Windows Header Files: 20 | #include 21 | #else 22 | 23 | #endif // defined 24 | -------------------------------------------------------------------------------- /QuantBox_LTS_Quote/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /QuantBox_LTS_Trade/TraderApi.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_LTS_Trade/TraderApi.cpp -------------------------------------------------------------------------------- /QuantBox_LTS_Trade/TraderApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_LTS_Trade/TraderApi.h -------------------------------------------------------------------------------- /QuantBox_LTS_Trade/TypeConvert.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_LTS_Trade/TypeConvert.cpp -------------------------------------------------------------------------------- /QuantBox_LTS_Trade/TypeConvert.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../include/LTS/SecurityFtdcUserApiDataType.h" 4 | #include "../include/LTS/SecurityFtdcUserApiStruct.h" 5 | #include "../include/ApiStruct.h" 6 | 7 | 8 | HedgeFlagType TSecurityFtdcHedgeFlagType_2_HedgeFlagType(TSecurityFtdcHedgeFlagType In); 9 | TSecurityFtdcHedgeFlagType HedgeFlagType_2_TSecurityFtdcHedgeFlagType(HedgeFlagType In); 10 | 11 | TSecurityFtdcOffsetFlagType OpenCloseType_2_TSecurityFtdcOffsetFlagType(OpenCloseType In); 12 | OpenCloseType TSecurityFtdcOffsetFlagType_2_OpenCloseType(TSecurityFtdcOffsetFlagType In); 13 | 14 | TSecurityFtdcDirectionType OrderSide_2_TSecurityFtdcDirectionType(OrderSide In); 15 | OrderSide TSecurityFtdcDirectionType_2_OrderSide(TSecurityFtdcDirectionType In); 16 | PositionSide TSecurityFtdcPosiDirectionType_2_PositionSide(TSecurityFtdcPosiDirectionType In); 17 | PositionSide TradeField_2_PositionSide(TradeField* pIn); 18 | 19 | TSecurityFtdcOrderPriceTypeType OrderType_2_TSecurityFtdcOrderPriceTypeType(OrderType In); 20 | 21 | OrderStatus CSecurityFtdcOrderField_2_OrderStatus(CSecurityFtdcOrderField* pIn); 22 | OrderType CSecurityFtdcOrderField_2_OrderType(CSecurityFtdcOrderField* pIn); 23 | TimeInForce CSecurityFtdcOrderField_2_TimeInForce(CSecurityFtdcOrderField* pIn); 24 | ExecType CSecurityFtdcOrderField_2_ExecType(CSecurityFtdcOrderField* pIn); 25 | 26 | InstrumentType CSecurityFtdcInstrumentField_2_InstrumentType(CSecurityFtdcInstrumentField* pIn); 27 | PutCall CSecurityFtdcInstrumentField_2_PutCall(CSecurityFtdcInstrumentField* pIn); 28 | PriceType CSecurityFtdcInstrumentField_2_PriceTick(CSecurityFtdcInstrumentField* pIn); 29 | 30 | IdCardType TSecurityFtdcIdCardTypeType_2_IdCardType(TSecurityFtdcIdCardTypeType In); 31 | 32 | ExchangeType TSecurityFtdcExchangeIDType_2_ExchangeType(TSecurityFtdcExchangeIDType In); -------------------------------------------------------------------------------- /QuantBox_LTS_Trade/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /QuantBox_LTS_Trade/main.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "../include/ApiHeader.h" 3 | #include "../include/QueueEnum.h" 4 | #include "TraderApi.h" 5 | 6 | inline CTraderApi* GetApi(void* pApi) 7 | { 8 | return static_cast(pApi); 9 | } 10 | 11 | void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) 12 | { 13 | RequestType rt = (RequestType)type; 14 | switch (rt) 15 | { 16 | case GetApiType: 17 | return (void*)(ApiType::Trade | ApiType::Instrument); 18 | case GetApiVersion: 19 | return (void*)"0.3.0.20150407"; 20 | case GetApiName: 21 | return (void*)"LTS"; 22 | case Create: 23 | return new CTraderApi(); 24 | default: 25 | break; 26 | } 27 | 28 | if (pApi1 == nullptr) 29 | { 30 | return nullptr; 31 | } 32 | 33 | CTraderApi* pApi = GetApi(pApi1); 34 | 35 | switch (rt) 36 | { 37 | case Release: 38 | delete pApi; 39 | return nullptr; 40 | case Register: 41 | pApi->Register(ptr1, ptr2); 42 | break; 43 | case Connect: 44 | pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2); 45 | break; 46 | case Disconnect: 47 | pApi->Disconnect(); 48 | break; 49 | case ReqQryInstrument: 50 | pApi->ReqQryInstrument((const char*)ptr1, (const char*)ptr2); 51 | break; 52 | case ReqQryTradingAccount: 53 | pApi->ReqQryTradingAccount(); 54 | break; 55 | case ReqQryInvestorPosition: 56 | pApi->ReqQryInvestorPosition((const char*)ptr1, (const char*)ptr2); 57 | break; 58 | //case ReqQrySettlementInfo: 59 | // pApi->ReqQrySettlementInfo((const char*)ptr1); 60 | // break; 61 | case ReqOrderInsert: 62 | return (void*)pApi->ReqOrderInsert((OrderField*)ptr1, size1, (OrderIDType*)ptr2); 63 | //case ReqQuoteInsert: 64 | // return (void*)pApi->ReqQuoteInsert((int)double1, (OrderField*)ptr1, (OrderField*)ptr2); 65 | case ReqOrderAction: 66 | return (void*)pApi->ReqOrderAction((OrderIDType*)ptr1, size1, (OrderIDType*)ptr2); 67 | break; 68 | default: 69 | break; 70 | } 71 | 72 | return pApi1; 73 | } 74 | -------------------------------------------------------------------------------- /QuantBox_LTS_Trade/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // QuantBox_LTS_Trade.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /QuantBox_LTS_Trade/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | //#include "targetver.h" 9 | // 10 | //#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | //// Windows Header Files: 12 | //#include 13 | 14 | // TODO: reference additional headers your program requires here 15 | #if defined _WIN32 || WIN32 || _WINDOWS 16 | #include "targetver.h" 17 | 18 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 19 | // Windows Header Files: 20 | #include 21 | #else 22 | 23 | #endif // defined 24 | -------------------------------------------------------------------------------- /QuantBox_LTS_Trade/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /QuantBox_Queue/ArrayLockFreeQueue.h: -------------------------------------------------------------------------------- 1 | #ifndef _ARRAYLOCKFREEQUEUE_H___ 2 | #define _ARRAYLOCKFREEQUEUE_H___ 3 | 4 | #include 5 | 6 | #ifdef _WIN64 7 | #define QUEUE_INT LONG64 8 | #else 9 | #define QUEUE_INT unsigned long 10 | #endif 11 | 12 | #define ARRAY_LOCK_FREE_Q_DEFAULT_SIZE 65535 // 2^16 13 | 14 | template 15 | class ArrayLockFreeQueue 16 | { 17 | public: 18 | 19 | ArrayLockFreeQueue(); 20 | virtual ~ArrayLockFreeQueue(); 21 | 22 | QUEUE_INT size(); 23 | 24 | bool enqueue(const ELEM_T &a_data); 25 | 26 | bool dequeue(ELEM_T &a_data); 27 | 28 | bool try_dequeue(ELEM_T &a_data); 29 | 30 | private: 31 | 32 | ELEM_T m_thequeue[Q_SIZE]; 33 | 34 | volatile QUEUE_INT m_count; 35 | volatile QUEUE_INT m_writeIndex; 36 | 37 | volatile QUEUE_INT m_readIndex; 38 | 39 | volatile QUEUE_INT m_maximumReadIndex; 40 | 41 | inline QUEUE_INT countToIndex(QUEUE_INT a_count); 42 | }; 43 | 44 | #include "ArrayLockFreeQueueImp.h" 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /QuantBox_Queue/QuantBox_Queue.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 56 | 57 | -------------------------------------------------------------------------------- /QuantBox_Queue/QuantBox_Queue.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | C:\Program Files\SmartQuant Ltd\OpenQuant 2014\OpenQuant.x86.exe 5 | WindowsLocalDebugger 6 | C:\Program Files\SmartQuant Ltd\OpenQuant 2014 7 | 8 | 9 | C:\Program Files\SmartQuant Ltd\OpenQuant 2014\OpenQuant.x86.exe 10 | WindowsLocalDebugger 11 | C:\Program Files\SmartQuant Ltd\OpenQuant 2014 12 | 13 | 14 | C:\Program Files\SmartQuant Ltd\OpenQuant 2014\OpenQuant.x86.exe 15 | WindowsLocalDebugger 16 | C:\Program Files\SmartQuant Ltd\OpenQuant 2014 17 | 18 | 19 | C:\Program Files\SmartQuant Ltd\OpenQuant 2014\OpenQuant.x64.exe 20 | WindowsLocalDebugger 21 | C:\Program Files\SmartQuant Ltd\OpenQuant 2014 22 | 23 | -------------------------------------------------------------------------------- /QuantBox_Queue/RemoteQueue.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_Queue/RemoteQueue.cpp -------------------------------------------------------------------------------- /QuantBox_Queue/RemoteQueue.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_Queue/RemoteQueue.h -------------------------------------------------------------------------------- /QuantBox_Queue/atom_opt.h: -------------------------------------------------------------------------------- 1 | #ifndef _ATOM_OPT_H___ 2 | #define _ATOM_OPT_H___ 3 | 4 | #ifdef __GNUC__ 5 | #define CAS(a_ptr, a_oldVal, a_newVal) __sync_bool_compare_and_swap(a_ptr, a_oldVal, a_newVal) 6 | #define AtomicAdd(a_ptr,a_count) __sync_fetch_and_add (a_ptr, a_count) 7 | #define AtomicSub(a_ptr,a_count) __sync_fetch_and_sub (a_ptr, a_count) 8 | #include // sched_yield() 9 | #else 10 | 11 | #include 12 | #ifdef _WIN64 13 | #define CAS(a_ptr, a_oldVal, a_newVal) (a_oldVal == InterlockedCompareExchange64(a_ptr, a_newVal, a_oldVal)) 14 | #define sched_yield() SwitchToThread() 15 | #define AtomicAdd(a_ptr, num) InterlockedIncrement64(a_ptr) 16 | #define AtomicSub(a_ptr, num) InterlockedDecrement64(a_ptr) 17 | #else 18 | #define CAS(a_ptr, a_oldVal, a_newVal) (a_oldVal == InterlockedCompareExchange(a_ptr, a_newVal, a_oldVal)) 19 | #define sched_yield() SwitchToThread() 20 | #define AtomicAdd(a_ptr, num) InterlockedIncrement(a_ptr) 21 | #define AtomicSub(a_ptr, num) InterlockedDecrement(a_ptr) 22 | #endif 23 | 24 | #endif 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /QuantBox_Queue/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /QuantBox_Queue/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_Queue/main.cpp -------------------------------------------------------------------------------- /QuantBox_Queue/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // QuantBox_Queue.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /QuantBox_Queue/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | //#include "targetver.h" 9 | // 10 | //#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | //// Windows Header Files: 12 | //#include 13 | 14 | // TODO: reference additional headers your program requires here 15 | #if defined _WIN32 || WIN32 || _WINDOWS 16 | #include "targetver.h" 17 | 18 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 19 | // Windows Header Files: 20 | #include 21 | #else 22 | 23 | #endif // defined -------------------------------------------------------------------------------- /QuantBox_Queue/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /QuantBox_TongShi_Quote/DialogStockDrv.cpp: -------------------------------------------------------------------------------- 1 | // DialogStockDrv.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "QuantBox_TongShi_Quote.h" 6 | #include "DialogStockDrv.h" 7 | #include "afxdialogex.h" 8 | 9 | #include "MdUserApi.h" 10 | 11 | #define WM_USER_STOCK 2000 12 | // CDialogStockDrv dialog 13 | 14 | IMPLEMENT_DYNAMIC(CDialogStockDrv, CDialogEx) 15 | 16 | CDialogStockDrv::CDialogStockDrv(CWnd* pParent /*=NULL*/) 17 | : CDialogEx(CDialogStockDrv::IDD, pParent) 18 | { 19 | m_pUserApi = nullptr; 20 | } 21 | 22 | CDialogStockDrv::~CDialogStockDrv() 23 | { 24 | } 25 | 26 | void CDialogStockDrv::DoDataExchange(CDataExchange* pDX) 27 | { 28 | CDialogEx::DoDataExchange(pDX); 29 | } 30 | 31 | 32 | BEGIN_MESSAGE_MAP(CDialogStockDrv, CDialogEx) 33 | ON_MESSAGE(WM_USER_STOCK, OnTSDataDriver) 34 | ON_WM_CLOSE() 35 | END_MESSAGE_MAP() 36 | 37 | 38 | // CDialogStockDrv message handlers 39 | 40 | 41 | BOOL CDialogStockDrv::OnInitDialog() 42 | { 43 | CDialogEx::OnInitDialog(); 44 | 45 | // TODO: Add extra initialization here 46 | if (m_pUserApi) 47 | { 48 | m_pUserApi->InitDriver(GetSafeHwnd(), WM_USER_STOCK); 49 | MoveWindow(0, 0, 0, 0); 50 | ShowWindow(SW_HIDE); 51 | ModifyStyleEx(WS_EX_APPWINDOW, WS_EX_TOOLWINDOW); 52 | } 53 | 54 | return TRUE; // return TRUE unless you set the focus to a control 55 | // EXCEPTION: OCX Property Pages should return FALSE 56 | } 57 | 58 | LONG CDialogStockDrv::OnTSDataDriver(UINT wParam, LONG lParam) 59 | { 60 | if (m_pUserApi) 61 | return m_pUserApi->_OnMsg(wParam, lParam); 62 | return 1; 63 | } 64 | 65 | void CDialogStockDrv::OnClose() 66 | { 67 | // TODO: Add your message handler code here and/or call default 68 | if(m_pUserApi) 69 | { 70 | m_pUserApi->QuitDriver(); 71 | } 72 | 73 | CDialogEx::OnClose(); 74 | } 75 | -------------------------------------------------------------------------------- /QuantBox_TongShi_Quote/DialogStockDrv.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | class CMdUserApi; 5 | // CDialogStockDrv dialog 6 | 7 | class CDialogStockDrv : public CDialogEx 8 | { 9 | DECLARE_DYNAMIC(CDialogStockDrv) 10 | 11 | public: 12 | LONG OnTSDataDriver(UINT wParam, LONG lParam); 13 | 14 | CDialogStockDrv(CWnd* pParent = NULL); // standard constructor 15 | virtual ~CDialogStockDrv(); 16 | 17 | // Dialog Data 18 | enum { IDD = IDD_DIALOG_STOCKDRV }; 19 | 20 | protected: 21 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 22 | 23 | DECLARE_MESSAGE_MAP() 24 | public: 25 | virtual BOOL OnInitDialog(); 26 | CMdUserApi* m_pUserApi; 27 | afx_msg void OnClose(); 28 | }; 29 | -------------------------------------------------------------------------------- /QuantBox_TongShi_Quote/MdUserApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_TongShi_Quote/MdUserApi.h -------------------------------------------------------------------------------- /QuantBox_TongShi_Quote/QuantBox_TongShi_Quote.cpp: -------------------------------------------------------------------------------- 1 | // QuantBox_TongShi_Quote.cpp : Defines the initialization routines for the DLL. 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "QuantBox_TongShi_Quote.h" 6 | 7 | #ifdef _DEBUG 8 | #define new DEBUG_NEW 9 | #endif 10 | 11 | // 12 | //TODO: If this DLL is dynamically linked against the MFC DLLs, 13 | // any functions exported from this DLL which call into 14 | // MFC must have the AFX_MANAGE_STATE macro added at the 15 | // very beginning of the function. 16 | // 17 | // For example: 18 | // 19 | // extern "C" BOOL PASCAL EXPORT ExportedFunction() 20 | // { 21 | // AFX_MANAGE_STATE(AfxGetStaticModuleState()); 22 | // // normal function body here 23 | // } 24 | // 25 | // It is very important that this macro appear in each 26 | // function, prior to any calls into MFC. This means that 27 | // it must appear as the first statement within the 28 | // function, even before any object variable declarations 29 | // as their constructors may generate calls into the MFC 30 | // DLL. 31 | // 32 | // Please see MFC Technical Notes 33 and 58 for additional 33 | // details. 34 | // 35 | 36 | // CQuantBox_TongShi_QuoteApp 37 | 38 | BEGIN_MESSAGE_MAP(CQuantBox_TongShi_QuoteApp, CWinApp) 39 | END_MESSAGE_MAP() 40 | 41 | 42 | // CQuantBox_TongShi_QuoteApp construction 43 | 44 | CQuantBox_TongShi_QuoteApp::CQuantBox_TongShi_QuoteApp() 45 | { 46 | // TODO: add construction code here, 47 | // Place all significant initialization in InitInstance 48 | } 49 | 50 | 51 | // The one and only CQuantBox_TongShi_QuoteApp object 52 | 53 | CQuantBox_TongShi_QuoteApp theApp; 54 | 55 | 56 | // CQuantBox_TongShi_QuoteApp initialization 57 | 58 | BOOL CQuantBox_TongShi_QuoteApp::InitInstance() 59 | { 60 | CWinApp::InitInstance(); 61 | 62 | return TRUE; 63 | } 64 | -------------------------------------------------------------------------------- /QuantBox_TongShi_Quote/QuantBox_TongShi_Quote.h: -------------------------------------------------------------------------------- 1 | // QuantBox_TongShi_Quote.h : main header file for the QuantBox_TongShi_Quote DLL 2 | // 3 | 4 | #pragma once 5 | 6 | #ifndef __AFXWIN_H__ 7 | #error "include 'stdafx.h' before including this file for PCH" 8 | #endif 9 | 10 | #include "resource.h" // main symbols 11 | 12 | // CQuantBox_TongShi_QuoteApp 13 | // See QuantBox_TongShi_Quote.cpp for the implementation of this class 14 | // 15 | 16 | class CQuantBox_TongShi_QuoteApp : public CWinApp 17 | { 18 | public: 19 | CQuantBox_TongShi_QuoteApp(); 20 | 21 | // Overrides 22 | public: 23 | virtual BOOL InitInstance(); 24 | 25 | DECLARE_MESSAGE_MAP() 26 | }; 27 | -------------------------------------------------------------------------------- /QuantBox_TongShi_Quote/QuantBox_TongShi_Quote.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_TongShi_Quote/QuantBox_TongShi_Quote.rc -------------------------------------------------------------------------------- /QuantBox_TongShi_Quote/Stockdrv.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_TongShi_Quote/Stockdrv.h -------------------------------------------------------------------------------- /QuantBox_TongShi_Quote/TypeConvert.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_TongShi_Quote/TypeConvert.cpp -------------------------------------------------------------------------------- /QuantBox_TongShi_Quote/TypeConvert.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "Stockdrv.h" 5 | #include "../include/ApiStruct.h" 6 | 7 | ExchangeType Market_2_ExchangeType(WORD In); 8 | char* Market_2_ExchangeID(WORD In); 9 | char* OldSymbol_2_NewSymbol(char* In, WORD In2); 10 | 11 | -------------------------------------------------------------------------------- /QuantBox_TongShi_Quote/main.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "../include/ApiHeader.h" 3 | 4 | #include "../include/QueueEnum.h" 5 | #include "MdUserApi.h" 6 | 7 | inline CMdUserApi* GetApi(void* pApi) 8 | { 9 | return static_cast(pApi); 10 | } 11 | 12 | void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) 13 | { 14 | RequestType rt = (RequestType)type; 15 | switch (rt) 16 | { 17 | case GetApiType: 18 | return (void*)(ApiType::MarketData); 19 | case GetApiVersion: 20 | return (void*)"0.2.0.20150419"; 21 | case GetApiName: 22 | return (void*)"TongShi"; 23 | case Create: 24 | return new CMdUserApi(); 25 | default: 26 | break; 27 | } 28 | 29 | if (pApi1 == nullptr) 30 | { 31 | return nullptr; 32 | } 33 | 34 | CMdUserApi* pApi = GetApi(pApi1); 35 | 36 | switch (rt) 37 | { 38 | case Release: 39 | delete pApi; 40 | return 0; 41 | case Register: 42 | pApi->Register(ptr1,ptr2); 43 | break; 44 | case Config: 45 | return (void*)pApi->Config((ConfigInfoField*)ptr1); 46 | case Connect: 47 | pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2,size2); 48 | break; 49 | case Disconnect: 50 | pApi->Disconnect(); 51 | break; 52 | //case Subscribe: 53 | // pApi->Subscribe((const char*)ptr1, (const char*)ptr2); 54 | // break; 55 | //case Unsubscribe: 56 | // pApi->Unsubscribe((const char*)ptr1, (const char*)ptr2); 57 | // break; 58 | //case SubscribeQuote: 59 | // pApi->SubscribeQuote((const char*)ptr1, (const char*)ptr2); 60 | // break; 61 | //case UnsubscribeQuote: 62 | // pApi->UnsubscribeQuote((const char*)ptr1, (const char*)ptr2); 63 | // break; 64 | default: 65 | break; 66 | } 67 | 68 | return pApi1; 69 | } 70 | -------------------------------------------------------------------------------- /QuantBox_TongShi_Quote/res/QuantBox_TongShi_Quote.rc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_TongShi_Quote/res/QuantBox_TongShi_Quote.rc2 -------------------------------------------------------------------------------- /QuantBox_TongShi_Quote/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_TongShi_Quote/resource.h -------------------------------------------------------------------------------- /QuantBox_TongShi_Quote/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // QuantBox_TongShi_Quote.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | 8 | -------------------------------------------------------------------------------- /QuantBox_TongShi_Quote/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | 5 | #pragma once 6 | 7 | #ifndef VC_EXTRALEAN 8 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 9 | #endif 10 | 11 | #include "targetver.h" 12 | 13 | #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit 14 | 15 | #include // MFC core and standard components 16 | #include // MFC extensions 17 | 18 | #ifndef _AFX_NO_OLE_SUPPORT 19 | #include // MFC OLE classes 20 | #include // MFC OLE dialog classes 21 | #include // MFC Automation classes 22 | #endif // _AFX_NO_OLE_SUPPORT 23 | 24 | #ifndef _AFX_NO_DB_SUPPORT 25 | #include // MFC ODBC database classes 26 | #endif // _AFX_NO_DB_SUPPORT 27 | 28 | #ifndef _AFX_NO_DAO_SUPPORT 29 | #include // MFC DAO database classes 30 | #endif // _AFX_NO_DAO_SUPPORT 31 | 32 | #ifndef _AFX_NO_OLE_SUPPORT 33 | #include // MFC support for Internet Explorer 4 Common Controls 34 | #endif 35 | #ifndef _AFX_NO_AFXCMN_SUPPORT 36 | #include // MFC support for Windows Common Controls 37 | #endif // _AFX_NO_AFXCMN_SUPPORT 38 | #include -------------------------------------------------------------------------------- /QuantBox_TongShi_Quote/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /QuantBox_XAPI/QuantBox_XAPI.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 61 | 62 | -------------------------------------------------------------------------------- /QuantBox_XAPI/QuantBox_XAPI.cpp: -------------------------------------------------------------------------------- 1 | // QuantBox_XAPI.cpp : Defines the exported functions for the DLL application. 2 | // 3 | 4 | #include "stdafx.h" 5 | 6 | 7 | -------------------------------------------------------------------------------- /QuantBox_XAPI/QuantBox_XAPI.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | {57c845a3-8cda-4645-89e0-59759492f35e} 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | include 35 | 36 | 37 | include 38 | 39 | 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | Source Files 55 | 56 | 57 | -------------------------------------------------------------------------------- /QuantBox_XAPI/XApiCpp.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "../include/XApiCpp.h" 3 | 4 | #include "XApiImpl.h" 5 | 6 | CXApi::CXApi() 7 | { 8 | } 9 | 10 | CXApi* CXApi::CreateApi(char* libPath) 11 | { 12 | return new CXApiImpl(libPath); 13 | } 14 | -------------------------------------------------------------------------------- /QuantBox_XAPI/XApiImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../include/XApiCpp.h" 3 | 4 | #include "../include/QueueHeader.h" 5 | 6 | class CXApiImpl : 7 | public CXApi 8 | { 9 | public: 10 | CXApiImpl(char* libPath); 11 | ~CXApiImpl(); 12 | 13 | virtual ApiType GetApiType(); 14 | virtual char* GetApiVersion(); 15 | virtual char* GetApiName(); 16 | 17 | virtual bool Init(); 18 | virtual char* GetLastError(); 19 | virtual void RegisterSpi(CXSpi *pSpi); 20 | 21 | virtual void Connect(char* szPath, ServerInfoField* pServerInfo, UserInfoField* pUserInfo, int count); 22 | virtual void Disconnect(); 23 | 24 | virtual void Subscribe(char* szInstrument, char* szExchange); 25 | virtual void Unsubscribe(char* szInstrument, char* szExchange); 26 | 27 | virtual void ReqQryInstrument(char* szInstrument, char* szExchange); 28 | virtual void ReqQryInvestorPosition(char* szInstrument, char* szExchange); 29 | virtual void ReqQryTradingAccount(); 30 | 31 | virtual void SendOrder(OrderField* pOrder, OrderIDType* pInOut, int count); 32 | virtual void CancelOrder(OrderIDType* pIn, OrderIDType* pOut, int count); 33 | 34 | virtual void SendQuote(QuoteField* pQuote, OrderIDType* pAskOut, OrderIDType* pBidOut, int count); 35 | virtual void CancelQuote(OrderIDType* pIn, OrderIDType* pOut, int count); 36 | public: 37 | static void* __stdcall OnRespone(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); 38 | private: 39 | void* _OnRespone(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); 40 | 41 | void* m_pLib; 42 | void* m_pFun; 43 | void* m_pApi; 44 | 45 | CXSpi *m_pSpi; 46 | char m_LibPath[1024]; 47 | }; 48 | 49 | -------------------------------------------------------------------------------- /QuantBox_XAPI/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /QuantBox_XAPI/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // QuantBox_XAPI.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /QuantBox_XAPI/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #if defined _WIN32 || WIN32 || _WINDOWS 9 | #include "targetver.h" 10 | 11 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 12 | // Windows Header Files: 13 | #include 14 | 15 | #else 16 | 17 | #endif // defined 18 | 19 | // TODO: reference additional headers your program requires here 20 | -------------------------------------------------------------------------------- /QuantBox_XAPI/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /QuantBox_XAPI_C_Linux.workspace: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /QuantBox_XAPI_TEST/QuantBox_XAPI_TEST.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 51 | 52 | -------------------------------------------------------------------------------- /QuantBox_XAPI_TEST/QuantBox_XAPI_TEST.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Source Files 40 | 41 | 42 | -------------------------------------------------------------------------------- /QuantBox_XAPI_TEST/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | CONSOLE APPLICATION : QuantBox_XAPI_TEST Project Overview 3 | ======================================================================== 4 | 5 | AppWizard has created this QuantBox_XAPI_TEST application for you. 6 | 7 | This file contains a summary of what you will find in each of the files that 8 | make up your QuantBox_XAPI_TEST application. 9 | 10 | 11 | QuantBox_XAPI_TEST.vcxproj 12 | This is the main project file for VC++ projects generated using an Application Wizard. 13 | It contains information about the version of Visual C++ that generated the file, and 14 | information about the platforms, configurations, and project features selected with the 15 | Application Wizard. 16 | 17 | QuantBox_XAPI_TEST.vcxproj.filters 18 | This is the filters file for VC++ projects generated using an Application Wizard. 19 | It contains information about the association between the files in your project 20 | and the filters. This association is used in the IDE to show grouping of files with 21 | similar extensions under a specific node (for e.g. ".cpp" files are associated with the 22 | "Source Files" filter). 23 | 24 | QuantBox_XAPI_TEST.cpp 25 | This is the main application source file. 26 | 27 | ///////////////////////////////////////////////////////////////////////////// 28 | Other standard files: 29 | 30 | StdAfx.h, StdAfx.cpp 31 | These files are used to build a precompiled header (PCH) file 32 | named QuantBox_XAPI_TEST.pch and a precompiled types file named StdAfx.obj. 33 | 34 | ///////////////////////////////////////////////////////////////////////////// 35 | Other notes: 36 | 37 | AppWizard uses "TODO:" comments to indicate parts of the source code you 38 | should add to or customize. 39 | 40 | ///////////////////////////////////////////////////////////////////////////// 41 | -------------------------------------------------------------------------------- /QuantBox_XAPI_TEST/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // QuantBox_XAPI_TEST.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /QuantBox_XAPI_TEST/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #if defined _WIN32 || WIN32 || _WINDOWS 9 | #include "targetver.h" 10 | 11 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 12 | // Windows Header Files: 13 | #include 14 | #include 15 | 16 | #else 17 | 18 | #endif // defined 19 | 20 | #include 21 | 22 | 23 | 24 | 25 | // TODO: reference additional headers your program requires here 26 | -------------------------------------------------------------------------------- /QuantBox_XAPI_TEST/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /QuantBox_XSpeedStock_Quote/MdUserApi.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_XSpeedStock_Quote/MdUserApi.cpp -------------------------------------------------------------------------------- /QuantBox_XSpeedStock_Quote/MdUserApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_XSpeedStock_Quote/MdUserApi.h -------------------------------------------------------------------------------- /QuantBox_XSpeedStock_Quote/QuantBox_XSpeedStock_Quote.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | C:\Program Files\SmartQuant Ltd\OpenQuant 2014\OpenQuant.x86.exe 5 | WindowsLocalDebugger 6 | 7 | -------------------------------------------------------------------------------- /QuantBox_XSpeedStock_Quote/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /QuantBox_XSpeedStock_Quote/main.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "../include/ApiHeader.h" 3 | 4 | #include "../include/QueueEnum.h" 5 | #include "MdUserApi.h" 6 | 7 | inline CMdUserApi* GetApi(void* pApi) 8 | { 9 | return static_cast(pApi); 10 | } 11 | 12 | void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) 13 | { 14 | RequestType rt = (RequestType)type; 15 | switch (rt) 16 | { 17 | case GetApiType: 18 | return (void*)(ApiType::MarketData|ApiType::Instrument); 19 | case GetApiVersion: 20 | return (void*)"0.3.0.20150407"; 21 | case GetApiName: 22 | return (void*)"XSpeedStock"; 23 | case Create: 24 | return new CMdUserApi(); 25 | default: 26 | break; 27 | } 28 | 29 | if (pApi1 == nullptr) 30 | { 31 | return nullptr; 32 | } 33 | 34 | CMdUserApi* pApi = GetApi(pApi1); 35 | 36 | switch (rt) 37 | { 38 | case Release: 39 | delete pApi; 40 | return nullptr; 41 | case Register: 42 | pApi->Register(ptr1, ptr2); 43 | break; 44 | case Config: 45 | return (void*)pApi->Config((ConfigInfoField*)ptr1); 46 | break; 47 | case Connect: 48 | pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2); 49 | break; 50 | case Disconnect: 51 | pApi->Disconnect(); 52 | break; 53 | case ReqQryInstrument: 54 | pApi->ReqQryInstrument((const char*)ptr1, (const char*)ptr2); 55 | break; 56 | case Subscribe: 57 | pApi->Subscribe((const char*)ptr1, (const char*)ptr2); 58 | break; 59 | case Unsubscribe: 60 | pApi->Unsubscribe((const char*)ptr1, (const char*)ptr2); 61 | break; 62 | //case SubscribeQuote: 63 | // pApi->SubscribeQuote((const char*)ptr1, (const char*)ptr2); 64 | // break; 65 | //case UnsubscribeQuote: 66 | // pApi->UnsubscribeQuote((const char*)ptr1, (const char*)ptr2); 67 | // break; 68 | default: 69 | // 通知 70 | break; 71 | } 72 | 73 | return pApi1; 74 | } 75 | -------------------------------------------------------------------------------- /QuantBox_XSpeedStock_Quote/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // QuantBox_XSpeedStock_Quote.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /QuantBox_XSpeedStock_Quote/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | // Windows Header Files: 12 | #include 13 | 14 | 15 | 16 | // TODO: reference additional headers your program requires here 17 | -------------------------------------------------------------------------------- /QuantBox_XSpeedStock_Quote/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /QuantBox_XSpeedStock_Trade/TraderApi.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_XSpeedStock_Trade/TraderApi.cpp -------------------------------------------------------------------------------- /QuantBox_XSpeedStock_Trade/TraderApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_XSpeedStock_Trade/TraderApi.h -------------------------------------------------------------------------------- /QuantBox_XSpeedStock_Trade/TypeConvert.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../include/XSpeed_Stock/DFITCSECApiDataType.h" 4 | #include "../include/XSpeed_Stock/DFITCSECApiStruct.h" 5 | #include "../include/ApiStruct.h" 6 | 7 | 8 | //PutCall TThostFtdcOptionsTypeType_2_PutCall(TThostFtdcOptionsTypeType In); 9 | 10 | //HedgeFlagType DFITCSpeculatorType_2_HedgeFlagType(DFITCSpeculatorType In); 11 | //DFITCSpeculatorType HedgeFlagType_2_DFITCSpeculatorType(HedgeFlagType In); 12 | // 13 | //DFITCOpenCloseTypeType OpenCloseType_2_DFITCOpenCloseTypeType(OpenCloseType In); 14 | //OpenCloseType DFITCOpenCloseTypeType_2_OpenCloseType(DFITCOpenCloseTypeType In); 15 | // 16 | //DFITCBuySellTypeType OrderSide_2_DFITCBuySellTypeType(OrderSide In); 17 | //OrderSide DFITCBuySellTypeType_2_OrderSide(DFITCBuySellTypeType In); 18 | // 19 | //DFITCOrderTypeType OrderType_2_DFITCOrderTypeType(OrderType In); 20 | // 21 | //TimeInForce DFITCOrderPropertyType_2_TimeInForce(DFITCOrderPropertyType In); 22 | //DFITCOrderPropertyType TimeInForce_2_DFITCOrderPropertyType(TimeInForce In); 23 | // 24 | //OrderStatus DFITCOrderRtnField_2_OrderStatus(DFITCOrderRtnField* pIn); 25 | //OrderType DFITCOrderRtnField_2_OrderType(DFITCOrderRtnField* pIn); 26 | //TimeInForce DFITCOrderRtnField_2_TimeInForce(DFITCOrderRtnField* pIn); 27 | //ExecType DFITCOrderRtnField_2_ExecType(DFITCOrderRtnField* pIn); 28 | // 29 | //InstrumentType DFITCInstrumentTypeType_2_InstrumentType(DFITCInstrumentTypeType In); 30 | ExchangeType DFITCSECExchangeIDType_2_ExchangeType(DFITCSECExchangeIDType In); 31 | -------------------------------------------------------------------------------- /QuantBox_XSpeedStock_Trade/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /QuantBox_XSpeedStock_Trade/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // QuantBox_XSpeedStock_Trade.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /QuantBox_XSpeedStock_Trade/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | // Windows Header Files: 12 | #include 13 | 14 | 15 | 16 | // TODO: reference additional headers your program requires here 17 | -------------------------------------------------------------------------------- /QuantBox_XSpeedStock_Trade/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /QuantBox_XSpeed_Quote/MdUserApi.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_XSpeed_Quote/MdUserApi.cpp -------------------------------------------------------------------------------- /QuantBox_XSpeed_Quote/MdUserApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_XSpeed_Quote/MdUserApi.h -------------------------------------------------------------------------------- /QuantBox_XSpeed_Quote/QuantBox_XSpeed_Quote.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | C:\Program Files\SmartQuant Ltd\OpenQuant 2014\OpenQuant.x86.exe 5 | WindowsLocalDebugger 6 | 7 | -------------------------------------------------------------------------------- /QuantBox_XSpeed_Quote/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /QuantBox_XSpeed_Quote/main.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "../include/ApiHeader.h" 3 | 4 | #include "../include/QueueEnum.h" 5 | #include "MdUserApi.h" 6 | 7 | inline CMdUserApi* GetApi(void* pApi) 8 | { 9 | return static_cast(pApi); 10 | } 11 | 12 | void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) 13 | { 14 | RequestType rt = (RequestType)type; 15 | switch (rt) 16 | { 17 | case GetApiType: 18 | return (void*)(ApiType::MarketData); 19 | case GetApiVersion: 20 | return (void*)"0.3.0.20150407"; 21 | case GetApiName: 22 | return (void*)"XSpeed"; 23 | case Create: 24 | return new CMdUserApi(); 25 | default: 26 | break; 27 | } 28 | 29 | if (pApi1 == nullptr) 30 | { 31 | return nullptr; 32 | } 33 | 34 | CMdUserApi* pApi = GetApi(pApi1); 35 | 36 | switch (rt) 37 | { 38 | case Release: 39 | delete pApi; 40 | return nullptr; 41 | case Register: 42 | pApi->Register(ptr1, ptr2); 43 | break; 44 | case Config: 45 | return (void*)pApi->Config((ConfigInfoField*)ptr1); 46 | break; 47 | case Connect: 48 | pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2); 49 | break; 50 | case Disconnect: 51 | pApi->Disconnect(); 52 | break; 53 | case Subscribe: 54 | pApi->Subscribe((const char*)ptr1, (const char*)ptr2); 55 | break; 56 | case Unsubscribe: 57 | pApi->Unsubscribe((const char*)ptr1, (const char*)ptr2); 58 | break; 59 | //case SubscribeQuote: 60 | // pApi->SubscribeQuote((const char*)ptr1, (const char*)ptr2); 61 | // break; 62 | //case UnsubscribeQuote: 63 | // pApi->UnsubscribeQuote((const char*)ptr1, (const char*)ptr2); 64 | // break; 65 | default: 66 | // 通知 67 | break; 68 | } 69 | 70 | return pApi1; 71 | } 72 | -------------------------------------------------------------------------------- /QuantBox_XSpeed_Quote/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // QuantBox_XSpeed_Quote.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /QuantBox_XSpeed_Quote/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | //#include "targetver.h" 9 | // 10 | //#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | //// Windows Header Files: 12 | //#include 13 | 14 | // TODO: reference additional headers your program requires here 15 | #if defined _WIN32 || WIN32 || _WINDOWS 16 | #include "targetver.h" 17 | 18 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 19 | // Windows Header Files: 20 | #include 21 | #else 22 | 23 | #endif // defined 24 | -------------------------------------------------------------------------------- /QuantBox_XSpeed_Quote/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /QuantBox_XSpeed_Trade/QuantBox_XSpeed_Trade.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | Header Files 35 | 36 | 37 | 38 | 39 | Source Files 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | Source Files 55 | 56 | 57 | -------------------------------------------------------------------------------- /QuantBox_XSpeed_Trade/TraderApi.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_XSpeed_Trade/TraderApi.cpp -------------------------------------------------------------------------------- /QuantBox_XSpeed_Trade/TraderApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/QuantBox_XSpeed_Trade/TraderApi.h -------------------------------------------------------------------------------- /QuantBox_XSpeed_Trade/TypeConvert.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../include/XSpeed/DFITCApiDataType.h" 4 | #include "../include/XSpeed/DFITCApiStruct.h" 5 | #include "../include/ApiStruct.h" 6 | 7 | 8 | //PutCall TThostFtdcOptionsTypeType_2_PutCall(TThostFtdcOptionsTypeType In); 9 | 10 | HedgeFlagType DFITCSpeculatorType_2_HedgeFlagType(DFITCSpeculatorType In); 11 | DFITCSpeculatorType HedgeFlagType_2_DFITCSpeculatorType(HedgeFlagType In); 12 | 13 | DFITCOpenCloseTypeType OpenCloseType_2_DFITCOpenCloseTypeType(OpenCloseType In); 14 | OpenCloseType DFITCOpenCloseTypeType_2_OpenCloseType(DFITCOpenCloseTypeType In); 15 | 16 | DFITCBuySellTypeType OrderSide_2_DFITCBuySellTypeType(OrderSide In); 17 | OrderSide DFITCBuySellTypeType_2_OrderSide(DFITCBuySellTypeType In); 18 | 19 | DFITCOrderTypeType OrderType_2_DFITCOrderTypeType(OrderType In); 20 | 21 | TimeInForce DFITCOrderPropertyType_2_TimeInForce(DFITCOrderPropertyType In); 22 | DFITCOrderPropertyType TimeInForce_2_DFITCOrderPropertyType(TimeInForce In); 23 | 24 | OrderStatus DFITCOrderRtnField_2_OrderStatus(DFITCOrderRtnField* pIn); 25 | OrderType DFITCOrderRtnField_2_OrderType(DFITCOrderRtnField* pIn); 26 | TimeInForce DFITCOrderRtnField_2_TimeInForce(DFITCOrderRtnField* pIn); 27 | ExecType DFITCOrderRtnField_2_ExecType(DFITCOrderRtnField* pIn); 28 | 29 | InstrumentType DFITCInstrumentTypeType_2_InstrumentType(DFITCInstrumentTypeType In); 30 | 31 | ExchangeType DFITCExchangeIDType_2_ExchangeType(DFITCExchangeIDType In); 32 | -------------------------------------------------------------------------------- /QuantBox_XSpeed_Trade/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /QuantBox_XSpeed_Trade/main.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "../include/ApiHeader.h" 3 | //#include "../include/ApiStruct.h" 4 | #include "../include/QueueEnum.h" 5 | #include "TraderApi.h" 6 | 7 | inline CTraderApi* GetApi(void* pApi) 8 | { 9 | return static_cast(pApi); 10 | } 11 | 12 | void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) 13 | { 14 | RequestType rt = (RequestType)type; 15 | switch (rt) 16 | { 17 | case GetApiType: 18 | return (void*)(ApiType::Trade | ApiType::QuoteRequest | ApiType::Instrument); 19 | case GetApiVersion: 20 | return (void*)"0.3.0.20150407"; 21 | case GetApiName: 22 | return (void*)"XSpeed"; 23 | case Create: 24 | return new CTraderApi(); 25 | default: 26 | break; 27 | } 28 | 29 | if (pApi1 == nullptr) 30 | { 31 | return nullptr; 32 | } 33 | 34 | CTraderApi* pApi = GetApi(pApi1); 35 | 36 | switch (rt) 37 | { 38 | case Release: 39 | delete pApi; 40 | return nullptr; 41 | case Register: 42 | pApi->Register(ptr1, ptr2); 43 | break; 44 | case Connect: 45 | pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2); 46 | break; 47 | case Disconnect: 48 | pApi->Disconnect(); 49 | break; 50 | case ReqQryInstrument: 51 | //pApi->ReqQryInstrument((const char*)ptr1, (const char*)ptr2); 52 | break; 53 | case ReqQryTradingAccount: 54 | pApi->ReqQryCustomerCapital(); 55 | break; 56 | //case ReqQrySettlementInfo: 57 | // pApi->ReqQrySettlementInfo((const char*)ptr1); 58 | // break; 59 | case ReqOrderInsert: 60 | return (void*)pApi->ReqOrderInsert((OrderField*)ptr1, size1, (OrderIDType*)ptr2); 61 | //case ReqQuoteInsert: 62 | // return (void*)pApi->ReqQuoteInsert((int)double1, (OrderField*)ptr1, (OrderField*)ptr2); 63 | //case ReqOrderAction: 64 | // return (void*)pApi->ReqCancelOrder((const char*)ptr1); 65 | // break; 66 | case SubscribeQuote: 67 | pApi->ReqQuoteSubscribe((const char*)ptr2, DFITC_OPT_TYPE); 68 | break; 69 | case UnsubscribeQuote: 70 | pApi->ReqQuoteUnSubscribe((const char*)ptr2, DFITC_OPT_TYPE); 71 | break; 72 | default: 73 | // 通知 74 | break; 75 | } 76 | 77 | return pApi1; 78 | } 79 | -------------------------------------------------------------------------------- /QuantBox_XSpeed_Trade/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // QuantBox_XSpeed_Trade.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /QuantBox_XSpeed_Trade/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | //#include "targetver.h" 9 | // 10 | //#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | //// Windows Header Files: 12 | //#include 13 | 14 | // TODO: reference additional headers your program requires here 15 | #if defined _WIN32 || WIN32 || _WINDOWS 16 | #include "targetver.h" 17 | 18 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 19 | // Windows Header Files: 20 | #include 21 | #else 22 | 23 | #endif // defined 24 | -------------------------------------------------------------------------------- /QuantBox_XSpeed_Trade/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # QuantBox_XAPI 统一行情交易接口 2 | 3 | ##介绍 4 | 现在市场上的交易与行情API太多,对每家都接特别麻烦,如果能统一用一套API接入就好了。
5 | 如果进行接口的统一,要实现以下几点: 6 | 7 | 1. 统一的结构体 8 | 2. 统一的调用方式 9 | 3. 灵活的加载方式 10 | 11 | 实现统一的结构体必然会有些API的特殊字段没法照顾到;调用方式统一则有些功能将不会实现,而有些功能需要几个请求,或本机模拟的方法来实现;加载方式以前C#层是用的P/Invoke,现在改用LoadLibraryEx/dlopen来实现。 12 | 13 | ## 如何使用C#版 14 | 编译QuantBox.XAPI,有两种输出方式 15 | 16 | 1. 生成QuantBox.XAPI.dll,设置输出类型为类库,可以在其它项目中引用 17 | 2. 生成QuantBox.XAPI.exe,设置输出类型为控制台程序,将运行项目中的Program.cs文件,是API的使用示例 18 | 19 | ### 在Windows .Net项目中使用 20 | 1. 使用Visual Studio 2013打开QuantBox\_XAPI\_Windows.sln进行编译,会生成 21 | > **QuantBox\.XAPI\.dll**:C#接口,由它进行C接口的加载
22 | > **QuantBox\_Queue.dll**:C接口,消息队列,行情与交易的数据先进入队列然后,由内部的线程进行触发
23 | > **QuantBox\_CTP\_Quote.dll**:C接口,调用CTP的行情API
24 | > **QuantBox\_CTP\_Trade.dll**:C接口,调用CTP的交易API
25 | > 其它如XSpeed/LTS等行情与交易接口 26 | 27 | ### 在Linux Mono项目中使用 28 | 1. 使用Mono Develop打开QuantBox\_XAPI\_CSharp\_Linux.sln进行编译,会生成 29 | > **QuantBox\.XAPI\.dll**:C#接口,由它进行C接口的加载 30 | 31 | 2. 使用Code::Blocks打开QuantBox\_XAPI\_C\_Linux.workspace进行编译,注意得使用Clang编译器,会生成 32 | > **libQuantBox\_Queue.so**:C接口,消息队列,行情与交易的数据先进入队列然后,由内部的线程进行触发
33 | > **libQuantBox\_CTP\_Quote.so**:C接口,调用CTP的行情API
34 | > **libQuantBox\_CTP\_Trade.so**:C接口,调用CTP的交易API
35 | > 其它如XSpeed/LTS等行情与交易接口 36 | 37 | 3. 将所有生成的lib*.so文件cp命令复制到/usr/lib下 38 | 39 | 4. 将CTP的两个文件\*.so前面加lib复制到/usr/lib下 40 | 41 | ## 如何使用C++版 42 | 直接参考QuantBox_XAPI_TEST项目即可,简单的行情订阅,下单撤单 43 | 44 | ## 如何使用C版 45 | 参考QuantBox_XAPI这个项目中的CXApi与CXSpi是如何实现的 46 | 47 | ## 如何开发新的接口 48 | 1. 模仿已经提供的几个项目即可 49 | 50 | -------------------------------------------------------------------------------- /csharp/QuantBox.XAPI/Callback/XApi.Instrument.cs: -------------------------------------------------------------------------------- 1 | using QuantBox.XAPI.Interface; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Runtime.InteropServices; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace QuantBox.XAPI.Callback 10 | { 11 | public partial class XApi:IXInstrument 12 | { 13 | public DelegateOnRspQryInstrument OnRspQryInstrument 14 | { 15 | get { return OnRspQryInstrument_; } 16 | set { OnRspQryInstrument_ = value; } 17 | } 18 | private DelegateOnRspQryInstrument OnRspQryInstrument_; 19 | 20 | public void ReqQryInstrument(string szInstrument, string szExchange) 21 | { 22 | IntPtr szInstrumentPtr = Marshal.StringToHGlobalAnsi(szInstrument); 23 | IntPtr szExchangePtr = Marshal.StringToHGlobalAnsi(szExchange); 24 | 25 | proxy.XRequest((byte)RequestType.ReqQryInstrument, Handle, IntPtr.Zero, 0, 0, 26 | szInstrumentPtr, 0, szExchangePtr, 0, IntPtr.Zero, 0); 27 | 28 | Marshal.FreeHGlobal(szInstrumentPtr); 29 | Marshal.FreeHGlobal(szExchangePtr); 30 | } 31 | 32 | private void _OnRspQryInstrument(IntPtr ptr1,int size1, double double1) 33 | { 34 | if (OnRspQryInstrument_ == null) 35 | return; 36 | 37 | InstrumentField obj = PInvokeUtility.GetObjectFromIntPtr(ptr1); 38 | 39 | OnRspQryInstrument_(this, ref obj, size1, double1 != 0); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /csharp/QuantBox.XAPI/Delegate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace QuantBox.XAPI 9 | { 10 | public delegate void DelegateOnConnectionStatus(object sender, ConnectionStatus status, [In] ref RspUserLoginField userLogin, int size1); 11 | public delegate void DelegateOnRtnError(object sender, [In] ref ErrorField error); 12 | 13 | public delegate void DelegateOnRtnDepthMarketData(object sender, [In]ref DepthMarketDataNClass marketData); 14 | public delegate void DelegateOnRtnQuoteRequest(object sender, [In]ref QuoteRequestField quoteRequest); 15 | 16 | public delegate void DelegateOnRspQryInstrument(object sender, [In] ref InstrumentField instrument, int size1, bool bIsLast); 17 | public delegate void DelegateOnRspQryTradingAccount(object sender, [In] ref AccountField account, int size1, bool bIsLast); 18 | public delegate void DelegateOnRspQryInvestorPosition(object sender, [In] ref PositionField position, int size1, bool bIsLast); 19 | public delegate void DelegateOnRspQrySettlementInfo(object sender, [In] ref SettlementInfoField settlementInfo, int size1, bool bIsLast); 20 | public delegate void DelegateOnRspQryInvestor(object sender, [In] ref InvestorField investor, int size1, bool bIsLast); 21 | public delegate void DelegateOnRtnOrder(object sender, [In] ref OrderField order); 22 | public delegate void DelegateOnRtnTrade(object sender, [In] ref TradeField trade); 23 | public delegate void DelegateOnRtnQuote(object sender, [In] ref QuoteField quote); 24 | 25 | public delegate void DelegateOnRspQryHistoricalTicks(object sender, IntPtr pTicks, int size1, [In] ref HistoricalDataRequestField request, int size2, bool bIsLast); 26 | public delegate void DelegateOnRspQryHistoricalBars(object sender, IntPtr pBars, int size1, [In] ref HistoricalDataRequestField request, int size2, bool bIsLast); 27 | 28 | public delegate bool DelegateOnFilterSubscribe(object sender, ExchangeType exchange, int instrument_part1, int instrument_part2, int instrument_part3, IntPtr pInstrument); 29 | } 30 | -------------------------------------------------------------------------------- /csharp/QuantBox.XAPI/InvokeBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace QuantBox.XAPI 8 | { 9 | public class InvokeBase 10 | { 11 | protected IntPtr hLib = IntPtr.Zero; 12 | public virtual Delegate Invoke(String APIName, Type t) 13 | { 14 | return null; 15 | } 16 | 17 | public virtual void Dispose() 18 | { 19 | 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /csharp/QuantBox.XAPI/PositionFieldEx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace QuantBox.XAPI 8 | { 9 | public class PositionFieldEx 10 | { 11 | public string Symbol { get; private set; } 12 | public string Instrument { get; private set; } 13 | public string Exchange { get; private set; } 14 | 15 | public PositionField Long { get; private set; } 16 | public PositionField Short { get; private set; } 17 | 18 | public void AddPosition(PositionField position) 19 | { 20 | Symbol = position.Symbol; 21 | Instrument = position.InstrumentID; 22 | Exchange = position.ExchangeID; 23 | 24 | if (position.Side == PositionSide.Long) 25 | { 26 | Long = position; 27 | } 28 | else 29 | { 30 | Short = position; 31 | } 32 | } 33 | 34 | public double Qty 35 | { 36 | get { return Long.Position - Short.Position; } 37 | } 38 | public double LongQty 39 | { 40 | get { return Long.Position; } 41 | } 42 | public double ShortQty 43 | { 44 | get { return Short.Position; } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /csharp/QuantBox.XAPI/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("QuantBox.XAPI")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("QuantBox.XAPI")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("4a780d41-2861-4c6e-8cfc-f604b1ce2ace")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.2.0.1")] 36 | [assembly: AssemblyFileVersion("1.2.0.1")] 37 | -------------------------------------------------------------------------------- /csharp/QuantBox.XAPI/RequestType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace QuantBox.XAPI 8 | { 9 | public enum RequestType:byte 10 | { 11 | GetApiType = 0, 12 | GetApiVersion, 13 | GetApiName, 14 | 15 | Create, // 创建 16 | Release, // 销毁 17 | Register, // 注册回调 18 | Config, // 配置参数 19 | 20 | Connect, // 开始/连接 21 | Disconnect, // 停止/断开 22 | 23 | Clear, // 清理 24 | Process, // 处理 25 | 26 | Subscribe, // 订阅 27 | Unsubscribe, // 取消订阅 28 | 29 | SubscribeQuote, // 订阅应价 30 | UnsubscribeQuote, // 取消应价 31 | 32 | ReqOrderInsert, 33 | ReqQuoteInsert, 34 | ReqOrderAction, 35 | ReqQuoteAction, 36 | 37 | ReqQryOrder, 38 | ReqQryTrade, 39 | 40 | ReqQryInstrument, 41 | ReqQryTradingAccount, 42 | ReqQryInvestorPosition, 43 | ReqQryInvestorPositionDetail, 44 | ReqQryInstrumentCommissionRate, 45 | ReqQryInstrumentMarginRate, 46 | ReqQrySettlementInfo, 47 | 48 | ReqQryHistoricalTicks, 49 | ReqQryHistoricalBars, 50 | ReqQryInvestor, 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /csharp/QuantBox.XAPI/ResponeType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace QuantBox.XAPI 8 | { 9 | public enum ResponeType : byte 10 | { 11 | OnConnectionStatus = 64, 12 | OnRtnDepthMarketData, 13 | OnRtnError, 14 | OnRspQryInstrument, 15 | OnRspQryTradingAccount, 16 | OnRspQryInvestorPosition, 17 | OnRspQrySettlementInfo, 18 | OnRtnOrder, 19 | OnRtnTrade, 20 | OnRtnQuote, 21 | OnRtnQuoteRequest, 22 | 23 | OnRspQryHistoricalTicks, 24 | OnRspQryHistoricalBars, 25 | OnRspQryInvestor, 26 | 27 | OnFilterSubscribe, 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /csharp/QuantBox.XAPI/SoInvoke.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace QuantBox.XAPI 9 | { 10 | public class SoInvoke : InvokeBase 11 | { 12 | [DllImport("libdl.so")] 13 | private extern static IntPtr dlopen(string path, int mode); 14 | [DllImport("libdl.so")] 15 | private extern static IntPtr dlsym(IntPtr handle, string symbol); 16 | [DllImport("libdl.so")] 17 | private extern static IntPtr dlerror(); 18 | [DllImport("libdl.so")] 19 | private extern static int dlclose(IntPtr handle); 20 | 21 | public SoInvoke(string DLLPath) 22 | { 23 | hLib = dlopen(DLLPath, 1); 24 | if (hLib == IntPtr.Zero) 25 | { 26 | IntPtr errptr = dlerror(); 27 | string error = Marshal.PtrToStringAnsi(errptr); 28 | throw new Exception(error); 29 | } 30 | } 31 | ~SoInvoke() 32 | { 33 | Dispose(); 34 | } 35 | //将要执行的函数转换为委托 36 | public override Delegate Invoke(String APIName, Type t) 37 | { 38 | if (hLib == IntPtr.Zero) 39 | return (Delegate)null; 40 | 41 | IntPtr api = dlsym(hLib, APIName); 42 | return (Delegate)Marshal.GetDelegateForFunctionPointer(api, t); 43 | } 44 | 45 | public override void Dispose() 46 | { 47 | if (hLib != IntPtr.Zero) 48 | dlclose(hLib); 49 | hLib = IntPtr.Zero; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /csharp/QuantBox.XAPI/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /include/ApiDataType.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/ApiDataType.h -------------------------------------------------------------------------------- /include/ApiHeader.def: -------------------------------------------------------------------------------- 1 | ;LIBRARY ApiHeader 2 | EXPORTS 3 | XRequest @1 -------------------------------------------------------------------------------- /include/ApiHeader.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/ApiHeader.h -------------------------------------------------------------------------------- /include/ApiProcess.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "ApiProcess.h" 3 | 4 | void InitBidAsk(DepthMarketDataNField* pField) 5 | { 6 | pField->Size = sizeof(DepthMarketDataNField); 7 | pField->BidCount = 0; 8 | } 9 | 10 | int AddBid(DepthMarketDataNField* pField, PriceType price, VolumeType volume, VolumeType Count) 11 | { 12 | char* p = ((char*)pField) + pField->Size; 13 | DepthField* pDF = (DepthField*)p; 14 | pDF->Price = price; 15 | pDF->Size = volume; 16 | pDF->Count = Count; 17 | pField->Size += sizeof(DepthField); 18 | ++pField->BidCount; 19 | 20 | return 0; 21 | } 22 | 23 | int AddAsk(DepthMarketDataNField* pField, PriceType price, VolumeType volume, VolumeType Count) 24 | { 25 | char* p = ((char*)pField) + pField->Size; 26 | DepthField* pDF = (DepthField*)p; 27 | pDF->Price = price; 28 | pDF->Size = volume; 29 | pDF->Count = Count; 30 | pField->Size += sizeof(DepthField); 31 | 32 | return 0; 33 | } 34 | 35 | DepthField* GetBid(DepthMarketDataNField* pField, int Pos) 36 | { 37 | if (Pos <= 0 || Pos>pField->BidCount) 38 | return nullptr; 39 | 40 | char* p = ((char*)pField) + sizeof(DepthMarketDataNField); 41 | DepthField* pDF = (DepthField*)p; 42 | return pDF + Pos - 1; 43 | } 44 | 45 | DepthField* GetAsk(DepthMarketDataNField* pField, int Pos) 46 | { 47 | int count = (pField->Size - sizeof(DepthMarketDataNField)) / sizeof(DepthField); 48 | int AskCount = count - pField->BidCount; 49 | 50 | if (Pos <= 0 || Pos>AskCount) 51 | return nullptr; 52 | 53 | char* p = ((char*)pField) + sizeof(DepthMarketDataNField); 54 | DepthField* pDF = (DepthField*)p; 55 | return pDF + pField->BidCount + (Pos - 1); 56 | } -------------------------------------------------------------------------------- /include/ApiProcess.h: -------------------------------------------------------------------------------- 1 | #ifndef _API_PROCESS_H_ 2 | #define _API_PROCESS_H_ 3 | 4 | #include "../include/ApiStruct.h" 5 | 6 | // 先对行情数据进行初始化,然后才能进行 7 | void InitBidAsk(DepthMarketDataNField* pField); 8 | // 必须先AddBid才能AddAsk,先添加的是买一,然后才是买二 9 | int AddBid(DepthMarketDataNField* pField, PriceType price, VolumeType volume, VolumeType Count = 0); 10 | // 先添加的是卖一,然后才是卖二 11 | int AddAsk(DepthMarketDataNField* pField, PriceType price, VolumeType volume, VolumeType Count = 0); 12 | // 从结构体中读出买档,Pos=1是买一 13 | DepthField* GetBid(DepthMarketDataNField* pField, int Pos); 14 | // 从结构体中读出卖档,Pos=1是卖一 15 | DepthField* GetAsk(DepthMarketDataNField* pField, int Pos); 16 | 17 | #endif -------------------------------------------------------------------------------- /include/CTP/ThostFtdcMdApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/CTP/ThostFtdcMdApi.h -------------------------------------------------------------------------------- /include/CTP/ThostFtdcTraderApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/CTP/ThostFtdcTraderApi.h -------------------------------------------------------------------------------- /include/CTP/ThostFtdcUserApiDataType.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/CTP/ThostFtdcUserApiDataType.h -------------------------------------------------------------------------------- /include/CTP/ThostFtdcUserApiStruct.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/CTP/ThostFtdcUserApiStruct.h -------------------------------------------------------------------------------- /include/CTP/error.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /include/CTP/error.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/CTP/error.xml -------------------------------------------------------------------------------- /include/CTP/linux32/libthostmduserapi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/CTP/linux32/libthostmduserapi.so -------------------------------------------------------------------------------- /include/CTP/linux32/libthosttraderapi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/CTP/linux32/libthosttraderapi.so -------------------------------------------------------------------------------- /include/CTP/linux64/libthostmduserapi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/CTP/linux64/libthostmduserapi.so -------------------------------------------------------------------------------- /include/CTP/linux64/libthosttraderapi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/CTP/linux64/libthosttraderapi.so -------------------------------------------------------------------------------- /include/CTP/md5.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/CTP/md5.txt -------------------------------------------------------------------------------- /include/CTP/version.txt: -------------------------------------------------------------------------------- 1 | 20141217 64位windows 2 | 20141230 其它版本 3 | 20150324 个股期权版 -------------------------------------------------------------------------------- /include/CTP/win32/thostmduserapi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/CTP/win32/thostmduserapi.dll -------------------------------------------------------------------------------- /include/CTP/win32/thostmduserapi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/CTP/win32/thostmduserapi.lib -------------------------------------------------------------------------------- /include/CTP/win32/thosttraderapi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/CTP/win32/thosttraderapi.dll -------------------------------------------------------------------------------- /include/CTP/win32/thosttraderapi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/CTP/win32/thosttraderapi.lib -------------------------------------------------------------------------------- /include/ChinaStock.h: -------------------------------------------------------------------------------- 1 | #ifndef _CHINA_STOCK_H_ 2 | #define _CHINA_STOCK_H_ 3 | 4 | #include "../include/ApiStruct.h" 5 | 6 | // 上海证券交易所证券代码分配规则 7 | // http://wenku.baidu.com/link?url=fhnAW62VTXqHTn8p9xlyXKa_oDIfR2xIxBF3y_fryeoFnz7MFbeWJbMLx4n1H61ERFnhr6PtaxF_j01x8iIT0wArZzrBtABRysi-KEpBa9S 8 | 9 | // 深圳证券交易所证券代码编码方案 10 | // http://wenku.baidu.com/view/e41fba85ec3a87c24028c416.html 11 | 12 | 13 | InstrumentType InstrumentID_2_InstrumentType_SSE(int In); 14 | InstrumentType InstrumentID_2_InstrumentType_SZE(int In); 15 | InstrumentType InstrumentID_2_InstrumentType_NEEQ(int In); 16 | PriceType InstrumentID_2_PriceTick_SSE(int In); 17 | PriceType InstrumentID_2_PriceTick_SZE(int In); 18 | PriceType InstrumentID_2_PriceTick_NEEQ(int In); 19 | #endif -------------------------------------------------------------------------------- /include/CrossPlatform.h: -------------------------------------------------------------------------------- 1 | #ifndef _CROSS_PLATFORM_H_ 2 | #define _CROSS_PLATFORM_H_ 3 | 4 | #if defined _WIN32 || defined __CYGWIN__ 5 | #ifdef BUILDING_DLL 6 | #ifdef __GNUC__ 7 | #define DLL_PUBLIC __attribute__ ((dllexport)) 8 | #else 9 | #define DLL_PUBLIC __declspec(dllexport) // Note: actually gcc seems to also supports this syntax. 10 | #endif 11 | #else 12 | #ifdef __GNUC__ 13 | #define DLL_PUBLIC __attribute__ ((dllimport)) 14 | #else 15 | #define DLL_PUBLIC __declspec(dllimport) // Note: actually gcc seems to also supports this syntax. 16 | #endif 17 | #endif 18 | #define DLL_LOCAL 19 | #else 20 | #if __GNUC__ >= 4 21 | #define DLL_PUBLIC __attribute__ ((visibility ("default"))) 22 | #define DLL_LOCAL __attribute__ ((visibility ("hidden"))) 23 | #else 24 | #define DLL_PUBLIC 25 | #define DLL_LOCAL 26 | #endif 27 | 28 | #endif 29 | 30 | 31 | #endif // _CROSS_PLATFORM_H_ 32 | -------------------------------------------------------------------------------- /include/DFITC_L2/BasicDataType.h: -------------------------------------------------------------------------------- 1 | #ifndef __BASIC_DATA_TYPE__ 2 | #define __BASIC_DATA_TYPE__ 3 | 4 | typedef unsigned char BYTE; 5 | typedef unsigned short WORD; 6 | typedef unsigned long ULONG; 7 | typedef long LONG; 8 | typedef char INT1; 9 | typedef short INT2; 10 | typedef int INT4; 11 | typedef unsigned int UINT4; 12 | typedef float REAL4; 13 | typedef double REAL8; 14 | typedef int BOOL; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /include/DFITC_L2/DFITCL2Api.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/DFITC_L2/DFITCL2Api.h -------------------------------------------------------------------------------- /include/DFITC_L2/DFITCL2ApiDataType.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/DFITC_L2/DFITCL2ApiDataType.h -------------------------------------------------------------------------------- /include/DFITC_L2/linux64/liblevel2Api.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/DFITC_L2/linux64/liblevel2Api.so -------------------------------------------------------------------------------- /include/DFITC_L2/win32/level2Api.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/DFITC_L2/win32/level2Api.dll -------------------------------------------------------------------------------- /include/DFITC_L2/win32/level2Api.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/DFITC_L2/win32/level2Api.lib -------------------------------------------------------------------------------- /include/Esunny_HistoricalData/EsunnyQuot.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Esunny_HistoricalData/EsunnyQuot.h -------------------------------------------------------------------------------- /include/Esunny_HistoricalData/EsunnyQuot.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Esunny_HistoricalData/EsunnyQuot.lib -------------------------------------------------------------------------------- /include/Esunny_HistoricalData/EsunnyQuot_20110908.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Esunny_HistoricalData/EsunnyQuot_20110908.dll -------------------------------------------------------------------------------- /include/Esunny_HistoricalData/EsunnyQuot_20140812.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Esunny_HistoricalData/EsunnyQuot_20140812.dll -------------------------------------------------------------------------------- /include/Esunny_HistoricalData/win32/EsunnyQuot.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Esunny_HistoricalData/win32/EsunnyQuot.lib -------------------------------------------------------------------------------- /include/Esunny_HistoricalData/win32/EsunnyQuot_20110908.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Esunny_HistoricalData/win32/EsunnyQuot_20110908.dll -------------------------------------------------------------------------------- /include/Esunny_HistoricalData/win32/EsunnyQuot_20140812.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Esunny_HistoricalData/win32/EsunnyQuot_20140812.dll -------------------------------------------------------------------------------- /include/Esunny_HistoricalData/易盛行情接口说明.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Esunny_HistoricalData/易盛行情接口说明.pdf -------------------------------------------------------------------------------- /include/Femas/USTPFtdcMduserApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Femas/USTPFtdcMduserApi.h -------------------------------------------------------------------------------- /include/Femas/USTPFtdcTraderApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Femas/USTPFtdcTraderApi.h -------------------------------------------------------------------------------- /include/Femas/USTPFtdcUserApiDataType.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Femas/USTPFtdcUserApiDataType.h -------------------------------------------------------------------------------- /include/Femas/USTPFtdcUserApiStruct.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Femas/USTPFtdcUserApiStruct.h -------------------------------------------------------------------------------- /include/Femas/linux64/libUSTPmduserapi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Femas/linux64/libUSTPmduserapi.so -------------------------------------------------------------------------------- /include/Femas/linux64/libUSTPtraderapi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Femas/linux64/libUSTPtraderapi.so -------------------------------------------------------------------------------- /include/Femas/version.txt: -------------------------------------------------------------------------------- 1 | 2015413 v2.0 -------------------------------------------------------------------------------- /include/Femas/win32/USTPmduserapi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Femas/win32/USTPmduserapi.dll -------------------------------------------------------------------------------- /include/Femas/win32/USTPmduserapi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Femas/win32/USTPmduserapi.lib -------------------------------------------------------------------------------- /include/Femas/win32/USTPtraderapi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Femas/win32/USTPtraderapi.dll -------------------------------------------------------------------------------- /include/Femas/win32/USTPtraderapi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Femas/win32/USTPtraderapi.lib -------------------------------------------------------------------------------- /include/Kingstar/IncEx/KSCosApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar/IncEx/KSCosApi.h -------------------------------------------------------------------------------- /include/Kingstar/IncEx/KSMdApiEx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar/IncEx/KSMdApiEx.h -------------------------------------------------------------------------------- /include/Kingstar/IncEx/KSOptionApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar/IncEx/KSOptionApi.h -------------------------------------------------------------------------------- /include/Kingstar/IncEx/KSTraderApiEx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar/IncEx/KSTraderApiEx.h -------------------------------------------------------------------------------- /include/Kingstar/IncEx/KSUserApiDataTypeEx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar/IncEx/KSUserApiDataTypeEx.h -------------------------------------------------------------------------------- /include/Kingstar/IncEx/KSUserApiStructEx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar/IncEx/KSUserApiStructEx.h -------------------------------------------------------------------------------- /include/Kingstar/IncEx/KSVocApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar/IncEx/KSVocApi.h -------------------------------------------------------------------------------- /include/Kingstar/IncEx/KSVocApiDataType.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar/IncEx/KSVocApiDataType.h -------------------------------------------------------------------------------- /include/Kingstar/IncEx/KSVocApiStruct.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar/IncEx/KSVocApiStruct.h -------------------------------------------------------------------------------- /include/Kingstar/inc/KSMarketDataAPI.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar/inc/KSMarketDataAPI.h -------------------------------------------------------------------------------- /include/Kingstar/inc/KSTradeAPI.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar/inc/KSTradeAPI.h -------------------------------------------------------------------------------- /include/Kingstar/win32/KSMarketDataAPI.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar/win32/KSMarketDataAPI.dll -------------------------------------------------------------------------------- /include/Kingstar/win32/KSMarketDataAPI.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar/win32/KSMarketDataAPI.lib -------------------------------------------------------------------------------- /include/Kingstar/win32/KSTradeAPI.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar/win32/KSTradeAPI.dll -------------------------------------------------------------------------------- /include/Kingstar/win32/KSTradeAPI.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar/win32/KSTradeAPI.lib -------------------------------------------------------------------------------- /include/Kingstar/win32/SSPXEncode.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar/win32/SSPXEncode.dll -------------------------------------------------------------------------------- /include/Kingstar/win32/ksPortalAPI.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar/win32/ksPortalAPI.dll -------------------------------------------------------------------------------- /include/Kingstar/win32/lkcdll.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar/win32/lkcdll.dll -------------------------------------------------------------------------------- /include/Kingstar_Gold/APIError.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Gold/APIError.h -------------------------------------------------------------------------------- /include/Kingstar_Gold/Constant.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Gold/Constant.h -------------------------------------------------------------------------------- /include/Kingstar_Gold/GoldTradeApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Gold/GoldTradeApi.h -------------------------------------------------------------------------------- /include/Kingstar_Gold/KSUserApiDataTypeEx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Gold/KSUserApiDataTypeEx.h -------------------------------------------------------------------------------- /include/Kingstar_Gold/KSUserApiStructEx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Gold/KSUserApiStructEx.h -------------------------------------------------------------------------------- /include/Kingstar_Gold/win32/KSInterMG.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Gold/win32/KSInterMG.dll -------------------------------------------------------------------------------- /include/Kingstar_Gold/win32/KSLOG.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Gold/win32/KSLOG.dll -------------------------------------------------------------------------------- /include/Kingstar_Gold/win32/KSRsaCrypto.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Gold/win32/KSRsaCrypto.dll -------------------------------------------------------------------------------- /include/Kingstar_Gold/win32/SLEdll/KSCA/KS_SafeEngine.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Gold/win32/SLEdll/KSCA/KS_SafeEngine.dll -------------------------------------------------------------------------------- /include/Kingstar_Gold/win32/SLEdll/KSCA/SLE_KSCA.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Gold/win32/SLEdll/KSCA/SLE_KSCA.dll -------------------------------------------------------------------------------- /include/Kingstar_Gold/win32/SLEdll/KSCA/ksca/client.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDBTCCAe0CCQDlZanJ47kXxzANBgkqhkiG9w0BAQUFADCBjzELMAkGA1UEBhMC 3 | Y24xETAPBgNVBAgTCHNoYW5naGFpMREwDwYDVQQHEwhzaGFuZ2hhaTERMA8GA1UE 4 | ChMIa2luZ3N0YXIxCzAJBgNVBAsTAmtzMREwDwYDVQQDEwhraW5nc3RhcjEnMCUG 5 | CSqGSIb3DQEJARYYbGlhbmd0YW8uc3VuQHN1bmdhcmQuY29tMB4XDTExMDQxMTA2 6 | NTMxMloXDTIxMDQwODA2NTMxMlowfTELMAkGA1UEBhMCY24xCzAJBgNVBAgTAmNu 7 | MQswCQYDVQQHEwJjbjENMAsGA1UEChMEaWNiYzENMAsGA1UECxMEaWNiYzEUMBIG 8 | A1UEAxMLaWNiYyBjbGllbnQxIDAeBgkqhkiG9w0BCQEWEWNsaWVudEBjbGllbnQu 9 | Y29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCQsnbuLiW7Mm099AYutLAB 10 | 47F+CKWDuX2ITK2ZHfAntvdWZ1Z/O7EFwTXnA7TW0p6+2+YS/UzWZPWHdaLwh+NJ 11 | Cx4410vGTeOTyif2YiMd9TqIOmoDkXVdW+mekTZaEUbpcPN6h80m6x70oPbbxm1L 12 | ruSrp3AQBZV0ISPR+M1jdQIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQCnxN12S5i1 13 | LXbwtZ9twlup2JE+pT3kGBpqWN7Fyc9LHTlT/QY5mc6L5/P3CwIa3Od626Uac5WN 14 | m3orj8TOdUNJrt8dtx/vt8yaoy+LrtAWc4tuxFVAxLI64ZOvCAgGfTPAOT7vFYWI 15 | BmjX+WOYYU++uoxMhJY8+Z9X8eof6ZCePKAFa+aloTIJ7qjamaKjGK5Mj7vMGy+j 16 | OfyWClCdB/3HPYW1j5LkXeCxOhWNwbOQyPrUpRp8U+eIwAqCihXfWFpdsiX/Yk1e 17 | R7MLm2vqADq3HIIU66FE+hbymHktoJAoI//YJUnzMYeivEr1vpeZIIpbM+mWI1zv 18 | 5klUo5vHhocl 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /include/Kingstar_Gold/win32/SLEdll/KSCA/ksca/client.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | Proc-Type: 4,ENCRYPTED 3 | DEK-Info: DES-EDE3-CBC,8BA7989AF6F7AA86 4 | 5 | sEh+leE/EXXfxTBC/2bEOW2UOFpt19SrXR6/anGB0jXcXlcJIlv/o3qEDRlGsNXZ 6 | /5nTnWPuA4V406dw4/f76awTxD7yYhBSmryCaj16ajwruOmX3qHCeoiYjEbIBeMD 7 | YbllxbUdY9U6tQRV4pRTwhiCBh2aJxc89SmoffCy/ir0eEWUTKhf1d0Wi9BMDppg 8 | JrsLvIU/8BLvELiO9YdP4T2igPHbW/X5XCtLrwwBGZ9FbJEgS7Nxj3jkwvB2B6WR 9 | t+MKp8D1n9rTfTKM4ThLLdHMIxRnds3qwr3OGMoiGpjeo8YgktOrwRuqr4WjDhs8 10 | m+WBZMJpC3svh/bhc+db20FuZZKAo98zj2VwPNbR0p1vJDFJSM7xV4s1rVMwY8KW 11 | zfaBCoOrQztwr1wuvZ060fW4b8GKPMaUCazpdkvjyQuoNu/dwJ5duXryTkXAxvEd 12 | aBQtcw0kRFwbyyJD0EQx4xkgiWTEMURdYLoKKp0jfpSZWGnUyUgJbGq1H1rUEqgD 13 | JUUvylBzcxvLqlAkOurth3kzdeYBjoUrVoro9KBHaEi6O9uZvvXvoCRivUBYquUd 14 | Bcr3wD4YupAx52uZheGWHZkRPle3BJ4zB/p1gu2dl/ayvsICg5aE7sTkUe1YAuWk 15 | Jx9bJUDDmDVIqFa4VZRS32ZjgLUjck8HUkBV6EkxqSDboDTNoGUuGljiYHLKkdy0 16 | 1Mug2AUauXo8WTg9Xoq8cBjL4nslwm5vWGKKI31IobTDo03cFRNnFfXpgerQXanG 17 | h5dDd4AXZ6Ls5DHlqjGvnXbmHFiMvF+2Fx9z98ssvsXgKl+fYBI9hQ== 18 | -----END RSA PRIVATE KEY----- 19 | -------------------------------------------------------------------------------- /include/Kingstar_Gold/win32/SLEdll/KSCA/ksca/ksca.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEmzCCA4OgAwIBAgIJAPhIQpJyz3GhMA0GCSqGSIb3DQEBBQUAMIGPMQswCQYD 3 | VQQGEwJjbjERMA8GA1UECBMIc2hhbmdoYWkxETAPBgNVBAcTCHNoYW5naGFpMREw 4 | DwYDVQQKEwhraW5nc3RhcjELMAkGA1UECxMCa3MxETAPBgNVBAMTCGtpbmdzdGFy 5 | MScwJQYJKoZIhvcNAQkBFhhsaWFuZ3Rhby5zdW5Ac3VuZ2FyZC5jb20wHhcNMTEw 6 | NDExMDYzMjQxWhcNMjEwNDA4MDYzMjQxWjCBjzELMAkGA1UEBhMCY24xETAPBgNV 7 | BAgTCHNoYW5naGFpMREwDwYDVQQHEwhzaGFuZ2hhaTERMA8GA1UEChMIa2luZ3N0 8 | YXIxCzAJBgNVBAsTAmtzMREwDwYDVQQDEwhraW5nc3RhcjEnMCUGCSqGSIb3DQEJ 9 | ARYYbGlhbmd0YW8uc3VuQHN1bmdhcmQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOC 10 | AQ8AMIIBCgKCAQEA9JPCzpjiDBLT3BpZxFiBngOzNkR1kma/CjRGoJaFuPXOBA9S 11 | D7jpYF4Yxb5IlYajmtCY+EAYY1Q3peZUcLolvaHCFLCY76ehOU7Zfy0BVk4Da9Kw 12 | Ey8dTgJj6n/H0G7g2Tc1hy/FuTOi4Lgly3L99gp3vl76Lwd7c24C/f4HYuuMJrFQ 13 | IXq9ijaenyDGQj2XgxobMsJl6B6NB3Hafz79oi22WvqNjCMcURVzikgv8GhKieu0 14 | 5GPSv1hhreMUF/JnRsBJ9Gx8kXf9gIO0bNHi2BzUv73LuvT7tnbgYVokyIw9BI+K 15 | yJYRKjG6xvFHFhcwlk575Zopwuwr+QZP/s9UYwIDAQABo4H3MIH0MB0GA1UdDgQW 16 | BBQhx5NGyEPmN3ywGMizyHvXoHv4VTCBxAYDVR0jBIG8MIG5gBQhx5NGyEPmN3yw 17 | GMizyHvXoHv4VaGBlaSBkjCBjzELMAkGA1UEBhMCY24xETAPBgNVBAgTCHNoYW5n 18 | aGFpMREwDwYDVQQHEwhzaGFuZ2hhaTERMA8GA1UEChMIa2luZ3N0YXIxCzAJBgNV 19 | BAsTAmtzMREwDwYDVQQDEwhraW5nc3RhcjEnMCUGCSqGSIb3DQEJARYYbGlhbmd0 20 | YW8uc3VuQHN1bmdhcmQuY29tggkA+EhCknLPcaEwDAYDVR0TBAUwAwEB/zANBgkq 21 | hkiG9w0BAQUFAAOCAQEAe6S34KQYELQn433EbKrYaxe0t5fRrmkyZs6DVmReVt9n 22 | GUAfgZptcz3sbnLWJ9dJztS+LJmjWptmBlYt50v77wnrRknv6HvjpikMWuTQpmNu 23 | le+X+xv93IJ7ZJBq/PdoMurHsuhptNWNHO5XzDLP0ojoBBSiUnf3Spo1+hdXsDhb 24 | J8sjQhHywGTlM0CyWuezCnXUrqoS8Q6W/10mibOLOTIpwUC0eVF/Ww34jj9NHFhf 25 | u15CqWo9bzReP2asvWxmeFUleOzO/3rmW0ymPCS6JgVbgoF7EVxTXmwHCgU07ota 26 | OoG0Y/8F/8LULKmtnia5vkaivprMn7CUF/eHyyntJg== 27 | -----END CERTIFICATE----- 28 | -------------------------------------------------------------------------------- /include/Kingstar_Gold/win32/SLEdll/KSCA/ksca/ksca.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | Proc-Type: 4,ENCRYPTED 3 | DEK-Info: DES-EDE3-CBC,992E4B4C9103133C 4 | 5 | snqwb8vXf5EXsP1/ersDUy/Nq0EKbeLbKA+TaZw5nDOdFqD8rFDP+qzirEEP2ye9 6 | ylAQOJ9vKGFB9oQxpvYzRdTtOirN4S/jef3X1Q8Q63L1WQZb7m/l3uRIgY69X5NM 7 | cRHgPbiiMnkdForrfgTwxtIWUUfyQ6YwnzASe19rD6XztbTX/swyEKWR58pYQFVf 8 | eNraReMtK2Hkn2eyJF/Dg9Wr30ntsOcZgjxY1rw0/QIL6KeKF0Oy/CHzsU+lZYTB 9 | TnSdC1WKAV9oOaOtcz7ZrJaG6e6EPpEE5d7dS3lKui7Ih1t0jUeTwvF/ihpnfczs 10 | t0gS6AYCepLKQoKuHqSt0uWpbJftH3FTCOEnO3G9ggo6ExqZJI8hvMDGc1YBQrTt 11 | gLNujDXgxjykjJto+vbTYc+r39ZWxsNbIz3sMVX1naf1+3xuJvadQ08p7WR9c8RP 12 | i/xLsHn4rOnclo4O5Q0OMBmXJWGb9kNq/EaVFifddFDhW6o9yg+2P6uKgfdVQmQy 13 | TMp7uV7pme2QwqJ2FUyfrjEzpFQZEqEzVJs/IzggnH6dLlsRnJUAeB2mPhv03oIl 14 | r8xpelc980L1R4Q2Mk7GH/cNIeCThrqLXKGUab8RkjWfaVWtqvjdjhA1qrkib3UJ 15 | G+qL1ZKXK2C3WIKTCM9drdrvpo2IDJn9RZ3dq0cO8UtOS5kAjDFQXD7dl3dohNpD 16 | Fq8OsxAuUGdSP02OWbZneD6Wf36ddpWUt0IyO30Q238xh5zN95jdjF+gvFg6KUzV 17 | 7d+3cf+kO41nAO+5mRGrVLqI0Xs7nGrnWKc3demlOmnJp7Xt5mm6TlS1G51Dcehg 18 | 0OjaoBJASzamqAWJ52cVMMbDHJpbNFPbfd3Ye9p2Mnh8E0pwRNBjpy7WAVPWykEk 19 | T3sceRFljSCLUBkjf0u1ih14LpPjSSNmU+g4h5AXesVAzIU40SFpzyFVr/fj8a0o 20 | 2lkgC7nzUtn0BuIjLXavjdhGWb+s8kWzE0yV/jTGg8AtkW7PD0GzZ1bqGsCe6gDm 21 | JfLfym5jlrILwJMTH+vMNpNP6z1sEJ/XvcfWzTy18klOWovwdKMwlyM2rxn5mzU9 22 | gB3eVIpC1NuacxlvWzRJ9V94oH36zyWgmHMNy6UUEZlR6vOcobOAUqX0QDNC5yl4 23 | RiZukMGU6ftAuw4zIImei7XQU5eDDm6nJuiCeGyDkt8ZokAjTSluRQFckohaF87l 24 | ZWbg8Vwout8wClJ8Niky3+XVOFV2IMQrRn8olAuZQr3ARuDlyKgernpwTTfsCQLM 25 | iKeO/wQAaeynBXtX0dVpiohsBsawBVHjDWq+Yi+ZZKzx9z5uto8wJ450Um1o0Ilz 26 | ASITx5fcV+oDxG13arez+iWt5Shf2whlej8vsqlMx7pIjbq5fg/Q71LQb0JYEOEf 27 | lnTm8a/tPLwuuht1+5WXGCg5tZ9dtbn0ROpaQpLmej1IjnJ6L2ZH66+66Mu/RpUY 28 | BqpcWkiZKhtt82dKbGtZ0lgaCmQScKEhRGm+yBK5rhrw1j+tU3BssK5cdsLgXvGm 29 | NuTFnXZMUVNpQInc+53gGx+lZsYg1LFHIPjMbjTW83ooXXrW8kRvNA== 30 | -----END RSA PRIVATE KEY----- 31 | -------------------------------------------------------------------------------- /include/Kingstar_Gold/win32/SLEdll/KSCA/ksca/server.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIC+jCCAeICCQDlZanJ47kXyDANBgkqhkiG9w0BAQUFADCBjzELMAkGA1UEBhMC 3 | Y24xETAPBgNVBAgTCHNoYW5naGFpMREwDwYDVQQHEwhzaGFuZ2hhaTERMA8GA1UE 4 | ChMIa2luZ3N0YXIxCzAJBgNVBAsTAmtzMREwDwYDVQQDEwhraW5nc3RhcjEnMCUG 5 | CSqGSIb3DQEJARYYbGlhbmd0YW8uc3VuQHN1bmdhcmQuY29tMB4XDTExMDQxMTA3 6 | MDA1MFoXDTIxMDQwODA3MDA1MFowcjELMAkGA1UEBhMCY24xCzAJBgNVBAgTAmJq 7 | MQswCQYDVQQHEwJiajENMAsGA1UEChMEaWNiYzENMAsGA1UECxMEaWNiYzENMAsG 8 | A1UEAxMEaWNiYzEcMBoGCSqGSIb3DQEJARYNaWNiY0BpY2JjLmNvbTCBnzANBgkq 9 | hkiG9w0BAQEFAAOBjQAwgYkCgYEAz8thS2+22rxPzmcmvGIiUuo+pKTglZyGX8zg 10 | AJMIUEoZodFawuBKiLmghVSebL7LsXOuqh7QtL1TBnX7Ob+yxT8ORiotgMpaNlcF 11 | cJPYpeVlQ1JnnCgXWcbtXL0/XdHCvyVQmhzikL2F5f3ONNzbG3hkm2BZtaqSbRyW 12 | RGcAtI0CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAXlK6gp+WWetG86TIjMPL7GoI 13 | RTlQJgBiAueg5eSDBxSwH1LxAsBUjCmrPu75pqPCziFk9L4m4tIS8Fj/+fprqt4Z 14 | VmGjBiGi0Gyd29EvZQ/xDCejJVk/UY9EBYCQOhAMMxX5zNo0CGeYDDRp9/2GzRWb 15 | vuPy9UORqyN6eeZ9F3pCF7N4UxIWkwe/TGVVqoa/49dmJz//R5pG5b+roALUSUjd 16 | S5xXOMhh2XrnGv+m83kDIR//GKfHvlXByakJXK5QN0SnK31R8Vx5yrJsLhBuO6xl 17 | cEptDeShg8Qb+dIHAPk2n4FQ8EdQ/QcSDRAr15q8I/mQrgKg9VLCLgUt5b5hww== 18 | -----END CERTIFICATE----- 19 | -------------------------------------------------------------------------------- /include/Kingstar_Gold/win32/SLEdll/KSCA/ksca/server.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | Proc-Type: 4,ENCRYPTED 3 | DEK-Info: DES-EDE3-CBC,88F693FD0F362212 4 | 5 | FASYVUUP5rX7H1jkrladPQxTmdjfQ1gCOL/GtityDevQhoU5KHieG+EzpZIBKX/e 6 | KAjtf0bwbT4zsbovlZuFGGM8ok1Myp1bHl7ye9+ZfA527u2sH028mw1HYv6OwvH1 7 | fQ0tSX6kyAvvv6FdkiFhD3CGtnJa1QvXotHhTi3qE1A/bimnHypZW87u/naHlxEL 8 | jG56cCmlKuO3FNPkXFl09VrPRBy2aF+7g/qzAEEUaL3Ua8QHyX16AfzA20WSgWzE 9 | JyrOTIAf70hT+edeR9OzYBs5j4GNhetZB1dVCg1JjsnF/wVIUOWvPN5eC2vp9Ntg 10 | q5+b3yHLwEqy8J2bg45RF724U7d7JdhP7REhISFtrp+PNn10awJG9azcOUN1LbkA 11 | ncvuRUfbptRKYwIuYvihmPB6HCrIFlE2mv/ehaUd4leEaLJ7PRW622wpSUXa50Pf 12 | GEVC8Tr+T5Vgut5+FyOEqw1w6k+Z9CWUc1cafnc9IVI6HDLSnB+cOTFoi3BTIeci 13 | l4TbUO683o9I66MbTF+Wsu0OQ/2f353GbptTH44/0bnMIWTPhf/k4MH23p/doUej 14 | 4N78UorNWv5sl4WKOo8/f4IC8MEk+QXkwHHrcu5ix5E83yDRYN/JNmaZ9OdST0J3 15 | MF09yLwd46QzrVVCmvu5T840PIWlbht27InGEYDxbIaJ8V4oqoJP4pUnqOxG3lT9 16 | BPQOnk1uo5k4On+oKpGyAAqaOyLjOh/bEGbFYgCZ9fPKPRwXpSzsSh2xZW1U+dlL 17 | R4W3/0LdjY/HXQhM92lHVe8iFEh07O1umNgw0W/rP9sjkAS3yyjxpw== 18 | -----END RSA PRIVATE KEY----- 19 | -------------------------------------------------------------------------------- /include/Kingstar_Gold/win32/SLEdll/KSCA/libeay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Gold/win32/SLEdll/KSCA/libeay32.dll -------------------------------------------------------------------------------- /include/Kingstar_Gold/win32/SLEdll/KSCA/libssl32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Gold/win32/SLEdll/KSCA/libssl32.dll -------------------------------------------------------------------------------- /include/Kingstar_Gold/win32/SLEdll/KSCA/ssleay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Gold/win32/SLEdll/KSCA/ssleay32.dll -------------------------------------------------------------------------------- /include/Kingstar_Gold/win32/SLEdll/SafeLoginEngine.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Gold/win32/SLEdll/SafeLoginEngine.ini -------------------------------------------------------------------------------- /include/Kingstar_Gold/win32/goldtradeapi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Gold/win32/goldtradeapi.dll -------------------------------------------------------------------------------- /include/Kingstar_Gold/win32/goldtradeapi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Gold/win32/goldtradeapi.lib -------------------------------------------------------------------------------- /include/Kingstar_Gold/win32/ksSafeLoginEngineG.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Gold/win32/ksSafeLoginEngineG.dll -------------------------------------------------------------------------------- /include/Kingstar_Gold/win32/xSafeEngine.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Gold/win32/xSafeEngine.dll -------------------------------------------------------------------------------- /include/Kingstar_Stock/SPXAPI.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Stock/SPXAPI.h -------------------------------------------------------------------------------- /include/Kingstar_Stock/SPXAPI_struct.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Stock/SPXAPI_struct.h -------------------------------------------------------------------------------- /include/Kingstar_Stock/SPXAPI_type.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Stock/SPXAPI_type.h -------------------------------------------------------------------------------- /include/Kingstar_Stock/win32/JGJRGL.lkc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Stock/win32/JGJRGL.lkc -------------------------------------------------------------------------------- /include/Kingstar_Stock/win32/SPXAPI.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Stock/win32/SPXAPI.dll -------------------------------------------------------------------------------- /include/Kingstar_Stock/win32/SPXAPI.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Stock/win32/SPXAPI.lib -------------------------------------------------------------------------------- /include/Kingstar_Stock/win32/SPXInter.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/Kingstar_Stock/win32/SPXInter.dll -------------------------------------------------------------------------------- /include/LTS/SecurityFtdcMdApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/LTS/SecurityFtdcMdApi.h -------------------------------------------------------------------------------- /include/LTS/SecurityFtdcTraderApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/LTS/SecurityFtdcTraderApi.h -------------------------------------------------------------------------------- /include/LTS/SecurityFtdcUserApiDataType.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/LTS/SecurityFtdcUserApiDataType.h -------------------------------------------------------------------------------- /include/LTS/SecurityFtdcUserApiStruct.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/LTS/SecurityFtdcUserApiStruct.h -------------------------------------------------------------------------------- /include/LTS/linux64/libsecuritymduserapi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/LTS/linux64/libsecuritymduserapi.so -------------------------------------------------------------------------------- /include/LTS/linux64/libsecuritytraderapi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/LTS/linux64/libsecuritytraderapi.so -------------------------------------------------------------------------------- /include/LTS/version.txt: -------------------------------------------------------------------------------- 1 | 20150402 -------------------------------------------------------------------------------- /include/LTS/win32/securitymduserapi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/LTS/win32/securitymduserapi.dll -------------------------------------------------------------------------------- /include/LTS/win32/securitymduserapi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/LTS/win32/securitymduserapi.lib -------------------------------------------------------------------------------- /include/LTS/win32/securitytraderapi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/LTS/win32/securitytraderapi.dll -------------------------------------------------------------------------------- /include/LTS/win32/securitytraderapi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/LTS/win32/securitytraderapi.lib -------------------------------------------------------------------------------- /include/LTS_L2/LTS_ns.h: -------------------------------------------------------------------------------- 1 | #ifndef _LTS_NAMESPACE_H 2 | #define _LTS_NAMESPACE_H 3 | 4 | #define _LTS_NS_ _LTS_ 5 | #define _LTS_NS_BEGIN_ namespace _LTS_{ 6 | #define _LTS_NS_END_ } 7 | #define _USING_LTS_NS_ using namespace _LTS_; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /include/LTS_L2/SecurityFtdcL2MDUserApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/LTS_L2/SecurityFtdcL2MDUserApi.h -------------------------------------------------------------------------------- /include/LTS_L2/SecurityFtdcL2MDUserApiDataType.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/LTS_L2/SecurityFtdcL2MDUserApiDataType.h -------------------------------------------------------------------------------- /include/LTS_L2/SecurityFtdcL2MDUserApiStruct.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/LTS_L2/SecurityFtdcL2MDUserApiStruct.h -------------------------------------------------------------------------------- /include/LTS_L2/linux64/libL2mduserapi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/LTS_L2/linux64/libL2mduserapi.so -------------------------------------------------------------------------------- /include/LTS_L2/version.txt: -------------------------------------------------------------------------------- 1 | 20140424 -------------------------------------------------------------------------------- /include/LTS_L2/win32/L2mduserapi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/LTS_L2/win32/L2mduserapi.dll -------------------------------------------------------------------------------- /include/LTS_L2/win32/L2mduserapi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/LTS_L2/win32/L2mduserapi.lib -------------------------------------------------------------------------------- /include/QueueEnum.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/QueueEnum.h -------------------------------------------------------------------------------- /include/QueueHeader.h: -------------------------------------------------------------------------------- 1 | #ifndef _QUEUE_HEADER_H_ 2 | #define _QUEUE_HEADER_H_ 3 | 4 | #include "../include/CrossPlatform.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | typedef void* (__stdcall *fnOnRespone) (char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1,int size1, void* ptr2,int size2, void* ptr3,int size3); 11 | 12 | //DLL_PUBLIC void* __stdcall XRespone(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | #endif//end of _QUEUE_HEADER_H_ 18 | -------------------------------------------------------------------------------- /include/QueueStruct.h: -------------------------------------------------------------------------------- 1 | #ifndef _QUEUE_STRUCT_H_ 2 | #define _QUEUE_STRUCT_H_ 3 | 4 | struct ResponeItem 5 | { 6 | char type; // (RequestType) 7 | 8 | void* pApi1; // 执行者,不能delete 9 | void* pApi2; // 源头,不能delete 10 | 11 | double double1; 12 | double double2; 13 | 14 | void* ptr1; // 需要delete 15 | int size1; 16 | void* ptr2; // 需要delete 17 | int size2; 18 | void* ptr3; // 需要delete 19 | int size3; 20 | 21 | bool bNeedDelete; 22 | }; 23 | 24 | #endif//end of _QUEUE_HEADER_H_ 25 | -------------------------------------------------------------------------------- /include/XApiC.def: -------------------------------------------------------------------------------- 1 | ;LIBRARY XApiC 2 | EXPORTS 3 | X_LoadLib @1 4 | X_GetLastError @2 5 | X_GetFunction @3 6 | X_FreeLib @4 7 | 8 | X_GetApiType @5 9 | X_GetApiVersion @6 10 | X_GetApiName @7 11 | 12 | X_Create @8 13 | X_Register @9 14 | X_Connect @10 15 | X_Disconnect @11 16 | X_Subscribe @12 17 | X_Unsubscribe @13 18 | 19 | X_SubscribeQuote @14 20 | X_UnsubscribeQuote @15 21 | X_ReqQryInstrument @16 22 | X_ReqQryInvestorPosition @17 23 | X_ReqQryTradingAccount @18 24 | 25 | X_SendOrder @19 26 | X_CancelOrder @20 27 | X_SendQuote @21 28 | X_CancelQuote @22 -------------------------------------------------------------------------------- /include/XApiC.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../include/ApiStruct.h" 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | void* X_LoadLib(char* libPath); 10 | char* X_GetLastError(); 11 | void* X_GetFunction(void* lib, char* ProcName = "XRequest"); 12 | void X_FreeLib(void* lib); 13 | 14 | ApiType X_GetApiType(void* pFun); 15 | char* X_GetApiVersion(void* pFun); 16 | char* X_GetApiName(void* pFun); 17 | 18 | void* X_Create(void* pFun); 19 | void X_Register(void* pFun, void* pApi, void* pCallback, void* pClass); 20 | 21 | void X_Connect(void* pFun, void* pApi, char* szPath, ServerInfoField* pServerInfo, UserInfoField* pUserInfo, int count); 22 | void X_Disconnect(void* pFun, void* pApi); 23 | 24 | void X_Subscribe(void* pFun, void* pApi, char* szInstrument, char* szExchange); 25 | void X_Unsubscribe(void* pFun, void* pApi, char* szInstrument, char* szExchange); 26 | void X_SubscribeQuote(void* pFun, void* pApi, char* szInstrument, char* szExchange); 27 | void X_UnsubscribeQuote(void* pFun, void* pApi, char* szInstrument, char* szExchange); 28 | 29 | void X_ReqQryInstrument(void* pFun, void* pApi, char* szInstrument, char* szExchange); 30 | void X_ReqQryInvestorPosition(void* pFun, void* pApi, char* szInstrument, char* szExchange); 31 | void X_ReqQryTradingAccount(void* pFun, void* pApi); 32 | 33 | void X_SendOrder(void* pFun, void* pApi, OrderField* pOrder, OrderIDType* pInOut, int count); 34 | void X_CancelOrder(void* pFun, void* pApi, OrderIDType* pIn, OrderIDType* pOut, int count); 35 | 36 | void X_SendQuote(void* pFun, void* pApi, QuoteField* pQuote, OrderIDType* pAskOut, OrderIDType* pBidOut, int count); 37 | void X_CancelQuote(void* pFun, void* pApi, OrderIDType* pIn, OrderIDType* pOut, int count); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | -------------------------------------------------------------------------------- /include/XSpeed/DFITCApiDataType.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/XSpeed/DFITCApiDataType.h -------------------------------------------------------------------------------- /include/XSpeed/DFITCApiStruct.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/XSpeed/DFITCApiStruct.h -------------------------------------------------------------------------------- /include/XSpeed/DFITCMdApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/XSpeed/DFITCMdApi.h -------------------------------------------------------------------------------- /include/XSpeed/DFITCTraderApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/XSpeed/DFITCTraderApi.h -------------------------------------------------------------------------------- /include/XSpeed/error.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /include/XSpeed/error.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/XSpeed/error.xml -------------------------------------------------------------------------------- /include/XSpeed/linux64/libDFITCMdApi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/XSpeed/linux64/libDFITCMdApi.so -------------------------------------------------------------------------------- /include/XSpeed/linux64/libDFITCTraderApi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/XSpeed/linux64/libDFITCTraderApi.so -------------------------------------------------------------------------------- /include/XSpeed/version.txt: -------------------------------------------------------------------------------- 1 | 20150409 2 | XSpeedAPI_V1.0.9.13_sp5 -------------------------------------------------------------------------------- /include/XSpeed/win32/DFITCMdApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/XSpeed/win32/DFITCMdApi.dll -------------------------------------------------------------------------------- /include/XSpeed/win32/DFITCMdApi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/XSpeed/win32/DFITCMdApi.lib -------------------------------------------------------------------------------- /include/XSpeed/win32/DFITCTraderApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/XSpeed/win32/DFITCTraderApi.dll -------------------------------------------------------------------------------- /include/XSpeed/win32/DFITCTraderApi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/XSpeed/win32/DFITCTraderApi.lib -------------------------------------------------------------------------------- /include/XSpeed_Stock/DFITCSECApiDataType.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/XSpeed_Stock/DFITCSECApiDataType.h -------------------------------------------------------------------------------- /include/XSpeed_Stock/DFITCSECApiStruct.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/XSpeed_Stock/DFITCSECApiStruct.h -------------------------------------------------------------------------------- /include/XSpeed_Stock/DFITCSECMdApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/XSpeed_Stock/DFITCSECMdApi.h -------------------------------------------------------------------------------- /include/XSpeed_Stock/DFITCSECTraderApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/XSpeed_Stock/DFITCSECTraderApi.h -------------------------------------------------------------------------------- /include/XSpeed_Stock/error.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /include/XSpeed_Stock/error.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/XSpeed_Stock/error.xml -------------------------------------------------------------------------------- /include/XSpeed_Stock/version.txt: -------------------------------------------------------------------------------- 1 | 20150122 2 | 3 | v1.3.2.0 -------------------------------------------------------------------------------- /include/XSpeed_Stock/win32/DFITCSECMdApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/XSpeed_Stock/win32/DFITCSECMdApi.dll -------------------------------------------------------------------------------- /include/XSpeed_Stock/win32/DFITCSECMdApi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/XSpeed_Stock/win32/DFITCSECMdApi.lib -------------------------------------------------------------------------------- /include/XSpeed_Stock/win32/DFITCSECTraderApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/XSpeed_Stock/win32/DFITCSECTraderApi.dll -------------------------------------------------------------------------------- /include/XSpeed_Stock/win32/DFITCSECTraderApi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/XSpeed_Stock/win32/DFITCSECTraderApi.lib -------------------------------------------------------------------------------- /include/ZeroMQ/ZeroMQ.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/ZeroMQ/ZeroMQ.zip -------------------------------------------------------------------------------- /include/ZeroMQ/x86/czmq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/ZeroMQ/x86/czmq.dll -------------------------------------------------------------------------------- /include/ZeroMQ/x86/czmq.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/ZeroMQ/x86/czmq.lib -------------------------------------------------------------------------------- /include/ZeroMQ/x86/libsodium.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/ZeroMQ/x86/libsodium.dll -------------------------------------------------------------------------------- /include/ZeroMQ/x86/libzmq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/ZeroMQ/x86/libzmq.dll -------------------------------------------------------------------------------- /include/ZeroMQ/x86/libzmq.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/ZeroMQ/x86/libzmq.lib -------------------------------------------------------------------------------- /include/ZeroMQ/说明.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/include/ZeroMQ/说明.txt -------------------------------------------------------------------------------- /include/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | //#include "targetver.h" 9 | // 10 | //#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | //// Windows Header Files: 12 | //#include 13 | 14 | // TODO: reference additional headers your program requires here 15 | #if defined _WIN32 || WIN32 || _WINDOWS 16 | #include "targetver.h" 17 | 18 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 19 | // Windows Header Files: 20 | #include 21 | #else 22 | 23 | #endif // defined -------------------------------------------------------------------------------- /include/toolkit.h: -------------------------------------------------------------------------------- 1 | #ifndef _TOOLKIT_H_ 2 | #define _TOOLKIT_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | using namespace std; 9 | 10 | void WriteLog(const char *fmt, ...); 11 | 12 | //输入路径,生成多级目录 13 | void makedirs(const char* dir); 14 | 15 | //将字符串按指定字符分割 16 | typedef void fnGetSetFromStringProcess(char* token); 17 | char* GetSetFromString(const char* szString, const char* seps, vector& vct, set& st, int modify, set& st2, int before = 1, const char* prefix = nullptr); 18 | 19 | int GetUpdateTime(char* UpdateTime, int* _UpdateTime, int* UpdateMillisec); 20 | void GetExchangeTime_CZCE(int iTradingDay, char* TradingDay, char* ActionDay, char* UpdateTime, int* _TradingDay, int* _ActionDay, int* _UpdateTime, int* UpdateMillisec); 21 | void GetExchangeTime_Undefined(int iTradingDay, char* TradingDay, char* ActionDay, char* UpdateTime, int* _TradingDay, int* _ActionDay, int* _UpdateTime, int* UpdateMillisec); 22 | void GetExchangeTime_DCE(char* TradingDay, char* ActionDay, char* UpdateTime, int* _TradingDay, int* _ActionDay, int* _UpdateTime, int* UpdateMillisec); 23 | void GetExchangeTime(char* TradingDay, char* ActionDay, char* UpdateTime, int* _TradingDay, int* _ActionDay, int* _UpdateTime, int* UpdateMillisec); 24 | void GetExchangeTime(time_t Time, int* _TradingDay, int* _ActionDay, int* _UpdateTime); 25 | 26 | int GetDate(char* TradingDay); 27 | int GetTime(char* UpdateTime); 28 | 29 | double my_round(float val, int x = 0); 30 | 31 | //根据OnFrontDisconnected(int nReason)的值填上错误消息 32 | void GetOnFrontDisconnectedMsg(int ErrorId, char* ErrorMsg); 33 | 34 | #endif -------------------------------------------------------------------------------- /lib/QuantBox_Queue_x86.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/lib/QuantBox_Queue_x86.lib -------------------------------------------------------------------------------- /lib/QuantBox_XAPI.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonweiyi/xapi_python/65ccba28403bcb8b4c1a748854acbaa645d25332/lib/QuantBox_XAPI.lib -------------------------------------------------------------------------------- /packages/repositories.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | --------------------------------------------------------------------------------