ctpbee-opt-api 0.1.0__cp312-cp312-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ctpbee_api/__init__.py +17 -0
- ctpbee_api/ctp/__init__.py +3 -0
- ctpbee_api/ctp/ctp_constant.py +1253 -0
- ctpbee_api/ctp/generator/concat.py +93 -0
- ctpbee_api/ctp/generator/const.py +325 -0
- ctpbee_api/ctp/generator/ctp_constant.py +1274 -0
- ctpbee_api/ctp/generator/ctp_md_header_define.h +13 -0
- ctpbee_api/ctp/generator/ctp_md_header_function.h +6 -0
- ctpbee_api/ctp/generator/ctp_md_header_on.h +26 -0
- ctpbee_api/ctp/generator/ctp_md_header_process.h +26 -0
- ctpbee_api/ctp/generator/ctp_md_source_function.cpp +42 -0
- ctpbee_api/ctp/generator/ctp_md_source_module.cpp +18 -0
- ctpbee_api/ctp/generator/ctp_md_source_on.cpp +156 -0
- ctpbee_api/ctp/generator/ctp_md_source_process.cpp +282 -0
- ctpbee_api/ctp/generator/ctp_md_source_switch.cpp +78 -0
- ctpbee_api/ctp/generator/ctp_md_source_task.cpp +211 -0
- ctpbee_api/ctp/generator/ctp_struct.py +5640 -0
- ctpbee_api/ctp/generator/ctp_td_header_define.h +130 -0
- ctpbee_api/ctp/generator/ctp_td_header_function.h +174 -0
- ctpbee_api/ctp/generator/ctp_td_header_on.h +260 -0
- ctpbee_api/ctp/generator/ctp_td_header_process.h +260 -0
- ctpbee_api/ctp/generator/ctp_td_source_function.cpp +1456 -0
- ctpbee_api/ctp/generator/ctp_td_source_module.cpp +222 -0
- ctpbee_api/ctp/generator/ctp_td_source_on.cpp +1572 -0
- ctpbee_api/ctp/generator/ctp_td_source_process.cpp +5472 -0
- ctpbee_api/ctp/generator/ctp_td_source_switch.cpp +780 -0
- ctpbee_api/ctp/generator/ctp_td_source_task.cpp +2444 -0
- ctpbee_api/ctp/generator/ctp_typedef.py +800 -0
- ctpbee_api/ctp/generator/generate_api_functions.py +345 -0
- ctpbee_api/ctp/generator/generate_data_type.py +76 -0
- ctpbee_api/ctp/generator/generate_struct.py +84 -0
- ctpbee_api/ctp/include/mac/ctp/ThostFtdcMdApi.h +168 -0
- ctpbee_api/ctp/include/mac/ctp/ThostFtdcTraderApi.h +770 -0
- ctpbee_api/ctp/include/mac/ctp/ThostFtdcUserApiDataType.h +6878 -0
- ctpbee_api/ctp/include/mac/ctp/ThostFtdcUserApiStruct.h +10915 -0
- ctpbee_api/ctp/include/mac/pybind11/attr.h +690 -0
- ctpbee_api/ctp/include/mac/pybind11/buffer_info.h +208 -0
- ctpbee_api/ctp/include/mac/pybind11/cast.h +1704 -0
- ctpbee_api/ctp/include/mac/pybind11/chrono.h +225 -0
- ctpbee_api/ctp/include/mac/pybind11/common.h +2 -0
- ctpbee_api/ctp/include/mac/pybind11/complex.h +74 -0
- ctpbee_api/ctp/include/mac/pybind11/detail/class.h +743 -0
- ctpbee_api/ctp/include/mac/pybind11/detail/common.h +1255 -0
- ctpbee_api/ctp/include/mac/pybind11/detail/descr.h +171 -0
- ctpbee_api/ctp/include/mac/pybind11/detail/init.h +434 -0
- ctpbee_api/ctp/include/mac/pybind11/detail/internals.h +656 -0
- ctpbee_api/ctp/include/mac/pybind11/detail/type_caster_base.h +1177 -0
- ctpbee_api/ctp/include/mac/pybind11/detail/typeid.h +65 -0
- ctpbee_api/ctp/include/mac/pybind11/eigen/common.h +9 -0
- ctpbee_api/ctp/include/mac/pybind11/eigen/matrix.h +714 -0
- ctpbee_api/ctp/include/mac/pybind11/eigen/tensor.h +516 -0
- ctpbee_api/ctp/include/mac/pybind11/eigen.h +12 -0
- ctpbee_api/ctp/include/mac/pybind11/embed.h +316 -0
- ctpbee_api/ctp/include/mac/pybind11/eval.h +156 -0
- ctpbee_api/ctp/include/mac/pybind11/functional.h +137 -0
- ctpbee_api/ctp/include/mac/pybind11/gil.h +239 -0
- ctpbee_api/ctp/include/mac/pybind11/iostream.h +265 -0
- ctpbee_api/ctp/include/mac/pybind11/numpy.h +1998 -0
- ctpbee_api/ctp/include/mac/pybind11/operators.h +202 -0
- ctpbee_api/ctp/include/mac/pybind11/options.h +92 -0
- ctpbee_api/ctp/include/mac/pybind11/pybind11.h +2890 -0
- ctpbee_api/ctp/include/mac/pybind11/pytypes.h +2557 -0
- ctpbee_api/ctp/include/mac/pybind11/stl/filesystem.h +116 -0
- ctpbee_api/ctp/include/mac/pybind11/stl.h +447 -0
- ctpbee_api/ctp/include/mac/pybind11/stl_bind.h +851 -0
- ctpbee_api/ctp/include/mac/pybind11/type_caster_pyobject_ptr.h +61 -0
- ctpbee_api/ctp/include/new/ctp/ThostFtdcMdApi.h +168 -0
- ctpbee_api/ctp/include/new/ctp/ThostFtdcTraderApi.h +770 -0
- ctpbee_api/ctp/include/new/ctp/ThostFtdcUserApiDataType.h +6878 -0
- ctpbee_api/ctp/include/new/ctp/ThostFtdcUserApiStruct.h +10915 -0
- ctpbee_api/ctp/include/new/pybind11/attr.h +690 -0
- ctpbee_api/ctp/include/new/pybind11/buffer_info.h +208 -0
- ctpbee_api/ctp/include/new/pybind11/cast.h +1704 -0
- ctpbee_api/ctp/include/new/pybind11/chrono.h +225 -0
- ctpbee_api/ctp/include/new/pybind11/common.h +2 -0
- ctpbee_api/ctp/include/new/pybind11/complex.h +74 -0
- ctpbee_api/ctp/include/new/pybind11/detail/class.h +743 -0
- ctpbee_api/ctp/include/new/pybind11/detail/common.h +1255 -0
- ctpbee_api/ctp/include/new/pybind11/detail/descr.h +171 -0
- ctpbee_api/ctp/include/new/pybind11/detail/init.h +434 -0
- ctpbee_api/ctp/include/new/pybind11/detail/internals.h +656 -0
- ctpbee_api/ctp/include/new/pybind11/detail/type_caster_base.h +1177 -0
- ctpbee_api/ctp/include/new/pybind11/detail/typeid.h +65 -0
- ctpbee_api/ctp/include/new/pybind11/eigen/common.h +9 -0
- ctpbee_api/ctp/include/new/pybind11/eigen/matrix.h +714 -0
- ctpbee_api/ctp/include/new/pybind11/eigen/tensor.h +516 -0
- ctpbee_api/ctp/include/new/pybind11/eigen.h +12 -0
- ctpbee_api/ctp/include/new/pybind11/embed.h +316 -0
- ctpbee_api/ctp/include/new/pybind11/eval.h +156 -0
- ctpbee_api/ctp/include/new/pybind11/functional.h +137 -0
- ctpbee_api/ctp/include/new/pybind11/gil.h +239 -0
- ctpbee_api/ctp/include/new/pybind11/iostream.h +265 -0
- ctpbee_api/ctp/include/new/pybind11/numpy.h +1998 -0
- ctpbee_api/ctp/include/new/pybind11/operators.h +202 -0
- ctpbee_api/ctp/include/new/pybind11/options.h +92 -0
- ctpbee_api/ctp/include/new/pybind11/pybind11.h +2890 -0
- ctpbee_api/ctp/include/new/pybind11/pytypes.h +2557 -0
- ctpbee_api/ctp/include/new/pybind11/stl/filesystem.h +116 -0
- ctpbee_api/ctp/include/new/pybind11/stl.h +447 -0
- ctpbee_api/ctp/include/new/pybind11/stl_bind.h +851 -0
- ctpbee_api/ctp/include/new/pybind11/type_caster_pyobject_ptr.h +61 -0
- ctpbee_api/ctp/include/previous/ctp/ThostFtdcMdApi.h +168 -0
- ctpbee_api/ctp/include/previous/ctp/ThostFtdcTraderApi.h +770 -0
- ctpbee_api/ctp/include/previous/ctp/ThostFtdcUserApiDataType.h +6878 -0
- ctpbee_api/ctp/include/previous/ctp/ThostFtdcUserApiStruct.h +10915 -0
- ctpbee_api/ctp/include/previous/pybind11/attr.h +489 -0
- ctpbee_api/ctp/include/previous/pybind11/buffer_info.h +108 -0
- ctpbee_api/ctp/include/previous/pybind11/cast.h +2067 -0
- ctpbee_api/ctp/include/previous/pybind11/chrono.h +162 -0
- ctpbee_api/ctp/include/previous/pybind11/common.h +2 -0
- ctpbee_api/ctp/include/previous/pybind11/complex.h +61 -0
- ctpbee_api/ctp/include/previous/pybind11/detail/class.h +626 -0
- ctpbee_api/ctp/include/previous/pybind11/detail/common.h +803 -0
- ctpbee_api/ctp/include/previous/pybind11/detail/descr.h +185 -0
- ctpbee_api/ctp/include/previous/pybind11/detail/init.h +335 -0
- ctpbee_api/ctp/include/previous/pybind11/detail/internals.h +285 -0
- ctpbee_api/ctp/include/previous/pybind11/detail/typeid.h +53 -0
- ctpbee_api/ctp/include/previous/pybind11/eigen.h +604 -0
- ctpbee_api/ctp/include/previous/pybind11/embed.h +194 -0
- ctpbee_api/ctp/include/previous/pybind11/eval.h +117 -0
- ctpbee_api/ctp/include/previous/pybind11/functional.h +85 -0
- ctpbee_api/ctp/include/previous/pybind11/iostream.h +200 -0
- ctpbee_api/ctp/include/previous/pybind11/numpy.h +1601 -0
- ctpbee_api/ctp/include/previous/pybind11/operators.h +168 -0
- ctpbee_api/ctp/include/previous/pybind11/options.h +65 -0
- ctpbee_api/ctp/include/previous/pybind11/pybind11.h +1965 -0
- ctpbee_api/ctp/include/previous/pybind11/pytypes.h +1332 -0
- ctpbee_api/ctp/include/previous/pybind11/stl.h +376 -0
- ctpbee_api/ctp/include/previous/pybind11/stl_bind.h +599 -0
- ctpbee_api/ctp/libs/libcomunicationkey.a +0 -0
- ctpbee_api/ctp/libs/libcrypto.a +0 -0
- ctpbee_api/ctp/libs/libssl.a +0 -0
- ctpbee_api/ctp/libs/thostmduserapi_se.lib +0 -0
- ctpbee_api/ctp/libs/thosttraderapi_se.lib +0 -0
- ctpbee_api/ctp/libthostmduserapi_se.so +0 -0
- ctpbee_api/ctp/libthosttraderapi_se.so +0 -0
- ctpbee_api/ctp/thostmduserapi_se.dll +0 -0
- ctpbee_api/ctp/thosttraderapi_se.dll +0 -0
- ctpbee_api/ctp/vnctp/vnctp.h +189 -0
- ctpbee_api/ctp/vnctp/vnctp.sln +41 -0
- ctpbee_api/ctp/vnctp/vnctpmd/dllmain.cpp +19 -0
- ctpbee_api/ctp/vnctp/vnctpmd/stdafx.cpp +1 -0
- ctpbee_api/ctp/vnctp/vnctpmd/stdafx.h +17 -0
- ctpbee_api/ctp/vnctp/vnctpmd/targetver.h +8 -0
- ctpbee_api/ctp/vnctp/vnctpmd/vnctpmd.cpp +953 -0
- ctpbee_api/ctp/vnctp/vnctpmd/vnctpmd.h +209 -0
- ctpbee_api/ctp/vnctp/vnctpmd/vnctpmd.vcxproj +200 -0
- ctpbee_api/ctp/vnctp/vnctpmd/vnctpmd.vcxproj.filters +54 -0
- ctpbee_api/ctp/vnctp/vnctpmd/vnctpmd.vcxproj.user +4 -0
- ctpbee_api/ctp/vnctp/vnctptd/dllmain.cpp +19 -0
- ctpbee_api/ctp/vnctp/vnctptd/stdafx.cpp +1 -0
- ctpbee_api/ctp/vnctp/vnctptd/stdafx.h +16 -0
- ctpbee_api/ctp/vnctp/vnctptd/targetver.h +8 -0
- ctpbee_api/ctp/vnctp/vnctptd/vnctptd.cpp +12148 -0
- ctpbee_api/ctp/vnctp/vnctptd/vnctptd.h +1329 -0
- ctpbee_api/ctp/vnctp/vnctptd/vnctptd.vcxproj +198 -0
- ctpbee_api/ctp/vnctp/vnctptd/vnctptd.vcxproj.filters +54 -0
- ctpbee_api/ctp/vnctp/vnctptd/vnctptd.vcxproj.user +4 -0
- ctpbee_api/ctp/vnctpmd.cp312-win_amd64.pyd +0 -0
- ctpbee_api/ctp/vnctptd.cp312-win_amd64.pyd +0 -0
- ctpbee_api/ctp_mini/__init__.py +3 -0
- ctpbee_api/ctp_mini/generator/generate_api_functions.py +343 -0
- ctpbee_api/ctp_mini/generator/generate_data_type.py +76 -0
- ctpbee_api/ctp_mini/generator/generate_struct.py +85 -0
- ctpbee_api/ctp_mini/generator/mini_constant.py +1186 -0
- ctpbee_api/ctp_mini/generator/mini_md_header_define.h +13 -0
- ctpbee_api/ctp_mini/generator/mini_md_header_function.h +4 -0
- ctpbee_api/ctp_mini/generator/mini_md_header_on.h +26 -0
- ctpbee_api/ctp_mini/generator/mini_md_header_process.h +26 -0
- ctpbee_api/ctp_mini/generator/mini_md_source_function.cpp +29 -0
- ctpbee_api/ctp_mini/generator/mini_md_source_module.cpp +17 -0
- ctpbee_api/ctp_mini/generator/mini_md_source_on.cpp +156 -0
- ctpbee_api/ctp_mini/generator/mini_md_source_process.cpp +264 -0
- ctpbee_api/ctp_mini/generator/mini_md_source_switch.cpp +78 -0
- ctpbee_api/ctp_mini/generator/mini_md_source_task.cpp +203 -0
- ctpbee_api/ctp_mini/generator/mini_struct.py +4599 -0
- ctpbee_api/ctp_mini/generator/mini_td_header_define.h +63 -0
- ctpbee_api/ctp_mini/generator/mini_td_header_function.h +84 -0
- ctpbee_api/ctp_mini/generator/mini_td_header_on.h +126 -0
- ctpbee_api/ctp_mini/generator/mini_td_header_process.h +126 -0
- ctpbee_api/ctp_mini/generator/mini_td_source_function.cpp +663 -0
- ctpbee_api/ctp_mini/generator/mini_td_source_module.cpp +107 -0
- ctpbee_api/ctp_mini/generator/mini_td_source_on.cpp +756 -0
- ctpbee_api/ctp_mini/generator/mini_td_source_process.cpp +2492 -0
- ctpbee_api/ctp_mini/generator/mini_td_source_switch.cpp +378 -0
- ctpbee_api/ctp_mini/generator/mini_td_source_task.cpp +1193 -0
- ctpbee_api/ctp_mini/generator/mini_typedef.py +755 -0
- ctpbee_api/ctp_mini/generator/package/vnminimd.cpp +886 -0
- ctpbee_api/ctp_mini/generator/package/vnminimd.h +205 -0
- ctpbee_api/ctp_mini/include/new/mini/ThostFtdcMdApi.h +148 -0
- ctpbee_api/ctp_mini/include/new/mini/ThostFtdcTraderApi.h +419 -0
- ctpbee_api/ctp_mini/include/new/mini/ThostFtdcUserApiDataType.h +6458 -0
- ctpbee_api/ctp_mini/include/new/mini/ThostFtdcUserApiStruct.h +8890 -0
- ctpbee_api/ctp_mini/include/new/pybind11/attr.h +690 -0
- ctpbee_api/ctp_mini/include/new/pybind11/buffer_info.h +208 -0
- ctpbee_api/ctp_mini/include/new/pybind11/cast.h +1704 -0
- ctpbee_api/ctp_mini/include/new/pybind11/chrono.h +225 -0
- ctpbee_api/ctp_mini/include/new/pybind11/common.h +2 -0
- ctpbee_api/ctp_mini/include/new/pybind11/complex.h +74 -0
- ctpbee_api/ctp_mini/include/new/pybind11/detail/class.h +743 -0
- ctpbee_api/ctp_mini/include/new/pybind11/detail/common.h +1255 -0
- ctpbee_api/ctp_mini/include/new/pybind11/detail/descr.h +171 -0
- ctpbee_api/ctp_mini/include/new/pybind11/detail/init.h +434 -0
- ctpbee_api/ctp_mini/include/new/pybind11/detail/internals.h +656 -0
- ctpbee_api/ctp_mini/include/new/pybind11/detail/type_caster_base.h +1177 -0
- ctpbee_api/ctp_mini/include/new/pybind11/detail/typeid.h +65 -0
- ctpbee_api/ctp_mini/include/new/pybind11/eigen/common.h +9 -0
- ctpbee_api/ctp_mini/include/new/pybind11/eigen/matrix.h +714 -0
- ctpbee_api/ctp_mini/include/new/pybind11/eigen/tensor.h +516 -0
- ctpbee_api/ctp_mini/include/new/pybind11/eigen.h +12 -0
- ctpbee_api/ctp_mini/include/new/pybind11/embed.h +316 -0
- ctpbee_api/ctp_mini/include/new/pybind11/eval.h +156 -0
- ctpbee_api/ctp_mini/include/new/pybind11/functional.h +137 -0
- ctpbee_api/ctp_mini/include/new/pybind11/gil.h +239 -0
- ctpbee_api/ctp_mini/include/new/pybind11/iostream.h +265 -0
- ctpbee_api/ctp_mini/include/new/pybind11/numpy.h +1998 -0
- ctpbee_api/ctp_mini/include/new/pybind11/operators.h +202 -0
- ctpbee_api/ctp_mini/include/new/pybind11/options.h +92 -0
- ctpbee_api/ctp_mini/include/new/pybind11/pybind11.h +2890 -0
- ctpbee_api/ctp_mini/include/new/pybind11/pytypes.h +2557 -0
- ctpbee_api/ctp_mini/include/new/pybind11/stl/filesystem.h +116 -0
- ctpbee_api/ctp_mini/include/new/pybind11/stl.h +447 -0
- ctpbee_api/ctp_mini/include/new/pybind11/stl_bind.h +851 -0
- ctpbee_api/ctp_mini/include/new/pybind11/type_caster_pyobject_ptr.h +61 -0
- ctpbee_api/ctp_mini/include/previous/mini/ThostFtdcMdApi.h +148 -0
- ctpbee_api/ctp_mini/include/previous/mini/ThostFtdcTraderApi.h +419 -0
- ctpbee_api/ctp_mini/include/previous/mini/ThostFtdcUserApiDataType.h +6458 -0
- ctpbee_api/ctp_mini/include/previous/mini/ThostFtdcUserApiStruct.h +8890 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/attr.h +489 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/buffer_info.h +108 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/cast.h +2067 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/chrono.h +162 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/common.h +2 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/complex.h +61 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/detail/class.h +626 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/detail/common.h +803 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/detail/descr.h +185 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/detail/init.h +335 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/detail/internals.h +285 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/detail/typeid.h +53 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/eigen.h +604 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/embed.h +194 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/eval.h +117 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/functional.h +85 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/iostream.h +200 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/numpy.h +1601 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/operators.h +168 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/options.h +65 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/pybind11.h +1965 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/pytypes.h +1332 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/stl.h +376 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/stl_bind.h +599 -0
- ctpbee_api/ctp_mini/libs/thostmduserapi.lib +0 -0
- ctpbee_api/ctp_mini/libs/thosttraderapi.lib +0 -0
- ctpbee_api/ctp_mini/libthostmduserapi.so +0 -0
- ctpbee_api/ctp_mini/libthosttraderapi.so +0 -0
- ctpbee_api/ctp_mini/mini_constant.py +1186 -0
- ctpbee_api/ctp_mini/thostmduserapi.dll +0 -0
- ctpbee_api/ctp_mini/thosttraderapi.dll +0 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_mini.h +146 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_mini.sln +41 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/dllmain.cpp +0 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/stdafx.cpp +0 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/stdafx.h +0 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/targetver.h +0 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/vnctp_minimd.cpp +886 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/vnctp_minimd.h +203 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/vnctp_minimd.vcxproj +183 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/vnctp_minimd.vcxproj.filters +54 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/vnctp_minimd.vcxproj.user +4 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/dllmain.cpp +0 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/stdafx.cpp +0 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/stdafx.h +0 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/targetver.h +0 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/vnctp_minitd.cpp +5716 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/vnctp_minitd.h +680 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/vnctp_minitd.vcxproj +180 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/vnctp_minitd.vcxproj.filters +54 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/vnctp_minitd.vcxproj.user +4 -0
- ctpbee_api/ctp_mini/vnctp_minimd.cp312-win_amd64.pyd +0 -0
- ctpbee_api/ctp_mini/vnctp_minitd.cp312-win_amd64.pyd +0 -0
- ctpbee_api/ctp_mini/vnctp_minitd.lib +0 -0
- ctpbee_api/rohon/RohonBaseV64.dll +0 -0
- ctpbee_api/rohon/WinDataCollect.dll +0 -0
- ctpbee_api/rohon/__init__.py +3 -0
- ctpbee_api/rohon/generator/generate_api_functions.py +348 -0
- ctpbee_api/rohon/generator/generate_data_type.py +76 -0
- ctpbee_api/rohon/generator/generate_struct.py +84 -0
- ctpbee_api/rohon/generator/rohon_constant.py +1242 -0
- ctpbee_api/rohon/generator/rohon_md_header_define.h +13 -0
- ctpbee_api/rohon/generator/rohon_md_header_function.h +6 -0
- ctpbee_api/rohon/generator/rohon_md_header_on.h +26 -0
- ctpbee_api/rohon/generator/rohon_md_header_process.h +26 -0
- ctpbee_api/rohon/generator/rohon_md_source_function.cpp +40 -0
- ctpbee_api/rohon/generator/rohon_md_source_module.cpp +18 -0
- ctpbee_api/rohon/generator/rohon_md_source_on.cpp +156 -0
- ctpbee_api/rohon/generator/rohon_md_source_process.cpp +271 -0
- ctpbee_api/rohon/generator/rohon_md_source_switch.cpp +78 -0
- ctpbee_api/rohon/generator/rohon_md_source_task.cpp +211 -0
- ctpbee_api/rohon/generator/rohon_struct.py +4958 -0
- ctpbee_api/rohon/generator/rohon_td_header_define.h +125 -0
- ctpbee_api/rohon/generator/rohon_td_header_function.h +164 -0
- ctpbee_api/rohon/generator/rohon_td_header_on.h +250 -0
- ctpbee_api/rohon/generator/rohon_td_header_process.h +250 -0
- ctpbee_api/rohon/generator/rohon_td_source_function.cpp +1338 -0
- ctpbee_api/rohon/generator/rohon_td_source_module.cpp +209 -0
- ctpbee_api/rohon/generator/rohon_td_source_on.cpp +1500 -0
- ctpbee_api/rohon/generator/rohon_td_source_process.cpp +5125 -0
- ctpbee_api/rohon/generator/rohon_td_source_switch.cpp +750 -0
- ctpbee_api/rohon/generator/rohon_td_source_task.cpp +2339 -0
- ctpbee_api/rohon/generator/rohon_typedef.py +781 -0
- ctpbee_api/rohon/include/new/pybind11/attr.h +690 -0
- ctpbee_api/rohon/include/new/pybind11/buffer_info.h +208 -0
- ctpbee_api/rohon/include/new/pybind11/cast.h +1704 -0
- ctpbee_api/rohon/include/new/pybind11/chrono.h +225 -0
- ctpbee_api/rohon/include/new/pybind11/common.h +2 -0
- ctpbee_api/rohon/include/new/pybind11/complex.h +74 -0
- ctpbee_api/rohon/include/new/pybind11/detail/class.h +743 -0
- ctpbee_api/rohon/include/new/pybind11/detail/common.h +1255 -0
- ctpbee_api/rohon/include/new/pybind11/detail/descr.h +171 -0
- ctpbee_api/rohon/include/new/pybind11/detail/init.h +434 -0
- ctpbee_api/rohon/include/new/pybind11/detail/internals.h +656 -0
- ctpbee_api/rohon/include/new/pybind11/detail/type_caster_base.h +1177 -0
- ctpbee_api/rohon/include/new/pybind11/detail/typeid.h +65 -0
- ctpbee_api/rohon/include/new/pybind11/eigen/common.h +9 -0
- ctpbee_api/rohon/include/new/pybind11/eigen/matrix.h +714 -0
- ctpbee_api/rohon/include/new/pybind11/eigen/tensor.h +516 -0
- ctpbee_api/rohon/include/new/pybind11/eigen.h +12 -0
- ctpbee_api/rohon/include/new/pybind11/embed.h +316 -0
- ctpbee_api/rohon/include/new/pybind11/eval.h +156 -0
- ctpbee_api/rohon/include/new/pybind11/functional.h +137 -0
- ctpbee_api/rohon/include/new/pybind11/gil.h +239 -0
- ctpbee_api/rohon/include/new/pybind11/iostream.h +265 -0
- ctpbee_api/rohon/include/new/pybind11/numpy.h +1998 -0
- ctpbee_api/rohon/include/new/pybind11/operators.h +202 -0
- ctpbee_api/rohon/include/new/pybind11/options.h +92 -0
- ctpbee_api/rohon/include/new/pybind11/pybind11.h +2890 -0
- ctpbee_api/rohon/include/new/pybind11/pytypes.h +2557 -0
- ctpbee_api/rohon/include/new/pybind11/stl/filesystem.h +116 -0
- ctpbee_api/rohon/include/new/pybind11/stl.h +447 -0
- ctpbee_api/rohon/include/new/pybind11/stl_bind.h +851 -0
- ctpbee_api/rohon/include/new/pybind11/type_caster_pyobject_ptr.h +61 -0
- ctpbee_api/rohon/include/new/rohon/ThostFtdcMdApi.h +168 -0
- ctpbee_api/rohon/include/new/rohon/ThostFtdcTraderApi.h +739 -0
- ctpbee_api/rohon/include/new/rohon/ThostFtdcUserApiDataType.h +6708 -0
- ctpbee_api/rohon/include/new/rohon/ThostFtdcUserApiStruct.h +9580 -0
- ctpbee_api/rohon/include/previous/pybind11/attr.h +489 -0
- ctpbee_api/rohon/include/previous/pybind11/buffer_info.h +108 -0
- ctpbee_api/rohon/include/previous/pybind11/cast.h +2067 -0
- ctpbee_api/rohon/include/previous/pybind11/chrono.h +162 -0
- ctpbee_api/rohon/include/previous/pybind11/common.h +2 -0
- ctpbee_api/rohon/include/previous/pybind11/complex.h +61 -0
- ctpbee_api/rohon/include/previous/pybind11/detail/class.h +626 -0
- ctpbee_api/rohon/include/previous/pybind11/detail/common.h +803 -0
- ctpbee_api/rohon/include/previous/pybind11/detail/descr.h +185 -0
- ctpbee_api/rohon/include/previous/pybind11/detail/init.h +335 -0
- ctpbee_api/rohon/include/previous/pybind11/detail/internals.h +285 -0
- ctpbee_api/rohon/include/previous/pybind11/detail/typeid.h +53 -0
- ctpbee_api/rohon/include/previous/pybind11/eigen.h +604 -0
- ctpbee_api/rohon/include/previous/pybind11/embed.h +194 -0
- ctpbee_api/rohon/include/previous/pybind11/eval.h +117 -0
- ctpbee_api/rohon/include/previous/pybind11/functional.h +85 -0
- ctpbee_api/rohon/include/previous/pybind11/iostream.h +200 -0
- ctpbee_api/rohon/include/previous/pybind11/numpy.h +1601 -0
- ctpbee_api/rohon/include/previous/pybind11/operators.h +168 -0
- ctpbee_api/rohon/include/previous/pybind11/options.h +65 -0
- ctpbee_api/rohon/include/previous/pybind11/pybind11.h +1965 -0
- ctpbee_api/rohon/include/previous/pybind11/pytypes.h +1332 -0
- ctpbee_api/rohon/include/previous/pybind11/stl.h +376 -0
- ctpbee_api/rohon/include/previous/pybind11/stl_bind.h +599 -0
- ctpbee_api/rohon/include/previous/rohon/ThostFtdcMdApi.h +168 -0
- ctpbee_api/rohon/include/previous/rohon/ThostFtdcTraderApi.h +739 -0
- ctpbee_api/rohon/include/previous/rohon/ThostFtdcUserApiDataType.h +6708 -0
- ctpbee_api/rohon/include/previous/rohon/ThostFtdcUserApiStruct.h +9580 -0
- ctpbee_api/rohon/libLinuxDataCollect.so +0 -0
- ctpbee_api/rohon/librohonbase.so +0 -0
- ctpbee_api/rohon/librohonbase.so.1.1 +0 -0
- ctpbee_api/rohon/librohonbase.so.1.1.0.1 +0 -0
- ctpbee_api/rohon/libs/thostmduserapi_se.lib +0 -0
- ctpbee_api/rohon/libs/thosttraderapi_se.lib +0 -0
- ctpbee_api/rohon/libthostmduserapi_se.so +0 -0
- ctpbee_api/rohon/libthosttraderapi_se.so +0 -0
- ctpbee_api/rohon/rohon_constant.py +1242 -0
- ctpbee_api/rohon/thostmduserapi_se.dll +0 -0
- ctpbee_api/rohon/thosttraderapi_se.dll +0 -0
- ctpbee_api/rohon/vnrohon/.vs/vnrohon/v15/.suo +0 -0
- ctpbee_api/rohon/vnrohon/.vs/vnrohon/v15/Browse.VC.db +0 -0
- ctpbee_api/rohon/vnrohon/.vs/vnrohon/v15/Solution.VC.db +0 -0
- ctpbee_api/rohon/vnrohon/vnrohon.h +147 -0
- ctpbee_api/rohon/vnrohon/vnrohon.sln +41 -0
- ctpbee_api/rohon/vnrohon/vnrohonmd/dllmain.cpp +19 -0
- ctpbee_api/rohon/vnrohon/vnrohonmd/framework.h +5 -0
- ctpbee_api/rohon/vnrohon/vnrohonmd/pch.cpp +5 -0
- ctpbee_api/rohon/vnrohon/vnrohonmd/pch.h +13 -0
- ctpbee_api/rohon/vnrohon/vnrohonmd/vnrohonmd.cpp +931 -0
- ctpbee_api/rohon/vnrohon/vnrohonmd/vnrohonmd.h +207 -0
- ctpbee_api/rohon/vnrohon/vnrohonmd/vnrohonmd.vcxproj +188 -0
- ctpbee_api/rohon/vnrohon/vnrohonmd/vnrohonmd.vcxproj.filters +54 -0
- ctpbee_api/rohon/vnrohon/vnrohonmd/vnrohonmd.vcxproj.user +4 -0
- ctpbee_api/rohon/vnrohon/vnrohontd/dllmain.cpp +19 -0
- ctpbee_api/rohon/vnrohon/vnrohontd/framework.h +5 -0
- ctpbee_api/rohon/vnrohon/vnrohontd/pch.cpp +5 -0
- ctpbee_api/rohon/vnrohon/vnrohontd/pch.h +13 -0
- ctpbee_api/rohon/vnrohon/vnrohontd/vnrohontd.cpp +11395 -0
- ctpbee_api/rohon/vnrohon/vnrohontd/vnrohontd.h +1259 -0
- ctpbee_api/rohon/vnrohon/vnrohontd/vnrohontd.vcxproj +188 -0
- ctpbee_api/rohon/vnrohon/vnrohontd/vnrohontd.vcxproj.filters +54 -0
- ctpbee_api/rohon/vnrohon/vnrohontd/vnrohontd.vcxproj.user +4 -0
- ctpbee_api/rohon/vnrohonmd.cp312-win_amd64.pyd +0 -0
- ctpbee_api/rohon/vnrohontd.cp312-win_amd64.pyd +0 -0
- ctpbee_opt_api-0.1.0.dist-info/METADATA +46 -0
- ctpbee_opt_api-0.1.0.dist-info/RECORD +414 -0
- ctpbee_opt_api-0.1.0.dist-info/WHEEL +5 -0
- ctpbee_opt_api-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from const import *
|
|
5
|
+
|
|
6
|
+
current_dir = os.path.dirname(__file__)
|
|
7
|
+
out_base_path = os.path.join(os.path.dirname(current_dir), "vnctp")
|
|
8
|
+
filelist = os.listdir(current_dir)
|
|
9
|
+
|
|
10
|
+
h = [x for x in filelist if x.endswith(".h")]
|
|
11
|
+
cpp = [x for x in filelist if x.endswith(".cpp")]
|
|
12
|
+
td_h = [x for x in h if "td" in x]
|
|
13
|
+
md_h = [x for x in h if "md" in x]
|
|
14
|
+
td_cpp = [x for x in cpp if "td" in x]
|
|
15
|
+
md_cpp = [x for x in cpp if "md" in x]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def read_file(file_list, name):
|
|
19
|
+
file_name = ""
|
|
20
|
+
for i in file_list:
|
|
21
|
+
if i.split("_")[3].split(".")[0] == name:
|
|
22
|
+
file_name = i
|
|
23
|
+
if len(file_name) == 0:
|
|
24
|
+
print("stop")
|
|
25
|
+
return None
|
|
26
|
+
with open(file_name, "r") as f:
|
|
27
|
+
return "".join(f.readlines())
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def generate_md():
|
|
31
|
+
md_h_define = read_file(md_h, "define")
|
|
32
|
+
md_h_on = read_file(md_h, "on")
|
|
33
|
+
md_h_function = read_file(md_h, "function")
|
|
34
|
+
md_h_process = read_file(md_h, "process")
|
|
35
|
+
|
|
36
|
+
# ��ȡ��������
|
|
37
|
+
md_h_file = MD_H_HEADER + md_h_define + MD_H_API + MD_H_BACK + md_h_process + md_h_on + md_h_function + "};"
|
|
38
|
+
|
|
39
|
+
md_c_task = read_file(md_cpp, "task")
|
|
40
|
+
md_c_process = read_file(md_cpp, "process")
|
|
41
|
+
md_c_function = read_file(md_cpp, "function")
|
|
42
|
+
md_c_on = read_file(md_cpp, "on")
|
|
43
|
+
md_c_switch = read_file(md_cpp, "switch")
|
|
44
|
+
md_c_module = read_file(md_cpp, "module")
|
|
45
|
+
|
|
46
|
+
md_c_file = MD_C_HEADER \
|
|
47
|
+
+ md_c_task + md_c_process + md_c_function + \
|
|
48
|
+
MD_C_PYOBJ + md_c_on + MD_C_PYOBJ_END + \
|
|
49
|
+
MD_C_SWITCH + md_c_switch + MD_C_SWITCH_END + \
|
|
50
|
+
MD_C_MODULE + md_c_module + MD_C_MODULE_END
|
|
51
|
+
|
|
52
|
+
return md_h_file, md_c_file
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def generate_td():
|
|
56
|
+
td_h_define = read_file(td_h, "define")
|
|
57
|
+
td_h_on = read_file(td_h, "on")
|
|
58
|
+
td_h_process = read_file(td_h, "process")
|
|
59
|
+
td_h_function = read_file(td_h, "function")
|
|
60
|
+
td_h_file = TD_H_HEADER + td_h_define + TD_H_API + td_h_on + td_h_process + td_h_function + TD_H_API_END
|
|
61
|
+
|
|
62
|
+
td_c_switch = read_file(td_cpp, "switch")
|
|
63
|
+
td_c_task = read_file(td_cpp, "task")
|
|
64
|
+
td_c_process = read_file(td_cpp, "process")
|
|
65
|
+
td_c_function = read_file(td_cpp, "function")
|
|
66
|
+
td_c_on = read_file(td_cpp, "on")
|
|
67
|
+
td_c_module = read_file(td_cpp, "module")
|
|
68
|
+
|
|
69
|
+
td_c_file = TD_C_HEADER + td_c_task + \
|
|
70
|
+
TD_C_SWITCH + td_c_switch + TD_C_SWITCH_END + \
|
|
71
|
+
td_c_process + TD_C_REQ + td_c_function + \
|
|
72
|
+
TD_C_ON + td_c_on + TD_C_ON_END + TD_C_MODULE + td_c_module + TD_C_MODULE_END
|
|
73
|
+
return td_h_file, td_c_file
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def write_file(name, h, c):
|
|
77
|
+
h_name = f"{name}.h"
|
|
78
|
+
c_name = f"{name}.cpp"
|
|
79
|
+
base_path = os.path.join(out_base_path, name)
|
|
80
|
+
h_file_path = os.path.join(base_path, h_name)
|
|
81
|
+
with open(h_file_path, "w", encoding="utf8") as f:
|
|
82
|
+
f.write(h)
|
|
83
|
+
c_file_path = os.path.join(base_path, c_name)
|
|
84
|
+
with open(c_file_path, "w", encoding="utf8") as f:
|
|
85
|
+
f.write(c)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
if __name__ == "__main__":
|
|
89
|
+
h, c = generate_md()
|
|
90
|
+
write_file("vnctpmd", h, c)
|
|
91
|
+
h, c = generate_td()
|
|
92
|
+
write_file("vnctptd", h, c)
|
|
93
|
+
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
MD_H_BACK = """
|
|
2
|
+
//req:���������������ֵ�
|
|
3
|
+
//-------------------------------------------------------------------------------------
|
|
4
|
+
void createFtdcMdApi(string pszFlowPath = "");
|
|
5
|
+
void release();
|
|
6
|
+
void init();
|
|
7
|
+
int join();
|
|
8
|
+
int exit();
|
|
9
|
+
string getTradingDay();
|
|
10
|
+
void registerFront(string pszFrontAddress);
|
|
11
|
+
int subscribeMarketData(string instrumentID);
|
|
12
|
+
int unSubscribeMarketData(string instrumentID);
|
|
13
|
+
int subscribeForQuoteRsp(string instrumentID);
|
|
14
|
+
int unSubscribeForQuoteRsp(string instrumentID);
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
MD_H_HEADER = """//ϵͳ
|
|
18
|
+
#ifdef WIN32
|
|
19
|
+
#include "stdafx.h"
|
|
20
|
+
#endif
|
|
21
|
+
#include "vnctp.h"
|
|
22
|
+
#include "pybind11/pybind11.h"
|
|
23
|
+
#include "ctp/ThostFtdcMdApi.h"
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
MD_H_API = """
|
|
27
|
+
class MdApi : public CThostFtdcMdSpi
|
|
28
|
+
{
|
|
29
|
+
private:
|
|
30
|
+
CThostFtdcMdApi* api; //API����
|
|
31
|
+
thread task_thread; //�����߳�ָ�루��python���������ݣ�
|
|
32
|
+
TaskQueue task_queue; //�������
|
|
33
|
+
bool active = false; //����״̬
|
|
34
|
+
public:
|
|
35
|
+
MdApi()
|
|
36
|
+
{
|
|
37
|
+
};
|
|
38
|
+
~MdApi()
|
|
39
|
+
{
|
|
40
|
+
if (this->active)
|
|
41
|
+
{
|
|
42
|
+
this->exit();
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
void processTask();
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
MD_C_HEADER = """
|
|
50
|
+
#include "vnctpmd.h"
|
|
51
|
+
void MdApi::createFtdcMdApi(string pszFlowPath)
|
|
52
|
+
{
|
|
53
|
+
this->api = CThostFtdcMdApi::CreateFtdcMdApi(pszFlowPath.c_str());
|
|
54
|
+
this->api->RegisterSpi(this);
|
|
55
|
+
};
|
|
56
|
+
void MdApi::release()
|
|
57
|
+
{
|
|
58
|
+
this->api->Release();
|
|
59
|
+
};
|
|
60
|
+
void MdApi::init()
|
|
61
|
+
{
|
|
62
|
+
this->active = true;
|
|
63
|
+
this->task_thread = thread(&MdApi::processTask, this);
|
|
64
|
+
this->api->Init();
|
|
65
|
+
};
|
|
66
|
+
int MdApi::join()
|
|
67
|
+
{
|
|
68
|
+
int i = this->api->Join();
|
|
69
|
+
return i;
|
|
70
|
+
};
|
|
71
|
+
int MdApi::exit()
|
|
72
|
+
{
|
|
73
|
+
this->active = false;
|
|
74
|
+
this->task_queue.terminate();
|
|
75
|
+
this->task_thread.join();
|
|
76
|
+
this->api->RegisterSpi(NULL);
|
|
77
|
+
this->api->Release();
|
|
78
|
+
this->api = NULL;
|
|
79
|
+
return 1;
|
|
80
|
+
};
|
|
81
|
+
string MdApi::getTradingDay()
|
|
82
|
+
{
|
|
83
|
+
string day = this->api->GetTradingDay();
|
|
84
|
+
return day;
|
|
85
|
+
};
|
|
86
|
+
void MdApi::registerFront(string pszFrontAddress)
|
|
87
|
+
{
|
|
88
|
+
this->api->RegisterFront((char*)pszFrontAddress.c_str());
|
|
89
|
+
};
|
|
90
|
+
int MdApi::subscribeMarketData(string instrumentID)
|
|
91
|
+
{
|
|
92
|
+
char* buffer = (char*) instrumentID.c_str();
|
|
93
|
+
char* myreq[1] = { buffer };
|
|
94
|
+
int i = this->api->SubscribeMarketData(myreq, 1);
|
|
95
|
+
return i;
|
|
96
|
+
};
|
|
97
|
+
int MdApi::unSubscribeMarketData(string instrumentID)
|
|
98
|
+
{
|
|
99
|
+
char* buffer = (char*)instrumentID.c_str();
|
|
100
|
+
char* myreq[1] = { buffer };;
|
|
101
|
+
int i = this->api->UnSubscribeMarketData(myreq, 1);
|
|
102
|
+
return i;
|
|
103
|
+
};
|
|
104
|
+
int MdApi::subscribeForQuoteRsp(string instrumentID)
|
|
105
|
+
{
|
|
106
|
+
char* buffer = (char*)instrumentID.c_str();
|
|
107
|
+
char* myreq[1] = { buffer };
|
|
108
|
+
int i = this->api->SubscribeForQuoteRsp(myreq, 1);
|
|
109
|
+
return i;
|
|
110
|
+
};
|
|
111
|
+
int MdApi::unSubscribeForQuoteRsp(string instrumentID)
|
|
112
|
+
{
|
|
113
|
+
char* buffer = (char*)instrumentID.c_str();
|
|
114
|
+
char* myreq[1] = { buffer };;
|
|
115
|
+
int i = this->api->UnSubscribeForQuoteRsp(myreq, 1);
|
|
116
|
+
return i;
|
|
117
|
+
};
|
|
118
|
+
"""
|
|
119
|
+
|
|
120
|
+
MD_C_SWITCH = """
|
|
121
|
+
void MdApi::processTask()
|
|
122
|
+
{
|
|
123
|
+
try
|
|
124
|
+
{
|
|
125
|
+
while (this->active)
|
|
126
|
+
{
|
|
127
|
+
Task task = this->task_queue.pop();
|
|
128
|
+
|
|
129
|
+
switch (task.task_name)
|
|
130
|
+
{
|
|
131
|
+
"""
|
|
132
|
+
MD_C_SWITCH_END = """
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
catch (const TerminatedError&)
|
|
137
|
+
{
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
"""
|
|
141
|
+
|
|
142
|
+
MD_C_PYOBJ = """
|
|
143
|
+
class PyMdApi: public MdApi
|
|
144
|
+
{
|
|
145
|
+
public:
|
|
146
|
+
using MdApi::MdApi;
|
|
147
|
+
"""
|
|
148
|
+
|
|
149
|
+
MD_C_PYOBJ_END = """
|
|
150
|
+
};
|
|
151
|
+
"""
|
|
152
|
+
|
|
153
|
+
MD_C_MODULE = """
|
|
154
|
+
PYBIND11_MODULE(vnctpmd, m)
|
|
155
|
+
{
|
|
156
|
+
class_<MdApi, PyMdApi> mdapi(m, "MdApi");
|
|
157
|
+
mdapi
|
|
158
|
+
.def(init<>())
|
|
159
|
+
.def("createFtdcMdApi", &MdApi::createFtdcMdApi)
|
|
160
|
+
.def("release", &MdApi::release)
|
|
161
|
+
.def("init", &MdApi::init)
|
|
162
|
+
.def("join", &MdApi::join)
|
|
163
|
+
.def("exit", &MdApi::exit)
|
|
164
|
+
.def("getTradingDay", &MdApi::getTradingDay)
|
|
165
|
+
.def("registerFront", &MdApi::registerFront)
|
|
166
|
+
.def("subscribeMarketData", &MdApi::subscribeMarketData)
|
|
167
|
+
.def("unSubscribeMarketData", &MdApi::unSubscribeMarketData)
|
|
168
|
+
.def("subscribeForQuoteRsp", &MdApi::subscribeForQuoteRsp)
|
|
169
|
+
.def("unSubscribeForQuoteRsp", &MdApi::unSubscribeForQuoteRsp)"""
|
|
170
|
+
|
|
171
|
+
MD_C_MODULE_END = """
|
|
172
|
+
}"""
|
|
173
|
+
|
|
174
|
+
TD_H_HEADER = """
|
|
175
|
+
//ϵͳ
|
|
176
|
+
#ifdef WIN32
|
|
177
|
+
#include "stdafx.h"
|
|
178
|
+
#endif
|
|
179
|
+
#include "vnctp.h"
|
|
180
|
+
#include "pybind11/pybind11.h"
|
|
181
|
+
#include "ctp/ThostFtdcTraderApi.h"
|
|
182
|
+
using namespace pybind11;
|
|
183
|
+
"""
|
|
184
|
+
TD_H_API = """
|
|
185
|
+
//API�ļ̳�ʵ��
|
|
186
|
+
class TdApi : public CThostFtdcTraderSpi
|
|
187
|
+
{
|
|
188
|
+
private:
|
|
189
|
+
CThostFtdcTraderApi* api; //API����
|
|
190
|
+
thread task_thread; //�����߳�ָ�루��python���������ݣ�
|
|
191
|
+
TaskQueue task_queue; //�������
|
|
192
|
+
bool active = false; //����״̬
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
public:
|
|
196
|
+
TdApi()
|
|
197
|
+
{
|
|
198
|
+
};
|
|
199
|
+
~TdApi()
|
|
200
|
+
{
|
|
201
|
+
if (this->active)
|
|
202
|
+
{
|
|
203
|
+
this->exit();
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
void processTask();
|
|
208
|
+
|
|
209
|
+
void createFtdcTraderApi(string pszFlowPath = "");
|
|
210
|
+
void release();
|
|
211
|
+
void init();
|
|
212
|
+
int join();
|
|
213
|
+
int exit();
|
|
214
|
+
string getTradingDay();
|
|
215
|
+
void registerFront(string pszFrontAddress);
|
|
216
|
+
void subscribePrivateTopic(int nType);
|
|
217
|
+
void subscribePublicTopic(int nType);
|
|
218
|
+
"""
|
|
219
|
+
|
|
220
|
+
TD_H_API_END = """
|
|
221
|
+
};"""
|
|
222
|
+
|
|
223
|
+
TD_C_HEADER = """
|
|
224
|
+
#include "vnctptd.h"
|
|
225
|
+
"""
|
|
226
|
+
|
|
227
|
+
TD_C_SWITCH = """
|
|
228
|
+
void TdApi::processTask()
|
|
229
|
+
{
|
|
230
|
+
try
|
|
231
|
+
{
|
|
232
|
+
while (this->active)
|
|
233
|
+
{
|
|
234
|
+
Task task = this->task_queue.pop();
|
|
235
|
+
switch (task.task_name)
|
|
236
|
+
{
|
|
237
|
+
"""
|
|
238
|
+
|
|
239
|
+
TD_C_SWITCH_END = """
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
catch (const TerminatedError&)
|
|
244
|
+
{
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
"""
|
|
248
|
+
|
|
249
|
+
TD_C_REQ = """
|
|
250
|
+
void TdApi::createFtdcTraderApi(string pszFlowPath)
|
|
251
|
+
{
|
|
252
|
+
this->api = CThostFtdcTraderApi::CreateFtdcTraderApi(pszFlowPath.c_str());
|
|
253
|
+
this->api->RegisterSpi(this);
|
|
254
|
+
};
|
|
255
|
+
void TdApi::release()
|
|
256
|
+
{
|
|
257
|
+
this->api->Release();
|
|
258
|
+
};
|
|
259
|
+
void TdApi::init()
|
|
260
|
+
{
|
|
261
|
+
this->active = true;
|
|
262
|
+
this->task_thread = thread(&TdApi::processTask, this);
|
|
263
|
+
this->api->Init();
|
|
264
|
+
};
|
|
265
|
+
int TdApi::join()
|
|
266
|
+
{
|
|
267
|
+
int i = this->api->Join();
|
|
268
|
+
return i;
|
|
269
|
+
};
|
|
270
|
+
int TdApi::exit()
|
|
271
|
+
{
|
|
272
|
+
this->active = false;
|
|
273
|
+
this->task_queue.terminate();
|
|
274
|
+
this->task_thread.join();
|
|
275
|
+
this->api->RegisterSpi(NULL);
|
|
276
|
+
this->api->Release();
|
|
277
|
+
this->api = NULL;
|
|
278
|
+
return 1;
|
|
279
|
+
};
|
|
280
|
+
string TdApi::getTradingDay()
|
|
281
|
+
{
|
|
282
|
+
string day = this->api->GetTradingDay();
|
|
283
|
+
return day;
|
|
284
|
+
};
|
|
285
|
+
void TdApi::registerFront(string pszFrontAddress)
|
|
286
|
+
{
|
|
287
|
+
this->api->RegisterFront((char*)pszFrontAddress.c_str());
|
|
288
|
+
};
|
|
289
|
+
void TdApi::subscribePrivateTopic(int nType)
|
|
290
|
+
{
|
|
291
|
+
this->api->SubscribePrivateTopic((THOST_TE_RESUME_TYPE) nType);
|
|
292
|
+
};
|
|
293
|
+
void TdApi::subscribePublicTopic(int nType)
|
|
294
|
+
{
|
|
295
|
+
this->api->SubscribePublicTopic((THOST_TE_RESUME_TYPE)nType);
|
|
296
|
+
};
|
|
297
|
+
"""
|
|
298
|
+
|
|
299
|
+
TD_C_ON = """
|
|
300
|
+
class PyTdApi : public TdApi
|
|
301
|
+
{
|
|
302
|
+
public:
|
|
303
|
+
using TdApi::TdApi;"""
|
|
304
|
+
|
|
305
|
+
TD_C_ON_END = """
|
|
306
|
+
};
|
|
307
|
+
"""
|
|
308
|
+
TD_C_MODULE = """
|
|
309
|
+
PYBIND11_MODULE(vnctptd, m)
|
|
310
|
+
{
|
|
311
|
+
class_<TdApi, PyTdApi> TdApi(m, "TdApi");
|
|
312
|
+
TdApi
|
|
313
|
+
.def(init<>())
|
|
314
|
+
.def("createFtdcTraderApi", &TdApi::createFtdcTraderApi)
|
|
315
|
+
.def("release", &TdApi::release)
|
|
316
|
+
.def("init", &TdApi::init)
|
|
317
|
+
.def("join", &TdApi::join)
|
|
318
|
+
.def("exit", &TdApi::exit)
|
|
319
|
+
.def("getTradingDay", &TdApi::getTradingDay)
|
|
320
|
+
.def("registerFront", &TdApi::registerFront)
|
|
321
|
+
.def("subscribePublicTopic", &TdApi::subscribePublicTopic)
|
|
322
|
+
.def("subscribePrivateTopic", &TdApi::subscribePrivateTopic)"""
|
|
323
|
+
|
|
324
|
+
TD_C_MODULE_END = """
|
|
325
|
+
}"""
|