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,953 @@
|
|
|
1
|
+
// vnctpmd.cpp : ���� DLL Ӧ�ó���ĵ���������
|
|
2
|
+
//
|
|
3
|
+
|
|
4
|
+
#include "vnctpmd.h"
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
///-------------------------------------------------------------------------------------
|
|
8
|
+
///C++�Ļص����������ݱ��浽������
|
|
9
|
+
///-------------------------------------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
void MdApi::OnFrontConnected()
|
|
12
|
+
{
|
|
13
|
+
Task task = Task();
|
|
14
|
+
task.task_name = ONFRONTCONNECTED;
|
|
15
|
+
this->task_queue.push(task);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
void MdApi::OnFrontDisconnected(int nReason)
|
|
19
|
+
{
|
|
20
|
+
Task task = Task();
|
|
21
|
+
task.task_name = ONFRONTDISCONNECTED;
|
|
22
|
+
task.task_id = nReason;
|
|
23
|
+
this->task_queue.push(task);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
void MdApi::OnHeartBeatWarning(int nTimeLapse)
|
|
27
|
+
{
|
|
28
|
+
Task task = Task();
|
|
29
|
+
task.task_name = ONHEARTBEATWARNING;
|
|
30
|
+
task.task_id = nTimeLapse;
|
|
31
|
+
this->task_queue.push(task);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
void MdApi::OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
|
|
35
|
+
{
|
|
36
|
+
Task task = Task();
|
|
37
|
+
task.task_name = ONRSPUSERLOGIN;
|
|
38
|
+
if (pRspUserLogin)
|
|
39
|
+
{
|
|
40
|
+
CThostFtdcRspUserLoginField *task_data = new CThostFtdcRspUserLoginField();
|
|
41
|
+
*task_data = *pRspUserLogin;
|
|
42
|
+
task.task_data = task_data;
|
|
43
|
+
}
|
|
44
|
+
if (pRspInfo)
|
|
45
|
+
{
|
|
46
|
+
CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField();
|
|
47
|
+
*task_error = *pRspInfo;
|
|
48
|
+
task.task_error = task_error;
|
|
49
|
+
}
|
|
50
|
+
task.task_id = nRequestID;
|
|
51
|
+
task.task_last = bIsLast;
|
|
52
|
+
this->task_queue.push(task);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
void MdApi::OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
|
|
56
|
+
{
|
|
57
|
+
Task task = Task();
|
|
58
|
+
task.task_name = ONRSPUSERLOGOUT;
|
|
59
|
+
if (pUserLogout)
|
|
60
|
+
{
|
|
61
|
+
CThostFtdcUserLogoutField *task_data = new CThostFtdcUserLogoutField();
|
|
62
|
+
*task_data = *pUserLogout;
|
|
63
|
+
task.task_data = task_data;
|
|
64
|
+
}
|
|
65
|
+
if (pRspInfo)
|
|
66
|
+
{
|
|
67
|
+
CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField();
|
|
68
|
+
*task_error = *pRspInfo;
|
|
69
|
+
task.task_error = task_error;
|
|
70
|
+
}
|
|
71
|
+
task.task_id = nRequestID;
|
|
72
|
+
task.task_last = bIsLast;
|
|
73
|
+
this->task_queue.push(task);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
void MdApi::OnRspQryMulticastInstrument(CThostFtdcMulticastInstrumentField *pMulticastInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
|
|
77
|
+
{
|
|
78
|
+
Task task = Task();
|
|
79
|
+
task.task_name = ONRSPQRYMULTICASTINSTRUMENT;
|
|
80
|
+
if (pMulticastInstrument)
|
|
81
|
+
{
|
|
82
|
+
CThostFtdcMulticastInstrumentField *task_data = new CThostFtdcMulticastInstrumentField();
|
|
83
|
+
*task_data = *pMulticastInstrument;
|
|
84
|
+
task.task_data = task_data;
|
|
85
|
+
}
|
|
86
|
+
if (pRspInfo)
|
|
87
|
+
{
|
|
88
|
+
CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField();
|
|
89
|
+
*task_error = *pRspInfo;
|
|
90
|
+
task.task_error = task_error;
|
|
91
|
+
}
|
|
92
|
+
task.task_id = nRequestID;
|
|
93
|
+
task.task_last = bIsLast;
|
|
94
|
+
this->task_queue.push(task);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
void MdApi::OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
|
|
98
|
+
{
|
|
99
|
+
Task task = Task();
|
|
100
|
+
task.task_name = ONRSPERROR;
|
|
101
|
+
if (pRspInfo)
|
|
102
|
+
{
|
|
103
|
+
CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField();
|
|
104
|
+
*task_error = *pRspInfo;
|
|
105
|
+
task.task_error = task_error;
|
|
106
|
+
}
|
|
107
|
+
task.task_id = nRequestID;
|
|
108
|
+
task.task_last = bIsLast;
|
|
109
|
+
this->task_queue.push(task);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
void MdApi::OnRspSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
|
|
113
|
+
{
|
|
114
|
+
Task task = Task();
|
|
115
|
+
task.task_name = ONRSPSUBMARKETDATA;
|
|
116
|
+
if (pSpecificInstrument)
|
|
117
|
+
{
|
|
118
|
+
CThostFtdcSpecificInstrumentField *task_data = new CThostFtdcSpecificInstrumentField();
|
|
119
|
+
*task_data = *pSpecificInstrument;
|
|
120
|
+
task.task_data = task_data;
|
|
121
|
+
}
|
|
122
|
+
if (pRspInfo)
|
|
123
|
+
{
|
|
124
|
+
CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField();
|
|
125
|
+
*task_error = *pRspInfo;
|
|
126
|
+
task.task_error = task_error;
|
|
127
|
+
}
|
|
128
|
+
task.task_id = nRequestID;
|
|
129
|
+
task.task_last = bIsLast;
|
|
130
|
+
this->task_queue.push(task);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
void MdApi::OnRspUnSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
|
|
134
|
+
{
|
|
135
|
+
Task task = Task();
|
|
136
|
+
task.task_name = ONRSPUNSUBMARKETDATA;
|
|
137
|
+
if (pSpecificInstrument)
|
|
138
|
+
{
|
|
139
|
+
CThostFtdcSpecificInstrumentField *task_data = new CThostFtdcSpecificInstrumentField();
|
|
140
|
+
*task_data = *pSpecificInstrument;
|
|
141
|
+
task.task_data = task_data;
|
|
142
|
+
}
|
|
143
|
+
if (pRspInfo)
|
|
144
|
+
{
|
|
145
|
+
CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField();
|
|
146
|
+
*task_error = *pRspInfo;
|
|
147
|
+
task.task_error = task_error;
|
|
148
|
+
}
|
|
149
|
+
task.task_id = nRequestID;
|
|
150
|
+
task.task_last = bIsLast;
|
|
151
|
+
this->task_queue.push(task);
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
void MdApi::OnRspSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
|
|
155
|
+
{
|
|
156
|
+
Task task = Task();
|
|
157
|
+
task.task_name = ONRSPSUBFORQUOTERSP;
|
|
158
|
+
if (pSpecificInstrument)
|
|
159
|
+
{
|
|
160
|
+
CThostFtdcSpecificInstrumentField *task_data = new CThostFtdcSpecificInstrumentField();
|
|
161
|
+
*task_data = *pSpecificInstrument;
|
|
162
|
+
task.task_data = task_data;
|
|
163
|
+
}
|
|
164
|
+
if (pRspInfo)
|
|
165
|
+
{
|
|
166
|
+
CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField();
|
|
167
|
+
*task_error = *pRspInfo;
|
|
168
|
+
task.task_error = task_error;
|
|
169
|
+
}
|
|
170
|
+
task.task_id = nRequestID;
|
|
171
|
+
task.task_last = bIsLast;
|
|
172
|
+
this->task_queue.push(task);
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
void MdApi::OnRspUnSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
|
|
176
|
+
{
|
|
177
|
+
Task task = Task();
|
|
178
|
+
task.task_name = ONRSPUNSUBFORQUOTERSP;
|
|
179
|
+
if (pSpecificInstrument)
|
|
180
|
+
{
|
|
181
|
+
CThostFtdcSpecificInstrumentField *task_data = new CThostFtdcSpecificInstrumentField();
|
|
182
|
+
*task_data = *pSpecificInstrument;
|
|
183
|
+
task.task_data = task_data;
|
|
184
|
+
}
|
|
185
|
+
if (pRspInfo)
|
|
186
|
+
{
|
|
187
|
+
CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField();
|
|
188
|
+
*task_error = *pRspInfo;
|
|
189
|
+
task.task_error = task_error;
|
|
190
|
+
}
|
|
191
|
+
task.task_id = nRequestID;
|
|
192
|
+
task.task_last = bIsLast;
|
|
193
|
+
this->task_queue.push(task);
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
void MdApi::OnRtnDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData)
|
|
197
|
+
{
|
|
198
|
+
Task task = Task();
|
|
199
|
+
task.task_name = ONRTNDEPTHMARKETDATA;
|
|
200
|
+
if (pDepthMarketData)
|
|
201
|
+
{
|
|
202
|
+
CThostFtdcDepthMarketDataField *task_data = new CThostFtdcDepthMarketDataField();
|
|
203
|
+
*task_data = *pDepthMarketData;
|
|
204
|
+
task.task_data = task_data;
|
|
205
|
+
}
|
|
206
|
+
this->task_queue.push(task);
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
void MdApi::OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp)
|
|
210
|
+
{
|
|
211
|
+
Task task = Task();
|
|
212
|
+
task.task_name = ONRTNFORQUOTERSP;
|
|
213
|
+
if (pForQuoteRsp)
|
|
214
|
+
{
|
|
215
|
+
CThostFtdcForQuoteRspField *task_data = new CThostFtdcForQuoteRspField();
|
|
216
|
+
*task_data = *pForQuoteRsp;
|
|
217
|
+
task.task_data = task_data;
|
|
218
|
+
}
|
|
219
|
+
this->task_queue.push(task);
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
///-------------------------------------------------------------------------------------
|
|
223
|
+
///�����̴߳Ӷ�����ȡ�����ݣ�ת��Ϊpython�����������
|
|
224
|
+
///-------------------------------------------------------------------------------------
|
|
225
|
+
|
|
226
|
+
void MdApi::processTask()
|
|
227
|
+
{
|
|
228
|
+
try
|
|
229
|
+
{
|
|
230
|
+
while (this->active)
|
|
231
|
+
{
|
|
232
|
+
Task task = this->task_queue.pop();
|
|
233
|
+
|
|
234
|
+
switch (task.task_name)
|
|
235
|
+
{
|
|
236
|
+
case ONFRONTCONNECTED:
|
|
237
|
+
{
|
|
238
|
+
this->processFrontConnected(&task);
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
case ONFRONTDISCONNECTED:
|
|
243
|
+
{
|
|
244
|
+
this->processFrontDisconnected(&task);
|
|
245
|
+
break;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
case ONHEARTBEATWARNING:
|
|
249
|
+
{
|
|
250
|
+
this->processHeartBeatWarning(&task);
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
case ONRSPUSERLOGIN:
|
|
255
|
+
{
|
|
256
|
+
this->processRspUserLogin(&task);
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
case ONRSPUSERLOGOUT:
|
|
261
|
+
{
|
|
262
|
+
this->processRspUserLogout(&task);
|
|
263
|
+
break;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
case ONRSPQRYMULTICASTINSTRUMENT:
|
|
267
|
+
{
|
|
268
|
+
this->processRspQryMulticastInstrument(&task);
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
case ONRSPERROR:
|
|
273
|
+
{
|
|
274
|
+
this->processRspError(&task);
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
case ONRSPSUBMARKETDATA:
|
|
279
|
+
{
|
|
280
|
+
this->processRspSubMarketData(&task);
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
case ONRSPUNSUBMARKETDATA:
|
|
285
|
+
{
|
|
286
|
+
this->processRspUnSubMarketData(&task);
|
|
287
|
+
break;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
case ONRSPSUBFORQUOTERSP:
|
|
291
|
+
{
|
|
292
|
+
this->processRspSubForQuoteRsp(&task);
|
|
293
|
+
break;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
case ONRSPUNSUBFORQUOTERSP:
|
|
297
|
+
{
|
|
298
|
+
this->processRspUnSubForQuoteRsp(&task);
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
case ONRTNDEPTHMARKETDATA:
|
|
303
|
+
{
|
|
304
|
+
this->processRtnDepthMarketData(&task);
|
|
305
|
+
break;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
case ONRTNFORQUOTERSP:
|
|
309
|
+
{
|
|
310
|
+
this->processRtnForQuoteRsp(&task);
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
catch (const TerminatedError&)
|
|
317
|
+
{
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
void MdApi::processFrontConnected(Task *task)
|
|
322
|
+
{
|
|
323
|
+
gil_scoped_acquire acquire;
|
|
324
|
+
this->onFrontConnected();
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
void MdApi::processFrontDisconnected(Task *task)
|
|
328
|
+
{
|
|
329
|
+
gil_scoped_acquire acquire;
|
|
330
|
+
this->onFrontDisconnected(task->task_id);
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
void MdApi::processHeartBeatWarning(Task *task)
|
|
334
|
+
{
|
|
335
|
+
gil_scoped_acquire acquire;
|
|
336
|
+
this->onHeartBeatWarning(task->task_id);
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
void MdApi::processRspUserLogin(Task *task)
|
|
340
|
+
{
|
|
341
|
+
gil_scoped_acquire acquire;
|
|
342
|
+
dict data;
|
|
343
|
+
if (task->task_data)
|
|
344
|
+
{
|
|
345
|
+
CThostFtdcRspUserLoginField *task_data = (CThostFtdcRspUserLoginField*)task->task_data;
|
|
346
|
+
data["TradingDay"] = toUtf(task_data->TradingDay);
|
|
347
|
+
data["LoginTime"] = toUtf(task_data->LoginTime);
|
|
348
|
+
data["BrokerID"] = toUtf(task_data->BrokerID);
|
|
349
|
+
data["UserID"] = toUtf(task_data->UserID);
|
|
350
|
+
data["SystemName"] = toUtf(task_data->SystemName);
|
|
351
|
+
data["FrontID"] = task_data->FrontID;
|
|
352
|
+
data["SessionID"] = task_data->SessionID;
|
|
353
|
+
data["MaxOrderRef"] = toUtf(task_data->MaxOrderRef);
|
|
354
|
+
data["SHFETime"] = toUtf(task_data->SHFETime);
|
|
355
|
+
data["DCETime"] = toUtf(task_data->DCETime);
|
|
356
|
+
data["CZCETime"] = toUtf(task_data->CZCETime);
|
|
357
|
+
data["FFEXTime"] = toUtf(task_data->FFEXTime);
|
|
358
|
+
data["INETime"] = toUtf(task_data->INETime);
|
|
359
|
+
data["SysVersion"] = toUtf(task_data->SysVersion);
|
|
360
|
+
delete task_data;
|
|
361
|
+
}
|
|
362
|
+
dict error;
|
|
363
|
+
if (task->task_error)
|
|
364
|
+
{
|
|
365
|
+
CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
|
|
366
|
+
error["ErrorID"] = task_error->ErrorID;
|
|
367
|
+
error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
|
|
368
|
+
delete task_error;
|
|
369
|
+
}
|
|
370
|
+
this->onRspUserLogin(data, error, task->task_id, task->task_last);
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
void MdApi::processRspUserLogout(Task *task)
|
|
374
|
+
{
|
|
375
|
+
gil_scoped_acquire acquire;
|
|
376
|
+
dict data;
|
|
377
|
+
if (task->task_data)
|
|
378
|
+
{
|
|
379
|
+
CThostFtdcUserLogoutField *task_data = (CThostFtdcUserLogoutField*)task->task_data;
|
|
380
|
+
data["BrokerID"] = toUtf(task_data->BrokerID);
|
|
381
|
+
data["UserID"] = toUtf(task_data->UserID);
|
|
382
|
+
delete task_data;
|
|
383
|
+
}
|
|
384
|
+
dict error;
|
|
385
|
+
if (task->task_error)
|
|
386
|
+
{
|
|
387
|
+
CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
|
|
388
|
+
error["ErrorID"] = task_error->ErrorID;
|
|
389
|
+
error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
|
|
390
|
+
delete task_error;
|
|
391
|
+
}
|
|
392
|
+
this->onRspUserLogout(data, error, task->task_id, task->task_last);
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
void MdApi::processRspQryMulticastInstrument(Task *task)
|
|
396
|
+
{
|
|
397
|
+
gil_scoped_acquire acquire;
|
|
398
|
+
dict data;
|
|
399
|
+
if (task->task_data)
|
|
400
|
+
{
|
|
401
|
+
CThostFtdcMulticastInstrumentField *task_data = (CThostFtdcMulticastInstrumentField*)task->task_data;
|
|
402
|
+
data["TopicID"] = task_data->TopicID;
|
|
403
|
+
data["reserve1"] = toUtf(task_data->reserve1);
|
|
404
|
+
data["InstrumentNo"] = task_data->InstrumentNo;
|
|
405
|
+
data["CodePrice"] = task_data->CodePrice;
|
|
406
|
+
data["VolumeMultiple"] = task_data->VolumeMultiple;
|
|
407
|
+
data["PriceTick"] = task_data->PriceTick;
|
|
408
|
+
data["InstrumentID"] = toUtf(task_data->InstrumentID);
|
|
409
|
+
delete task_data;
|
|
410
|
+
}
|
|
411
|
+
dict error;
|
|
412
|
+
if (task->task_error)
|
|
413
|
+
{
|
|
414
|
+
CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
|
|
415
|
+
error["ErrorID"] = task_error->ErrorID;
|
|
416
|
+
error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
|
|
417
|
+
delete task_error;
|
|
418
|
+
}
|
|
419
|
+
this->onRspQryMulticastInstrument(data, error, task->task_id, task->task_last);
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
void MdApi::processRspError(Task *task)
|
|
423
|
+
{
|
|
424
|
+
gil_scoped_acquire acquire;
|
|
425
|
+
dict error;
|
|
426
|
+
if (task->task_error)
|
|
427
|
+
{
|
|
428
|
+
CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
|
|
429
|
+
error["ErrorID"] = task_error->ErrorID;
|
|
430
|
+
error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
|
|
431
|
+
delete task_error;
|
|
432
|
+
}
|
|
433
|
+
this->onRspError(error, task->task_id, task->task_last);
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
void MdApi::processRspSubMarketData(Task *task)
|
|
437
|
+
{
|
|
438
|
+
gil_scoped_acquire acquire;
|
|
439
|
+
dict data;
|
|
440
|
+
if (task->task_data)
|
|
441
|
+
{
|
|
442
|
+
CThostFtdcSpecificInstrumentField *task_data = (CThostFtdcSpecificInstrumentField*)task->task_data;
|
|
443
|
+
data["reserve1"] = toUtf(task_data->reserve1);
|
|
444
|
+
data["InstrumentID"] = toUtf(task_data->InstrumentID);
|
|
445
|
+
delete task_data;
|
|
446
|
+
}
|
|
447
|
+
dict error;
|
|
448
|
+
if (task->task_error)
|
|
449
|
+
{
|
|
450
|
+
CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
|
|
451
|
+
error["ErrorID"] = task_error->ErrorID;
|
|
452
|
+
error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
|
|
453
|
+
delete task_error;
|
|
454
|
+
}
|
|
455
|
+
this->onRspSubMarketData(data, error, task->task_id, task->task_last);
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
void MdApi::processRspUnSubMarketData(Task *task)
|
|
459
|
+
{
|
|
460
|
+
gil_scoped_acquire acquire;
|
|
461
|
+
dict data;
|
|
462
|
+
if (task->task_data)
|
|
463
|
+
{
|
|
464
|
+
CThostFtdcSpecificInstrumentField *task_data = (CThostFtdcSpecificInstrumentField*)task->task_data;
|
|
465
|
+
data["reserve1"] = toUtf(task_data->reserve1);
|
|
466
|
+
data["InstrumentID"] = toUtf(task_data->InstrumentID);
|
|
467
|
+
delete task_data;
|
|
468
|
+
}
|
|
469
|
+
dict error;
|
|
470
|
+
if (task->task_error)
|
|
471
|
+
{
|
|
472
|
+
CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
|
|
473
|
+
error["ErrorID"] = task_error->ErrorID;
|
|
474
|
+
error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
|
|
475
|
+
delete task_error;
|
|
476
|
+
}
|
|
477
|
+
this->onRspUnSubMarketData(data, error, task->task_id, task->task_last);
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
void MdApi::processRspSubForQuoteRsp(Task *task)
|
|
481
|
+
{
|
|
482
|
+
gil_scoped_acquire acquire;
|
|
483
|
+
dict data;
|
|
484
|
+
if (task->task_data)
|
|
485
|
+
{
|
|
486
|
+
CThostFtdcSpecificInstrumentField *task_data = (CThostFtdcSpecificInstrumentField*)task->task_data;
|
|
487
|
+
data["reserve1"] = toUtf(task_data->reserve1);
|
|
488
|
+
data["InstrumentID"] = toUtf(task_data->InstrumentID);
|
|
489
|
+
delete task_data;
|
|
490
|
+
}
|
|
491
|
+
dict error;
|
|
492
|
+
if (task->task_error)
|
|
493
|
+
{
|
|
494
|
+
CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
|
|
495
|
+
error["ErrorID"] = task_error->ErrorID;
|
|
496
|
+
error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
|
|
497
|
+
delete task_error;
|
|
498
|
+
}
|
|
499
|
+
this->onRspSubForQuoteRsp(data, error, task->task_id, task->task_last);
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
void MdApi::processRspUnSubForQuoteRsp(Task *task)
|
|
503
|
+
{
|
|
504
|
+
gil_scoped_acquire acquire;
|
|
505
|
+
dict data;
|
|
506
|
+
if (task->task_data)
|
|
507
|
+
{
|
|
508
|
+
CThostFtdcSpecificInstrumentField *task_data = (CThostFtdcSpecificInstrumentField*)task->task_data;
|
|
509
|
+
data["reserve1"] = toUtf(task_data->reserve1);
|
|
510
|
+
data["InstrumentID"] = toUtf(task_data->InstrumentID);
|
|
511
|
+
delete task_data;
|
|
512
|
+
}
|
|
513
|
+
dict error;
|
|
514
|
+
if (task->task_error)
|
|
515
|
+
{
|
|
516
|
+
CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
|
|
517
|
+
error["ErrorID"] = task_error->ErrorID;
|
|
518
|
+
error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
|
|
519
|
+
delete task_error;
|
|
520
|
+
}
|
|
521
|
+
this->onRspUnSubForQuoteRsp(data, error, task->task_id, task->task_last);
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
void MdApi::processRtnDepthMarketData(Task *task)
|
|
525
|
+
{
|
|
526
|
+
gil_scoped_acquire acquire;
|
|
527
|
+
dict data;
|
|
528
|
+
if (task->task_data)
|
|
529
|
+
{
|
|
530
|
+
CThostFtdcDepthMarketDataField *task_data = (CThostFtdcDepthMarketDataField*)task->task_data;
|
|
531
|
+
data["TradingDay"] = toUtf(task_data->TradingDay);
|
|
532
|
+
data["reserve1"] = toUtf(task_data->reserve1);
|
|
533
|
+
data["ExchangeID"] = toUtf(task_data->ExchangeID);
|
|
534
|
+
data["reserve2"] = toUtf(task_data->reserve2);
|
|
535
|
+
data["LastPrice"] = task_data->LastPrice;
|
|
536
|
+
data["PreSettlementPrice"] = task_data->PreSettlementPrice;
|
|
537
|
+
data["PreClosePrice"] = task_data->PreClosePrice;
|
|
538
|
+
data["PreOpenInterest"] = task_data->PreOpenInterest;
|
|
539
|
+
data["OpenPrice"] = task_data->OpenPrice;
|
|
540
|
+
data["HighestPrice"] = task_data->HighestPrice;
|
|
541
|
+
data["LowestPrice"] = task_data->LowestPrice;
|
|
542
|
+
data["Volume"] = task_data->Volume;
|
|
543
|
+
data["Turnover"] = task_data->Turnover;
|
|
544
|
+
data["OpenInterest"] = task_data->OpenInterest;
|
|
545
|
+
data["ClosePrice"] = task_data->ClosePrice;
|
|
546
|
+
data["SettlementPrice"] = task_data->SettlementPrice;
|
|
547
|
+
data["UpperLimitPrice"] = task_data->UpperLimitPrice;
|
|
548
|
+
data["LowerLimitPrice"] = task_data->LowerLimitPrice;
|
|
549
|
+
data["PreDelta"] = task_data->PreDelta;
|
|
550
|
+
data["CurrDelta"] = task_data->CurrDelta;
|
|
551
|
+
data["UpdateTime"] = toUtf(task_data->UpdateTime);
|
|
552
|
+
data["UpdateMillisec"] = task_data->UpdateMillisec;
|
|
553
|
+
data["BidPrice1"] = task_data->BidPrice1;
|
|
554
|
+
data["BidVolume1"] = task_data->BidVolume1;
|
|
555
|
+
data["AskPrice1"] = task_data->AskPrice1;
|
|
556
|
+
data["AskVolume1"] = task_data->AskVolume1;
|
|
557
|
+
data["BidPrice2"] = task_data->BidPrice2;
|
|
558
|
+
data["BidVolume2"] = task_data->BidVolume2;
|
|
559
|
+
data["AskPrice2"] = task_data->AskPrice2;
|
|
560
|
+
data["AskVolume2"] = task_data->AskVolume2;
|
|
561
|
+
data["BidPrice3"] = task_data->BidPrice3;
|
|
562
|
+
data["BidVolume3"] = task_data->BidVolume3;
|
|
563
|
+
data["AskPrice3"] = task_data->AskPrice3;
|
|
564
|
+
data["AskVolume3"] = task_data->AskVolume3;
|
|
565
|
+
data["BidPrice4"] = task_data->BidPrice4;
|
|
566
|
+
data["BidVolume4"] = task_data->BidVolume4;
|
|
567
|
+
data["AskPrice4"] = task_data->AskPrice4;
|
|
568
|
+
data["AskVolume4"] = task_data->AskVolume4;
|
|
569
|
+
data["BidPrice5"] = task_data->BidPrice5;
|
|
570
|
+
data["BidVolume5"] = task_data->BidVolume5;
|
|
571
|
+
data["AskPrice5"] = task_data->AskPrice5;
|
|
572
|
+
data["AskVolume5"] = task_data->AskVolume5;
|
|
573
|
+
data["AveragePrice"] = task_data->AveragePrice;
|
|
574
|
+
data["ActionDay"] = toUtf(task_data->ActionDay);
|
|
575
|
+
data["InstrumentID"] = toUtf(task_data->InstrumentID);
|
|
576
|
+
data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID);
|
|
577
|
+
data["BandingUpperPrice"] = task_data->BandingUpperPrice;
|
|
578
|
+
data["BandingLowerPrice"] = task_data->BandingLowerPrice;
|
|
579
|
+
delete task_data;
|
|
580
|
+
}
|
|
581
|
+
this->onRtnDepthMarketData(data);
|
|
582
|
+
};
|
|
583
|
+
|
|
584
|
+
void MdApi::processRtnForQuoteRsp(Task *task)
|
|
585
|
+
{
|
|
586
|
+
gil_scoped_acquire acquire;
|
|
587
|
+
dict data;
|
|
588
|
+
if (task->task_data)
|
|
589
|
+
{
|
|
590
|
+
CThostFtdcForQuoteRspField *task_data = (CThostFtdcForQuoteRspField*)task->task_data;
|
|
591
|
+
data["TradingDay"] = toUtf(task_data->TradingDay);
|
|
592
|
+
data["reserve1"] = toUtf(task_data->reserve1);
|
|
593
|
+
data["ForQuoteSysID"] = toUtf(task_data->ForQuoteSysID);
|
|
594
|
+
data["ForQuoteTime"] = toUtf(task_data->ForQuoteTime);
|
|
595
|
+
data["ActionDay"] = toUtf(task_data->ActionDay);
|
|
596
|
+
data["ExchangeID"] = toUtf(task_data->ExchangeID);
|
|
597
|
+
data["InstrumentID"] = toUtf(task_data->InstrumentID);
|
|
598
|
+
delete task_data;
|
|
599
|
+
}
|
|
600
|
+
this->onRtnForQuoteRsp(data);
|
|
601
|
+
};
|
|
602
|
+
|
|
603
|
+
///-------------------------------------------------------------------------------------
|
|
604
|
+
///��������
|
|
605
|
+
///-------------------------------------------------------------------------------------
|
|
606
|
+
|
|
607
|
+
void MdApi::createFtdcMdApi(string pszFlowPath)
|
|
608
|
+
{
|
|
609
|
+
this->api = CThostFtdcMdApi::CreateFtdcMdApi(pszFlowPath.c_str());
|
|
610
|
+
this->api->RegisterSpi(this);
|
|
611
|
+
};
|
|
612
|
+
|
|
613
|
+
void MdApi::release()
|
|
614
|
+
{
|
|
615
|
+
this->api->Release();
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
void MdApi::init()
|
|
619
|
+
{
|
|
620
|
+
this->active = true;
|
|
621
|
+
this->task_thread = thread(&MdApi::processTask, this);
|
|
622
|
+
|
|
623
|
+
this->api->Init();
|
|
624
|
+
};
|
|
625
|
+
|
|
626
|
+
int MdApi::join()
|
|
627
|
+
{
|
|
628
|
+
int i = this->api->Join();
|
|
629
|
+
return i;
|
|
630
|
+
};
|
|
631
|
+
|
|
632
|
+
int MdApi::exit()
|
|
633
|
+
{
|
|
634
|
+
this->active = false;
|
|
635
|
+
this->task_queue.terminate();
|
|
636
|
+
this->task_thread.join();
|
|
637
|
+
|
|
638
|
+
this->api->RegisterSpi(NULL);
|
|
639
|
+
this->api->Release();
|
|
640
|
+
this->api = NULL;
|
|
641
|
+
return 1;
|
|
642
|
+
};
|
|
643
|
+
|
|
644
|
+
string MdApi::getTradingDay()
|
|
645
|
+
{
|
|
646
|
+
string day = this->api->GetTradingDay();
|
|
647
|
+
return day;
|
|
648
|
+
};
|
|
649
|
+
|
|
650
|
+
string MdApi::getApiVersion()
|
|
651
|
+
{
|
|
652
|
+
string version = this->api->GetApiVersion();
|
|
653
|
+
return version;
|
|
654
|
+
};
|
|
655
|
+
|
|
656
|
+
void MdApi::registerFront(string pszFrontAddress)
|
|
657
|
+
{
|
|
658
|
+
this->api->RegisterFront((char*)pszFrontAddress.c_str());
|
|
659
|
+
};
|
|
660
|
+
|
|
661
|
+
void MdApi::registerNameServer(string pszNsAddress)
|
|
662
|
+
{
|
|
663
|
+
this->api->RegisterNameServer((char*)pszNsAddress.c_str());
|
|
664
|
+
};
|
|
665
|
+
|
|
666
|
+
void MdApi::registerFensUserInfo(const dict &req)
|
|
667
|
+
{
|
|
668
|
+
CThostFtdcFensUserInfoField myreq = CThostFtdcFensUserInfoField();
|
|
669
|
+
memset(&myreq, 0, sizeof(myreq));
|
|
670
|
+
getString(req, "BrokerID", myreq.BrokerID);
|
|
671
|
+
getString(req, "UserID", myreq.UserID);
|
|
672
|
+
getChar(req, "LoginMode", &myreq.LoginMode);
|
|
673
|
+
this->api->RegisterFensUserInfo(&myreq);
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
int MdApi::subscribeMarketData(string instrumentID)
|
|
677
|
+
{
|
|
678
|
+
char* buffer = (char*) instrumentID.c_str();
|
|
679
|
+
char* myreq[1] = { buffer };
|
|
680
|
+
int i = this->api->SubscribeMarketData(myreq, 1);
|
|
681
|
+
return i;
|
|
682
|
+
};
|
|
683
|
+
|
|
684
|
+
int MdApi::unSubscribeMarketData(string instrumentID)
|
|
685
|
+
{
|
|
686
|
+
char* buffer = (char*)instrumentID.c_str();
|
|
687
|
+
char* myreq[1] = { buffer };
|
|
688
|
+
int i = this->api->UnSubscribeMarketData(myreq, 1);
|
|
689
|
+
return i;
|
|
690
|
+
};
|
|
691
|
+
|
|
692
|
+
int MdApi::subscribeForQuoteRsp(string instrumentID)
|
|
693
|
+
{
|
|
694
|
+
char* buffer = (char*)instrumentID.c_str();
|
|
695
|
+
char* myreq[1] = { buffer };
|
|
696
|
+
int i = this->api->SubscribeForQuoteRsp(myreq, 1);
|
|
697
|
+
return i;
|
|
698
|
+
};
|
|
699
|
+
|
|
700
|
+
int MdApi::unSubscribeForQuoteRsp(string instrumentID)
|
|
701
|
+
{
|
|
702
|
+
char* buffer = (char*)instrumentID.c_str();
|
|
703
|
+
char* myreq[1] = { buffer };
|
|
704
|
+
int i = this->api->UnSubscribeForQuoteRsp(myreq, 1);
|
|
705
|
+
return i;
|
|
706
|
+
};
|
|
707
|
+
|
|
708
|
+
int MdApi::reqUserLogin(const dict &req, int reqid)
|
|
709
|
+
{
|
|
710
|
+
CThostFtdcReqUserLoginField myreq = CThostFtdcReqUserLoginField();
|
|
711
|
+
memset(&myreq, 0, sizeof(myreq));
|
|
712
|
+
getString(req, "TradingDay", myreq.TradingDay);
|
|
713
|
+
getString(req, "BrokerID", myreq.BrokerID);
|
|
714
|
+
getString(req, "UserID", myreq.UserID);
|
|
715
|
+
getString(req, "Password", myreq.Password);
|
|
716
|
+
getString(req, "UserProductInfo", myreq.UserProductInfo);
|
|
717
|
+
getString(req, "InterfaceProductInfo", myreq.InterfaceProductInfo);
|
|
718
|
+
getString(req, "ProtocolInfo", myreq.ProtocolInfo);
|
|
719
|
+
getString(req, "MacAddress", myreq.MacAddress);
|
|
720
|
+
getString(req, "OneTimePassword", myreq.OneTimePassword);
|
|
721
|
+
getString(req, "reserve1", myreq.reserve1);
|
|
722
|
+
getString(req, "LoginRemark", myreq.LoginRemark);
|
|
723
|
+
getInt(req, "ClientIPPort", &myreq.ClientIPPort);
|
|
724
|
+
getString(req, "ClientIPAddress", myreq.ClientIPAddress);
|
|
725
|
+
int i = this->api->ReqUserLogin(&myreq, reqid);
|
|
726
|
+
return i;
|
|
727
|
+
};
|
|
728
|
+
|
|
729
|
+
int MdApi::reqUserLogout(const dict &req, int reqid)
|
|
730
|
+
{
|
|
731
|
+
CThostFtdcUserLogoutField myreq = CThostFtdcUserLogoutField();
|
|
732
|
+
memset(&myreq, 0, sizeof(myreq));
|
|
733
|
+
getString(req, "BrokerID", myreq.BrokerID);
|
|
734
|
+
getString(req, "UserID", myreq.UserID);
|
|
735
|
+
int i = this->api->ReqUserLogout(&myreq, reqid);
|
|
736
|
+
return i;
|
|
737
|
+
};
|
|
738
|
+
|
|
739
|
+
int MdApi::reqQryMulticastInstrument(const dict &req, int reqid)
|
|
740
|
+
{
|
|
741
|
+
CThostFtdcQryMulticastInstrumentField myreq = CThostFtdcQryMulticastInstrumentField();
|
|
742
|
+
memset(&myreq, 0, sizeof(myreq));
|
|
743
|
+
getInt(req, "TopicID", &myreq.TopicID);
|
|
744
|
+
getString(req, "reserve1", myreq.reserve1);
|
|
745
|
+
getString(req, "InstrumentID", myreq.InstrumentID);
|
|
746
|
+
int i = this->api->ReqQryMulticastInstrument(&myreq, reqid);
|
|
747
|
+
return i;
|
|
748
|
+
};
|
|
749
|
+
|
|
750
|
+
///-------------------------------------------------------------------------------------
|
|
751
|
+
///Boost.Python��װ
|
|
752
|
+
///-------------------------------------------------------------------------------------
|
|
753
|
+
|
|
754
|
+
class PyMdApi: public MdApi
|
|
755
|
+
{
|
|
756
|
+
public:
|
|
757
|
+
using MdApi::MdApi;
|
|
758
|
+
|
|
759
|
+
void onFrontConnected() override
|
|
760
|
+
{
|
|
761
|
+
try
|
|
762
|
+
{
|
|
763
|
+
PYBIND11_OVERLOAD(void, MdApi, onFrontConnected);
|
|
764
|
+
}
|
|
765
|
+
catch (const error_already_set &e)
|
|
766
|
+
{
|
|
767
|
+
cout << e.what() << endl;
|
|
768
|
+
}
|
|
769
|
+
};
|
|
770
|
+
|
|
771
|
+
void onFrontDisconnected(int reqid) override
|
|
772
|
+
{
|
|
773
|
+
try
|
|
774
|
+
{
|
|
775
|
+
PYBIND11_OVERLOAD(void, MdApi, onFrontDisconnected, reqid);
|
|
776
|
+
}
|
|
777
|
+
catch (const error_already_set &e)
|
|
778
|
+
{
|
|
779
|
+
cout << e.what() << endl;
|
|
780
|
+
}
|
|
781
|
+
};
|
|
782
|
+
|
|
783
|
+
void onHeartBeatWarning(int reqid) override
|
|
784
|
+
{
|
|
785
|
+
try
|
|
786
|
+
{
|
|
787
|
+
PYBIND11_OVERLOAD(void, MdApi, onHeartBeatWarning, reqid);
|
|
788
|
+
}
|
|
789
|
+
catch (const error_already_set &e)
|
|
790
|
+
{
|
|
791
|
+
cout << e.what() << endl;
|
|
792
|
+
}
|
|
793
|
+
};
|
|
794
|
+
|
|
795
|
+
void onRspUserLogin(const dict &data, const dict &error, int reqid, bool last) override
|
|
796
|
+
{
|
|
797
|
+
try
|
|
798
|
+
{
|
|
799
|
+
PYBIND11_OVERLOAD(void, MdApi, onRspUserLogin, data, error, reqid, last);
|
|
800
|
+
}
|
|
801
|
+
catch (const error_already_set &e)
|
|
802
|
+
{
|
|
803
|
+
cout << e.what() << endl;
|
|
804
|
+
}
|
|
805
|
+
};
|
|
806
|
+
|
|
807
|
+
void onRspUserLogout(const dict &data, const dict &error, int reqid, bool last) override
|
|
808
|
+
{
|
|
809
|
+
try
|
|
810
|
+
{
|
|
811
|
+
PYBIND11_OVERLOAD(void, MdApi, onRspUserLogout, data, error, reqid, last);
|
|
812
|
+
}
|
|
813
|
+
catch (const error_already_set &e)
|
|
814
|
+
{
|
|
815
|
+
cout << e.what() << endl;
|
|
816
|
+
}
|
|
817
|
+
};
|
|
818
|
+
|
|
819
|
+
void onRspQryMulticastInstrument(const dict &data, const dict &error, int reqid, bool last) override
|
|
820
|
+
{
|
|
821
|
+
try
|
|
822
|
+
{
|
|
823
|
+
PYBIND11_OVERLOAD(void, MdApi, onRspQryMulticastInstrument, data, error, reqid, last);
|
|
824
|
+
}
|
|
825
|
+
catch (const error_already_set &e)
|
|
826
|
+
{
|
|
827
|
+
cout << e.what() << endl;
|
|
828
|
+
}
|
|
829
|
+
};
|
|
830
|
+
|
|
831
|
+
void onRspError(const dict &error, int reqid, bool last) override
|
|
832
|
+
{
|
|
833
|
+
try
|
|
834
|
+
{
|
|
835
|
+
PYBIND11_OVERLOAD(void, MdApi, onRspError, error, reqid, last);
|
|
836
|
+
}
|
|
837
|
+
catch (const error_already_set &e)
|
|
838
|
+
{
|
|
839
|
+
cout << e.what() << endl;
|
|
840
|
+
}
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
void onRspSubMarketData(const dict &data, const dict &error, int reqid, bool last) override
|
|
844
|
+
{
|
|
845
|
+
try
|
|
846
|
+
{
|
|
847
|
+
PYBIND11_OVERLOAD(void, MdApi, onRspSubMarketData, data, error, reqid, last);
|
|
848
|
+
}
|
|
849
|
+
catch (const error_already_set &e)
|
|
850
|
+
{
|
|
851
|
+
cout << e.what() << endl;
|
|
852
|
+
}
|
|
853
|
+
};
|
|
854
|
+
|
|
855
|
+
void onRspUnSubMarketData(const dict &data, const dict &error, int reqid, bool last) override
|
|
856
|
+
{
|
|
857
|
+
try
|
|
858
|
+
{
|
|
859
|
+
PYBIND11_OVERLOAD(void, MdApi, onRspUnSubMarketData, data, error, reqid, last);
|
|
860
|
+
}
|
|
861
|
+
catch (const error_already_set &e)
|
|
862
|
+
{
|
|
863
|
+
cout << e.what() << endl;
|
|
864
|
+
}
|
|
865
|
+
};
|
|
866
|
+
|
|
867
|
+
void onRspSubForQuoteRsp(const dict &data, const dict &error, int reqid, bool last) override
|
|
868
|
+
{
|
|
869
|
+
try
|
|
870
|
+
{
|
|
871
|
+
PYBIND11_OVERLOAD(void, MdApi, onRspSubForQuoteRsp, data, error, reqid, last);
|
|
872
|
+
}
|
|
873
|
+
catch (const error_already_set &e)
|
|
874
|
+
{
|
|
875
|
+
cout << e.what() << endl;
|
|
876
|
+
}
|
|
877
|
+
};
|
|
878
|
+
|
|
879
|
+
void onRspUnSubForQuoteRsp(const dict &data, const dict &error, int reqid, bool last) override
|
|
880
|
+
{
|
|
881
|
+
try
|
|
882
|
+
{
|
|
883
|
+
PYBIND11_OVERLOAD(void, MdApi, onRspUnSubForQuoteRsp, data, error, reqid, last);
|
|
884
|
+
}
|
|
885
|
+
catch (const error_already_set &e)
|
|
886
|
+
{
|
|
887
|
+
cout << e.what() << endl;
|
|
888
|
+
}
|
|
889
|
+
};
|
|
890
|
+
|
|
891
|
+
void onRtnDepthMarketData(const dict &data) override
|
|
892
|
+
{
|
|
893
|
+
try
|
|
894
|
+
{
|
|
895
|
+
PYBIND11_OVERLOAD(void, MdApi, onRtnDepthMarketData, data);
|
|
896
|
+
}
|
|
897
|
+
catch (const error_already_set &e)
|
|
898
|
+
{
|
|
899
|
+
cout << e.what() << endl;
|
|
900
|
+
}
|
|
901
|
+
};
|
|
902
|
+
|
|
903
|
+
void onRtnForQuoteRsp(const dict &data) override
|
|
904
|
+
{
|
|
905
|
+
try
|
|
906
|
+
{
|
|
907
|
+
PYBIND11_OVERLOAD(void, MdApi, onRtnForQuoteRsp, data);
|
|
908
|
+
}
|
|
909
|
+
catch (const error_already_set &e)
|
|
910
|
+
{
|
|
911
|
+
cout << e.what() << endl;
|
|
912
|
+
}
|
|
913
|
+
};
|
|
914
|
+
};
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
PYBIND11_MODULE(vnctpmd, m)
|
|
918
|
+
{
|
|
919
|
+
class_<MdApi, PyMdApi> mdapi(m, "MdApi", module_local());
|
|
920
|
+
mdapi
|
|
921
|
+
.def(init<>())
|
|
922
|
+
.def("createFtdcMdApi", &MdApi::createFtdcMdApi)
|
|
923
|
+
.def("release", &MdApi::release)
|
|
924
|
+
.def("init", &MdApi::init)
|
|
925
|
+
.def("join", &MdApi::join)
|
|
926
|
+
.def("exit", &MdApi::exit)
|
|
927
|
+
.def("getTradingDay", &MdApi::getTradingDay)
|
|
928
|
+
.def("registerFront", &MdApi::registerFront)
|
|
929
|
+
.def("registerNameServer", &MdApi::registerNameServer)
|
|
930
|
+
.def("registerFensUserInfo", &MdApi::registerFensUserInfo)
|
|
931
|
+
.def("subscribeMarketData", &MdApi::subscribeMarketData)
|
|
932
|
+
.def("unSubscribeMarketData", &MdApi::unSubscribeMarketData)
|
|
933
|
+
.def("subscribeForQuoteRsp", &MdApi::subscribeForQuoteRsp)
|
|
934
|
+
.def("unSubscribeForQuoteRsp", &MdApi::unSubscribeForQuoteRsp)
|
|
935
|
+
.def("reqUserLogin", &MdApi::reqUserLogin)
|
|
936
|
+
.def("reqUserLogout", &MdApi::reqUserLogout)
|
|
937
|
+
.def("reqQryMulticastInstrument", &MdApi::reqQryMulticastInstrument)
|
|
938
|
+
|
|
939
|
+
.def("onFrontConnected", &MdApi::onFrontConnected)
|
|
940
|
+
.def("onFrontDisconnected", &MdApi::onFrontDisconnected)
|
|
941
|
+
.def("onHeartBeatWarning", &MdApi::onHeartBeatWarning)
|
|
942
|
+
.def("onRspUserLogin", &MdApi::onRspUserLogin)
|
|
943
|
+
.def("onRspUserLogout", &MdApi::onRspUserLogout)
|
|
944
|
+
.def("onRspQryMulticastInstrument", &MdApi::onRspQryMulticastInstrument)
|
|
945
|
+
.def("onRspError", &MdApi::onRspError)
|
|
946
|
+
.def("onRspSubMarketData", &MdApi::onRspSubMarketData)
|
|
947
|
+
.def("onRspUnSubMarketData", &MdApi::onRspUnSubMarketData)
|
|
948
|
+
.def("onRspSubForQuoteRsp", &MdApi::onRspSubForQuoteRsp)
|
|
949
|
+
.def("onRspUnSubForQuoteRsp", &MdApi::onRspUnSubForQuoteRsp)
|
|
950
|
+
.def("onRtnDepthMarketData", &MdApi::onRtnDepthMarketData)
|
|
951
|
+
.def("onRtnForQuoteRsp", &MdApi::onRtnForQuoteRsp)
|
|
952
|
+
;
|
|
953
|
+
}
|