ctpbee-opt-api 0.1.0__cp39-cp39-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.
Files changed (414) hide show
  1. ctpbee_api/__init__.py +17 -0
  2. ctpbee_api/ctp/__init__.py +3 -0
  3. ctpbee_api/ctp/ctp_constant.py +1253 -0
  4. ctpbee_api/ctp/generator/concat.py +93 -0
  5. ctpbee_api/ctp/generator/const.py +325 -0
  6. ctpbee_api/ctp/generator/ctp_constant.py +1274 -0
  7. ctpbee_api/ctp/generator/ctp_md_header_define.h +13 -0
  8. ctpbee_api/ctp/generator/ctp_md_header_function.h +6 -0
  9. ctpbee_api/ctp/generator/ctp_md_header_on.h +26 -0
  10. ctpbee_api/ctp/generator/ctp_md_header_process.h +26 -0
  11. ctpbee_api/ctp/generator/ctp_md_source_function.cpp +42 -0
  12. ctpbee_api/ctp/generator/ctp_md_source_module.cpp +18 -0
  13. ctpbee_api/ctp/generator/ctp_md_source_on.cpp +156 -0
  14. ctpbee_api/ctp/generator/ctp_md_source_process.cpp +282 -0
  15. ctpbee_api/ctp/generator/ctp_md_source_switch.cpp +78 -0
  16. ctpbee_api/ctp/generator/ctp_md_source_task.cpp +211 -0
  17. ctpbee_api/ctp/generator/ctp_struct.py +5640 -0
  18. ctpbee_api/ctp/generator/ctp_td_header_define.h +130 -0
  19. ctpbee_api/ctp/generator/ctp_td_header_function.h +174 -0
  20. ctpbee_api/ctp/generator/ctp_td_header_on.h +260 -0
  21. ctpbee_api/ctp/generator/ctp_td_header_process.h +260 -0
  22. ctpbee_api/ctp/generator/ctp_td_source_function.cpp +1456 -0
  23. ctpbee_api/ctp/generator/ctp_td_source_module.cpp +222 -0
  24. ctpbee_api/ctp/generator/ctp_td_source_on.cpp +1572 -0
  25. ctpbee_api/ctp/generator/ctp_td_source_process.cpp +5472 -0
  26. ctpbee_api/ctp/generator/ctp_td_source_switch.cpp +780 -0
  27. ctpbee_api/ctp/generator/ctp_td_source_task.cpp +2444 -0
  28. ctpbee_api/ctp/generator/ctp_typedef.py +800 -0
  29. ctpbee_api/ctp/generator/generate_api_functions.py +345 -0
  30. ctpbee_api/ctp/generator/generate_data_type.py +76 -0
  31. ctpbee_api/ctp/generator/generate_struct.py +84 -0
  32. ctpbee_api/ctp/include/mac/ctp/ThostFtdcMdApi.h +168 -0
  33. ctpbee_api/ctp/include/mac/ctp/ThostFtdcTraderApi.h +770 -0
  34. ctpbee_api/ctp/include/mac/ctp/ThostFtdcUserApiDataType.h +6878 -0
  35. ctpbee_api/ctp/include/mac/ctp/ThostFtdcUserApiStruct.h +10915 -0
  36. ctpbee_api/ctp/include/mac/pybind11/attr.h +690 -0
  37. ctpbee_api/ctp/include/mac/pybind11/buffer_info.h +208 -0
  38. ctpbee_api/ctp/include/mac/pybind11/cast.h +1704 -0
  39. ctpbee_api/ctp/include/mac/pybind11/chrono.h +225 -0
  40. ctpbee_api/ctp/include/mac/pybind11/common.h +2 -0
  41. ctpbee_api/ctp/include/mac/pybind11/complex.h +74 -0
  42. ctpbee_api/ctp/include/mac/pybind11/detail/class.h +743 -0
  43. ctpbee_api/ctp/include/mac/pybind11/detail/common.h +1255 -0
  44. ctpbee_api/ctp/include/mac/pybind11/detail/descr.h +171 -0
  45. ctpbee_api/ctp/include/mac/pybind11/detail/init.h +434 -0
  46. ctpbee_api/ctp/include/mac/pybind11/detail/internals.h +656 -0
  47. ctpbee_api/ctp/include/mac/pybind11/detail/type_caster_base.h +1177 -0
  48. ctpbee_api/ctp/include/mac/pybind11/detail/typeid.h +65 -0
  49. ctpbee_api/ctp/include/mac/pybind11/eigen/common.h +9 -0
  50. ctpbee_api/ctp/include/mac/pybind11/eigen/matrix.h +714 -0
  51. ctpbee_api/ctp/include/mac/pybind11/eigen/tensor.h +516 -0
  52. ctpbee_api/ctp/include/mac/pybind11/eigen.h +12 -0
  53. ctpbee_api/ctp/include/mac/pybind11/embed.h +316 -0
  54. ctpbee_api/ctp/include/mac/pybind11/eval.h +156 -0
  55. ctpbee_api/ctp/include/mac/pybind11/functional.h +137 -0
  56. ctpbee_api/ctp/include/mac/pybind11/gil.h +239 -0
  57. ctpbee_api/ctp/include/mac/pybind11/iostream.h +265 -0
  58. ctpbee_api/ctp/include/mac/pybind11/numpy.h +1998 -0
  59. ctpbee_api/ctp/include/mac/pybind11/operators.h +202 -0
  60. ctpbee_api/ctp/include/mac/pybind11/options.h +92 -0
  61. ctpbee_api/ctp/include/mac/pybind11/pybind11.h +2890 -0
  62. ctpbee_api/ctp/include/mac/pybind11/pytypes.h +2557 -0
  63. ctpbee_api/ctp/include/mac/pybind11/stl/filesystem.h +116 -0
  64. ctpbee_api/ctp/include/mac/pybind11/stl.h +447 -0
  65. ctpbee_api/ctp/include/mac/pybind11/stl_bind.h +851 -0
  66. ctpbee_api/ctp/include/mac/pybind11/type_caster_pyobject_ptr.h +61 -0
  67. ctpbee_api/ctp/include/new/ctp/ThostFtdcMdApi.h +168 -0
  68. ctpbee_api/ctp/include/new/ctp/ThostFtdcTraderApi.h +770 -0
  69. ctpbee_api/ctp/include/new/ctp/ThostFtdcUserApiDataType.h +6878 -0
  70. ctpbee_api/ctp/include/new/ctp/ThostFtdcUserApiStruct.h +10915 -0
  71. ctpbee_api/ctp/include/new/pybind11/attr.h +690 -0
  72. ctpbee_api/ctp/include/new/pybind11/buffer_info.h +208 -0
  73. ctpbee_api/ctp/include/new/pybind11/cast.h +1704 -0
  74. ctpbee_api/ctp/include/new/pybind11/chrono.h +225 -0
  75. ctpbee_api/ctp/include/new/pybind11/common.h +2 -0
  76. ctpbee_api/ctp/include/new/pybind11/complex.h +74 -0
  77. ctpbee_api/ctp/include/new/pybind11/detail/class.h +743 -0
  78. ctpbee_api/ctp/include/new/pybind11/detail/common.h +1255 -0
  79. ctpbee_api/ctp/include/new/pybind11/detail/descr.h +171 -0
  80. ctpbee_api/ctp/include/new/pybind11/detail/init.h +434 -0
  81. ctpbee_api/ctp/include/new/pybind11/detail/internals.h +656 -0
  82. ctpbee_api/ctp/include/new/pybind11/detail/type_caster_base.h +1177 -0
  83. ctpbee_api/ctp/include/new/pybind11/detail/typeid.h +65 -0
  84. ctpbee_api/ctp/include/new/pybind11/eigen/common.h +9 -0
  85. ctpbee_api/ctp/include/new/pybind11/eigen/matrix.h +714 -0
  86. ctpbee_api/ctp/include/new/pybind11/eigen/tensor.h +516 -0
  87. ctpbee_api/ctp/include/new/pybind11/eigen.h +12 -0
  88. ctpbee_api/ctp/include/new/pybind11/embed.h +316 -0
  89. ctpbee_api/ctp/include/new/pybind11/eval.h +156 -0
  90. ctpbee_api/ctp/include/new/pybind11/functional.h +137 -0
  91. ctpbee_api/ctp/include/new/pybind11/gil.h +239 -0
  92. ctpbee_api/ctp/include/new/pybind11/iostream.h +265 -0
  93. ctpbee_api/ctp/include/new/pybind11/numpy.h +1998 -0
  94. ctpbee_api/ctp/include/new/pybind11/operators.h +202 -0
  95. ctpbee_api/ctp/include/new/pybind11/options.h +92 -0
  96. ctpbee_api/ctp/include/new/pybind11/pybind11.h +2890 -0
  97. ctpbee_api/ctp/include/new/pybind11/pytypes.h +2557 -0
  98. ctpbee_api/ctp/include/new/pybind11/stl/filesystem.h +116 -0
  99. ctpbee_api/ctp/include/new/pybind11/stl.h +447 -0
  100. ctpbee_api/ctp/include/new/pybind11/stl_bind.h +851 -0
  101. ctpbee_api/ctp/include/new/pybind11/type_caster_pyobject_ptr.h +61 -0
  102. ctpbee_api/ctp/include/previous/ctp/ThostFtdcMdApi.h +168 -0
  103. ctpbee_api/ctp/include/previous/ctp/ThostFtdcTraderApi.h +770 -0
  104. ctpbee_api/ctp/include/previous/ctp/ThostFtdcUserApiDataType.h +6878 -0
  105. ctpbee_api/ctp/include/previous/ctp/ThostFtdcUserApiStruct.h +10915 -0
  106. ctpbee_api/ctp/include/previous/pybind11/attr.h +489 -0
  107. ctpbee_api/ctp/include/previous/pybind11/buffer_info.h +108 -0
  108. ctpbee_api/ctp/include/previous/pybind11/cast.h +2067 -0
  109. ctpbee_api/ctp/include/previous/pybind11/chrono.h +162 -0
  110. ctpbee_api/ctp/include/previous/pybind11/common.h +2 -0
  111. ctpbee_api/ctp/include/previous/pybind11/complex.h +61 -0
  112. ctpbee_api/ctp/include/previous/pybind11/detail/class.h +626 -0
  113. ctpbee_api/ctp/include/previous/pybind11/detail/common.h +803 -0
  114. ctpbee_api/ctp/include/previous/pybind11/detail/descr.h +185 -0
  115. ctpbee_api/ctp/include/previous/pybind11/detail/init.h +335 -0
  116. ctpbee_api/ctp/include/previous/pybind11/detail/internals.h +285 -0
  117. ctpbee_api/ctp/include/previous/pybind11/detail/typeid.h +53 -0
  118. ctpbee_api/ctp/include/previous/pybind11/eigen.h +604 -0
  119. ctpbee_api/ctp/include/previous/pybind11/embed.h +194 -0
  120. ctpbee_api/ctp/include/previous/pybind11/eval.h +117 -0
  121. ctpbee_api/ctp/include/previous/pybind11/functional.h +85 -0
  122. ctpbee_api/ctp/include/previous/pybind11/iostream.h +200 -0
  123. ctpbee_api/ctp/include/previous/pybind11/numpy.h +1601 -0
  124. ctpbee_api/ctp/include/previous/pybind11/operators.h +168 -0
  125. ctpbee_api/ctp/include/previous/pybind11/options.h +65 -0
  126. ctpbee_api/ctp/include/previous/pybind11/pybind11.h +1965 -0
  127. ctpbee_api/ctp/include/previous/pybind11/pytypes.h +1332 -0
  128. ctpbee_api/ctp/include/previous/pybind11/stl.h +376 -0
  129. ctpbee_api/ctp/include/previous/pybind11/stl_bind.h +599 -0
  130. ctpbee_api/ctp/libs/libcomunicationkey.a +0 -0
  131. ctpbee_api/ctp/libs/libcrypto.a +0 -0
  132. ctpbee_api/ctp/libs/libssl.a +0 -0
  133. ctpbee_api/ctp/libs/thostmduserapi_se.lib +0 -0
  134. ctpbee_api/ctp/libs/thosttraderapi_se.lib +0 -0
  135. ctpbee_api/ctp/libthostmduserapi_se.so +0 -0
  136. ctpbee_api/ctp/libthosttraderapi_se.so +0 -0
  137. ctpbee_api/ctp/thostmduserapi_se.dll +0 -0
  138. ctpbee_api/ctp/thosttraderapi_se.dll +0 -0
  139. ctpbee_api/ctp/vnctp/vnctp.h +189 -0
  140. ctpbee_api/ctp/vnctp/vnctp.sln +41 -0
  141. ctpbee_api/ctp/vnctp/vnctpmd/dllmain.cpp +19 -0
  142. ctpbee_api/ctp/vnctp/vnctpmd/stdafx.cpp +1 -0
  143. ctpbee_api/ctp/vnctp/vnctpmd/stdafx.h +17 -0
  144. ctpbee_api/ctp/vnctp/vnctpmd/targetver.h +8 -0
  145. ctpbee_api/ctp/vnctp/vnctpmd/vnctpmd.cpp +953 -0
  146. ctpbee_api/ctp/vnctp/vnctpmd/vnctpmd.h +209 -0
  147. ctpbee_api/ctp/vnctp/vnctpmd/vnctpmd.vcxproj +200 -0
  148. ctpbee_api/ctp/vnctp/vnctpmd/vnctpmd.vcxproj.filters +54 -0
  149. ctpbee_api/ctp/vnctp/vnctpmd/vnctpmd.vcxproj.user +4 -0
  150. ctpbee_api/ctp/vnctp/vnctptd/dllmain.cpp +19 -0
  151. ctpbee_api/ctp/vnctp/vnctptd/stdafx.cpp +1 -0
  152. ctpbee_api/ctp/vnctp/vnctptd/stdafx.h +16 -0
  153. ctpbee_api/ctp/vnctp/vnctptd/targetver.h +8 -0
  154. ctpbee_api/ctp/vnctp/vnctptd/vnctptd.cpp +12148 -0
  155. ctpbee_api/ctp/vnctp/vnctptd/vnctptd.h +1329 -0
  156. ctpbee_api/ctp/vnctp/vnctptd/vnctptd.vcxproj +198 -0
  157. ctpbee_api/ctp/vnctp/vnctptd/vnctptd.vcxproj.filters +54 -0
  158. ctpbee_api/ctp/vnctp/vnctptd/vnctptd.vcxproj.user +4 -0
  159. ctpbee_api/ctp/vnctpmd.cp39-win_amd64.pyd +0 -0
  160. ctpbee_api/ctp/vnctptd.cp39-win_amd64.pyd +0 -0
  161. ctpbee_api/ctp_mini/__init__.py +3 -0
  162. ctpbee_api/ctp_mini/generator/generate_api_functions.py +343 -0
  163. ctpbee_api/ctp_mini/generator/generate_data_type.py +76 -0
  164. ctpbee_api/ctp_mini/generator/generate_struct.py +85 -0
  165. ctpbee_api/ctp_mini/generator/mini_constant.py +1186 -0
  166. ctpbee_api/ctp_mini/generator/mini_md_header_define.h +13 -0
  167. ctpbee_api/ctp_mini/generator/mini_md_header_function.h +4 -0
  168. ctpbee_api/ctp_mini/generator/mini_md_header_on.h +26 -0
  169. ctpbee_api/ctp_mini/generator/mini_md_header_process.h +26 -0
  170. ctpbee_api/ctp_mini/generator/mini_md_source_function.cpp +29 -0
  171. ctpbee_api/ctp_mini/generator/mini_md_source_module.cpp +17 -0
  172. ctpbee_api/ctp_mini/generator/mini_md_source_on.cpp +156 -0
  173. ctpbee_api/ctp_mini/generator/mini_md_source_process.cpp +264 -0
  174. ctpbee_api/ctp_mini/generator/mini_md_source_switch.cpp +78 -0
  175. ctpbee_api/ctp_mini/generator/mini_md_source_task.cpp +203 -0
  176. ctpbee_api/ctp_mini/generator/mini_struct.py +4599 -0
  177. ctpbee_api/ctp_mini/generator/mini_td_header_define.h +63 -0
  178. ctpbee_api/ctp_mini/generator/mini_td_header_function.h +84 -0
  179. ctpbee_api/ctp_mini/generator/mini_td_header_on.h +126 -0
  180. ctpbee_api/ctp_mini/generator/mini_td_header_process.h +126 -0
  181. ctpbee_api/ctp_mini/generator/mini_td_source_function.cpp +663 -0
  182. ctpbee_api/ctp_mini/generator/mini_td_source_module.cpp +107 -0
  183. ctpbee_api/ctp_mini/generator/mini_td_source_on.cpp +756 -0
  184. ctpbee_api/ctp_mini/generator/mini_td_source_process.cpp +2492 -0
  185. ctpbee_api/ctp_mini/generator/mini_td_source_switch.cpp +378 -0
  186. ctpbee_api/ctp_mini/generator/mini_td_source_task.cpp +1193 -0
  187. ctpbee_api/ctp_mini/generator/mini_typedef.py +755 -0
  188. ctpbee_api/ctp_mini/generator/package/vnminimd.cpp +886 -0
  189. ctpbee_api/ctp_mini/generator/package/vnminimd.h +205 -0
  190. ctpbee_api/ctp_mini/include/new/mini/ThostFtdcMdApi.h +148 -0
  191. ctpbee_api/ctp_mini/include/new/mini/ThostFtdcTraderApi.h +419 -0
  192. ctpbee_api/ctp_mini/include/new/mini/ThostFtdcUserApiDataType.h +6458 -0
  193. ctpbee_api/ctp_mini/include/new/mini/ThostFtdcUserApiStruct.h +8890 -0
  194. ctpbee_api/ctp_mini/include/new/pybind11/attr.h +690 -0
  195. ctpbee_api/ctp_mini/include/new/pybind11/buffer_info.h +208 -0
  196. ctpbee_api/ctp_mini/include/new/pybind11/cast.h +1704 -0
  197. ctpbee_api/ctp_mini/include/new/pybind11/chrono.h +225 -0
  198. ctpbee_api/ctp_mini/include/new/pybind11/common.h +2 -0
  199. ctpbee_api/ctp_mini/include/new/pybind11/complex.h +74 -0
  200. ctpbee_api/ctp_mini/include/new/pybind11/detail/class.h +743 -0
  201. ctpbee_api/ctp_mini/include/new/pybind11/detail/common.h +1255 -0
  202. ctpbee_api/ctp_mini/include/new/pybind11/detail/descr.h +171 -0
  203. ctpbee_api/ctp_mini/include/new/pybind11/detail/init.h +434 -0
  204. ctpbee_api/ctp_mini/include/new/pybind11/detail/internals.h +656 -0
  205. ctpbee_api/ctp_mini/include/new/pybind11/detail/type_caster_base.h +1177 -0
  206. ctpbee_api/ctp_mini/include/new/pybind11/detail/typeid.h +65 -0
  207. ctpbee_api/ctp_mini/include/new/pybind11/eigen/common.h +9 -0
  208. ctpbee_api/ctp_mini/include/new/pybind11/eigen/matrix.h +714 -0
  209. ctpbee_api/ctp_mini/include/new/pybind11/eigen/tensor.h +516 -0
  210. ctpbee_api/ctp_mini/include/new/pybind11/eigen.h +12 -0
  211. ctpbee_api/ctp_mini/include/new/pybind11/embed.h +316 -0
  212. ctpbee_api/ctp_mini/include/new/pybind11/eval.h +156 -0
  213. ctpbee_api/ctp_mini/include/new/pybind11/functional.h +137 -0
  214. ctpbee_api/ctp_mini/include/new/pybind11/gil.h +239 -0
  215. ctpbee_api/ctp_mini/include/new/pybind11/iostream.h +265 -0
  216. ctpbee_api/ctp_mini/include/new/pybind11/numpy.h +1998 -0
  217. ctpbee_api/ctp_mini/include/new/pybind11/operators.h +202 -0
  218. ctpbee_api/ctp_mini/include/new/pybind11/options.h +92 -0
  219. ctpbee_api/ctp_mini/include/new/pybind11/pybind11.h +2890 -0
  220. ctpbee_api/ctp_mini/include/new/pybind11/pytypes.h +2557 -0
  221. ctpbee_api/ctp_mini/include/new/pybind11/stl/filesystem.h +116 -0
  222. ctpbee_api/ctp_mini/include/new/pybind11/stl.h +447 -0
  223. ctpbee_api/ctp_mini/include/new/pybind11/stl_bind.h +851 -0
  224. ctpbee_api/ctp_mini/include/new/pybind11/type_caster_pyobject_ptr.h +61 -0
  225. ctpbee_api/ctp_mini/include/previous/mini/ThostFtdcMdApi.h +148 -0
  226. ctpbee_api/ctp_mini/include/previous/mini/ThostFtdcTraderApi.h +419 -0
  227. ctpbee_api/ctp_mini/include/previous/mini/ThostFtdcUserApiDataType.h +6458 -0
  228. ctpbee_api/ctp_mini/include/previous/mini/ThostFtdcUserApiStruct.h +8890 -0
  229. ctpbee_api/ctp_mini/include/previous/pybind11/attr.h +489 -0
  230. ctpbee_api/ctp_mini/include/previous/pybind11/buffer_info.h +108 -0
  231. ctpbee_api/ctp_mini/include/previous/pybind11/cast.h +2067 -0
  232. ctpbee_api/ctp_mini/include/previous/pybind11/chrono.h +162 -0
  233. ctpbee_api/ctp_mini/include/previous/pybind11/common.h +2 -0
  234. ctpbee_api/ctp_mini/include/previous/pybind11/complex.h +61 -0
  235. ctpbee_api/ctp_mini/include/previous/pybind11/detail/class.h +626 -0
  236. ctpbee_api/ctp_mini/include/previous/pybind11/detail/common.h +803 -0
  237. ctpbee_api/ctp_mini/include/previous/pybind11/detail/descr.h +185 -0
  238. ctpbee_api/ctp_mini/include/previous/pybind11/detail/init.h +335 -0
  239. ctpbee_api/ctp_mini/include/previous/pybind11/detail/internals.h +285 -0
  240. ctpbee_api/ctp_mini/include/previous/pybind11/detail/typeid.h +53 -0
  241. ctpbee_api/ctp_mini/include/previous/pybind11/eigen.h +604 -0
  242. ctpbee_api/ctp_mini/include/previous/pybind11/embed.h +194 -0
  243. ctpbee_api/ctp_mini/include/previous/pybind11/eval.h +117 -0
  244. ctpbee_api/ctp_mini/include/previous/pybind11/functional.h +85 -0
  245. ctpbee_api/ctp_mini/include/previous/pybind11/iostream.h +200 -0
  246. ctpbee_api/ctp_mini/include/previous/pybind11/numpy.h +1601 -0
  247. ctpbee_api/ctp_mini/include/previous/pybind11/operators.h +168 -0
  248. ctpbee_api/ctp_mini/include/previous/pybind11/options.h +65 -0
  249. ctpbee_api/ctp_mini/include/previous/pybind11/pybind11.h +1965 -0
  250. ctpbee_api/ctp_mini/include/previous/pybind11/pytypes.h +1332 -0
  251. ctpbee_api/ctp_mini/include/previous/pybind11/stl.h +376 -0
  252. ctpbee_api/ctp_mini/include/previous/pybind11/stl_bind.h +599 -0
  253. ctpbee_api/ctp_mini/libs/thostmduserapi.lib +0 -0
  254. ctpbee_api/ctp_mini/libs/thosttraderapi.lib +0 -0
  255. ctpbee_api/ctp_mini/libthostmduserapi.so +0 -0
  256. ctpbee_api/ctp_mini/libthosttraderapi.so +0 -0
  257. ctpbee_api/ctp_mini/mini_constant.py +1186 -0
  258. ctpbee_api/ctp_mini/thostmduserapi.dll +0 -0
  259. ctpbee_api/ctp_mini/thosttraderapi.dll +0 -0
  260. ctpbee_api/ctp_mini/vnctp_mini/vnctp_mini.h +146 -0
  261. ctpbee_api/ctp_mini/vnctp_mini/vnctp_mini.sln +41 -0
  262. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/dllmain.cpp +0 -0
  263. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/stdafx.cpp +0 -0
  264. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/stdafx.h +0 -0
  265. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/targetver.h +0 -0
  266. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/vnctp_minimd.cpp +886 -0
  267. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/vnctp_minimd.h +203 -0
  268. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/vnctp_minimd.vcxproj +183 -0
  269. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/vnctp_minimd.vcxproj.filters +54 -0
  270. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/vnctp_minimd.vcxproj.user +4 -0
  271. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/dllmain.cpp +0 -0
  272. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/stdafx.cpp +0 -0
  273. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/stdafx.h +0 -0
  274. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/targetver.h +0 -0
  275. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/vnctp_minitd.cpp +5716 -0
  276. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/vnctp_minitd.h +680 -0
  277. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/vnctp_minitd.vcxproj +180 -0
  278. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/vnctp_minitd.vcxproj.filters +54 -0
  279. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/vnctp_minitd.vcxproj.user +4 -0
  280. ctpbee_api/ctp_mini/vnctp_minimd.cp39-win_amd64.pyd +0 -0
  281. ctpbee_api/ctp_mini/vnctp_minitd.cp39-win_amd64.pyd +0 -0
  282. ctpbee_api/ctp_mini/vnctp_minitd.lib +0 -0
  283. ctpbee_api/rohon/RohonBaseV64.dll +0 -0
  284. ctpbee_api/rohon/WinDataCollect.dll +0 -0
  285. ctpbee_api/rohon/__init__.py +3 -0
  286. ctpbee_api/rohon/generator/generate_api_functions.py +348 -0
  287. ctpbee_api/rohon/generator/generate_data_type.py +76 -0
  288. ctpbee_api/rohon/generator/generate_struct.py +84 -0
  289. ctpbee_api/rohon/generator/rohon_constant.py +1242 -0
  290. ctpbee_api/rohon/generator/rohon_md_header_define.h +13 -0
  291. ctpbee_api/rohon/generator/rohon_md_header_function.h +6 -0
  292. ctpbee_api/rohon/generator/rohon_md_header_on.h +26 -0
  293. ctpbee_api/rohon/generator/rohon_md_header_process.h +26 -0
  294. ctpbee_api/rohon/generator/rohon_md_source_function.cpp +40 -0
  295. ctpbee_api/rohon/generator/rohon_md_source_module.cpp +18 -0
  296. ctpbee_api/rohon/generator/rohon_md_source_on.cpp +156 -0
  297. ctpbee_api/rohon/generator/rohon_md_source_process.cpp +271 -0
  298. ctpbee_api/rohon/generator/rohon_md_source_switch.cpp +78 -0
  299. ctpbee_api/rohon/generator/rohon_md_source_task.cpp +211 -0
  300. ctpbee_api/rohon/generator/rohon_struct.py +4958 -0
  301. ctpbee_api/rohon/generator/rohon_td_header_define.h +125 -0
  302. ctpbee_api/rohon/generator/rohon_td_header_function.h +164 -0
  303. ctpbee_api/rohon/generator/rohon_td_header_on.h +250 -0
  304. ctpbee_api/rohon/generator/rohon_td_header_process.h +250 -0
  305. ctpbee_api/rohon/generator/rohon_td_source_function.cpp +1338 -0
  306. ctpbee_api/rohon/generator/rohon_td_source_module.cpp +209 -0
  307. ctpbee_api/rohon/generator/rohon_td_source_on.cpp +1500 -0
  308. ctpbee_api/rohon/generator/rohon_td_source_process.cpp +5125 -0
  309. ctpbee_api/rohon/generator/rohon_td_source_switch.cpp +750 -0
  310. ctpbee_api/rohon/generator/rohon_td_source_task.cpp +2339 -0
  311. ctpbee_api/rohon/generator/rohon_typedef.py +781 -0
  312. ctpbee_api/rohon/include/new/pybind11/attr.h +690 -0
  313. ctpbee_api/rohon/include/new/pybind11/buffer_info.h +208 -0
  314. ctpbee_api/rohon/include/new/pybind11/cast.h +1704 -0
  315. ctpbee_api/rohon/include/new/pybind11/chrono.h +225 -0
  316. ctpbee_api/rohon/include/new/pybind11/common.h +2 -0
  317. ctpbee_api/rohon/include/new/pybind11/complex.h +74 -0
  318. ctpbee_api/rohon/include/new/pybind11/detail/class.h +743 -0
  319. ctpbee_api/rohon/include/new/pybind11/detail/common.h +1255 -0
  320. ctpbee_api/rohon/include/new/pybind11/detail/descr.h +171 -0
  321. ctpbee_api/rohon/include/new/pybind11/detail/init.h +434 -0
  322. ctpbee_api/rohon/include/new/pybind11/detail/internals.h +656 -0
  323. ctpbee_api/rohon/include/new/pybind11/detail/type_caster_base.h +1177 -0
  324. ctpbee_api/rohon/include/new/pybind11/detail/typeid.h +65 -0
  325. ctpbee_api/rohon/include/new/pybind11/eigen/common.h +9 -0
  326. ctpbee_api/rohon/include/new/pybind11/eigen/matrix.h +714 -0
  327. ctpbee_api/rohon/include/new/pybind11/eigen/tensor.h +516 -0
  328. ctpbee_api/rohon/include/new/pybind11/eigen.h +12 -0
  329. ctpbee_api/rohon/include/new/pybind11/embed.h +316 -0
  330. ctpbee_api/rohon/include/new/pybind11/eval.h +156 -0
  331. ctpbee_api/rohon/include/new/pybind11/functional.h +137 -0
  332. ctpbee_api/rohon/include/new/pybind11/gil.h +239 -0
  333. ctpbee_api/rohon/include/new/pybind11/iostream.h +265 -0
  334. ctpbee_api/rohon/include/new/pybind11/numpy.h +1998 -0
  335. ctpbee_api/rohon/include/new/pybind11/operators.h +202 -0
  336. ctpbee_api/rohon/include/new/pybind11/options.h +92 -0
  337. ctpbee_api/rohon/include/new/pybind11/pybind11.h +2890 -0
  338. ctpbee_api/rohon/include/new/pybind11/pytypes.h +2557 -0
  339. ctpbee_api/rohon/include/new/pybind11/stl/filesystem.h +116 -0
  340. ctpbee_api/rohon/include/new/pybind11/stl.h +447 -0
  341. ctpbee_api/rohon/include/new/pybind11/stl_bind.h +851 -0
  342. ctpbee_api/rohon/include/new/pybind11/type_caster_pyobject_ptr.h +61 -0
  343. ctpbee_api/rohon/include/new/rohon/ThostFtdcMdApi.h +168 -0
  344. ctpbee_api/rohon/include/new/rohon/ThostFtdcTraderApi.h +739 -0
  345. ctpbee_api/rohon/include/new/rohon/ThostFtdcUserApiDataType.h +6708 -0
  346. ctpbee_api/rohon/include/new/rohon/ThostFtdcUserApiStruct.h +9580 -0
  347. ctpbee_api/rohon/include/previous/pybind11/attr.h +489 -0
  348. ctpbee_api/rohon/include/previous/pybind11/buffer_info.h +108 -0
  349. ctpbee_api/rohon/include/previous/pybind11/cast.h +2067 -0
  350. ctpbee_api/rohon/include/previous/pybind11/chrono.h +162 -0
  351. ctpbee_api/rohon/include/previous/pybind11/common.h +2 -0
  352. ctpbee_api/rohon/include/previous/pybind11/complex.h +61 -0
  353. ctpbee_api/rohon/include/previous/pybind11/detail/class.h +626 -0
  354. ctpbee_api/rohon/include/previous/pybind11/detail/common.h +803 -0
  355. ctpbee_api/rohon/include/previous/pybind11/detail/descr.h +185 -0
  356. ctpbee_api/rohon/include/previous/pybind11/detail/init.h +335 -0
  357. ctpbee_api/rohon/include/previous/pybind11/detail/internals.h +285 -0
  358. ctpbee_api/rohon/include/previous/pybind11/detail/typeid.h +53 -0
  359. ctpbee_api/rohon/include/previous/pybind11/eigen.h +604 -0
  360. ctpbee_api/rohon/include/previous/pybind11/embed.h +194 -0
  361. ctpbee_api/rohon/include/previous/pybind11/eval.h +117 -0
  362. ctpbee_api/rohon/include/previous/pybind11/functional.h +85 -0
  363. ctpbee_api/rohon/include/previous/pybind11/iostream.h +200 -0
  364. ctpbee_api/rohon/include/previous/pybind11/numpy.h +1601 -0
  365. ctpbee_api/rohon/include/previous/pybind11/operators.h +168 -0
  366. ctpbee_api/rohon/include/previous/pybind11/options.h +65 -0
  367. ctpbee_api/rohon/include/previous/pybind11/pybind11.h +1965 -0
  368. ctpbee_api/rohon/include/previous/pybind11/pytypes.h +1332 -0
  369. ctpbee_api/rohon/include/previous/pybind11/stl.h +376 -0
  370. ctpbee_api/rohon/include/previous/pybind11/stl_bind.h +599 -0
  371. ctpbee_api/rohon/include/previous/rohon/ThostFtdcMdApi.h +168 -0
  372. ctpbee_api/rohon/include/previous/rohon/ThostFtdcTraderApi.h +739 -0
  373. ctpbee_api/rohon/include/previous/rohon/ThostFtdcUserApiDataType.h +6708 -0
  374. ctpbee_api/rohon/include/previous/rohon/ThostFtdcUserApiStruct.h +9580 -0
  375. ctpbee_api/rohon/libLinuxDataCollect.so +0 -0
  376. ctpbee_api/rohon/librohonbase.so +0 -0
  377. ctpbee_api/rohon/librohonbase.so.1.1 +0 -0
  378. ctpbee_api/rohon/librohonbase.so.1.1.0.1 +0 -0
  379. ctpbee_api/rohon/libs/thostmduserapi_se.lib +0 -0
  380. ctpbee_api/rohon/libs/thosttraderapi_se.lib +0 -0
  381. ctpbee_api/rohon/libthostmduserapi_se.so +0 -0
  382. ctpbee_api/rohon/libthosttraderapi_se.so +0 -0
  383. ctpbee_api/rohon/rohon_constant.py +1242 -0
  384. ctpbee_api/rohon/thostmduserapi_se.dll +0 -0
  385. ctpbee_api/rohon/thosttraderapi_se.dll +0 -0
  386. ctpbee_api/rohon/vnrohon/.vs/vnrohon/v15/.suo +0 -0
  387. ctpbee_api/rohon/vnrohon/.vs/vnrohon/v15/Browse.VC.db +0 -0
  388. ctpbee_api/rohon/vnrohon/.vs/vnrohon/v15/Solution.VC.db +0 -0
  389. ctpbee_api/rohon/vnrohon/vnrohon.h +147 -0
  390. ctpbee_api/rohon/vnrohon/vnrohon.sln +41 -0
  391. ctpbee_api/rohon/vnrohon/vnrohonmd/dllmain.cpp +19 -0
  392. ctpbee_api/rohon/vnrohon/vnrohonmd/framework.h +5 -0
  393. ctpbee_api/rohon/vnrohon/vnrohonmd/pch.cpp +5 -0
  394. ctpbee_api/rohon/vnrohon/vnrohonmd/pch.h +13 -0
  395. ctpbee_api/rohon/vnrohon/vnrohonmd/vnrohonmd.cpp +931 -0
  396. ctpbee_api/rohon/vnrohon/vnrohonmd/vnrohonmd.h +207 -0
  397. ctpbee_api/rohon/vnrohon/vnrohonmd/vnrohonmd.vcxproj +188 -0
  398. ctpbee_api/rohon/vnrohon/vnrohonmd/vnrohonmd.vcxproj.filters +54 -0
  399. ctpbee_api/rohon/vnrohon/vnrohonmd/vnrohonmd.vcxproj.user +4 -0
  400. ctpbee_api/rohon/vnrohon/vnrohontd/dllmain.cpp +19 -0
  401. ctpbee_api/rohon/vnrohon/vnrohontd/framework.h +5 -0
  402. ctpbee_api/rohon/vnrohon/vnrohontd/pch.cpp +5 -0
  403. ctpbee_api/rohon/vnrohon/vnrohontd/pch.h +13 -0
  404. ctpbee_api/rohon/vnrohon/vnrohontd/vnrohontd.cpp +11395 -0
  405. ctpbee_api/rohon/vnrohon/vnrohontd/vnrohontd.h +1259 -0
  406. ctpbee_api/rohon/vnrohon/vnrohontd/vnrohontd.vcxproj +188 -0
  407. ctpbee_api/rohon/vnrohon/vnrohontd/vnrohontd.vcxproj.filters +54 -0
  408. ctpbee_api/rohon/vnrohon/vnrohontd/vnrohontd.vcxproj.user +4 -0
  409. ctpbee_api/rohon/vnrohonmd.cp39-win_amd64.pyd +0 -0
  410. ctpbee_api/rohon/vnrohontd.cp39-win_amd64.pyd +0 -0
  411. ctpbee_opt_api-0.1.0.dist-info/METADATA +46 -0
  412. ctpbee_opt_api-0.1.0.dist-info/RECORD +414 -0
  413. ctpbee_opt_api-0.1.0.dist-info/WHEEL +5 -0
  414. ctpbee_opt_api-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,2492 @@
1
+ void TdApi::processFrontConnected(Task *task)
2
+ {
3
+ gil_scoped_acquire acquire;
4
+ this->onFrontConnected();
5
+ };
6
+
7
+ void TdApi::processFrontDisconnected(Task *task)
8
+ {
9
+ gil_scoped_acquire acquire;
10
+ this->onFrontDisconnected(task->task_id);
11
+ };
12
+
13
+ void TdApi::processHeartBeatWarning(Task *task)
14
+ {
15
+ gil_scoped_acquire acquire;
16
+ this->onHeartBeatWarning(task->task_id);
17
+ };
18
+
19
+ void TdApi::processRspAuthenticate(Task *task)
20
+ {
21
+ gil_scoped_acquire acquire;
22
+ dict data;
23
+ if (task->task_data)
24
+ {
25
+ CThostFtdcRspAuthenticateField *task_data = (CThostFtdcRspAuthenticateField*)task->task_data;
26
+ data["BrokerID"] = toUtf(task_data->BrokerID);
27
+ data["UserID"] = toUtf(task_data->UserID);
28
+ data["UserProductInfo"] = toUtf(task_data->UserProductInfo);
29
+ data["AppID"] = toUtf(task_data->AppID);
30
+ delete task_data;
31
+ }
32
+ dict error;
33
+ if (task->task_error)
34
+ {
35
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
36
+ error["ErrorID"] = task_error->ErrorID;
37
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
38
+ delete task_error;
39
+ }
40
+ this->onRspAuthenticate(data, error, task->task_id, task->task_last);
41
+ };
42
+
43
+ void TdApi::processRspUserLogin(Task *task)
44
+ {
45
+ gil_scoped_acquire acquire;
46
+ dict data;
47
+ if (task->task_data)
48
+ {
49
+ CThostFtdcRspUserLoginField *task_data = (CThostFtdcRspUserLoginField*)task->task_data;
50
+ data["TradingDay"] = toUtf(task_data->TradingDay);
51
+ data["LoginTime"] = toUtf(task_data->LoginTime);
52
+ data["BrokerID"] = toUtf(task_data->BrokerID);
53
+ data["UserID"] = toUtf(task_data->UserID);
54
+ data["SystemName"] = toUtf(task_data->SystemName);
55
+ data["FrontID"] = task_data->FrontID;
56
+ data["SessionID"] = task_data->SessionID;
57
+ data["MaxOrderRef"] = toUtf(task_data->MaxOrderRef);
58
+ data["SHFETime"] = toUtf(task_data->SHFETime);
59
+ data["DCETime"] = toUtf(task_data->DCETime);
60
+ data["CZCETime"] = toUtf(task_data->CZCETime);
61
+ data["FFEXTime"] = toUtf(task_data->FFEXTime);
62
+ data["INETime"] = toUtf(task_data->INETime);
63
+ delete task_data;
64
+ }
65
+ dict error;
66
+ if (task->task_error)
67
+ {
68
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
69
+ error["ErrorID"] = task_error->ErrorID;
70
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
71
+ delete task_error;
72
+ }
73
+ this->onRspUserLogin(data, error, task->task_id, task->task_last);
74
+ };
75
+
76
+ void TdApi::processRspUserLogout(Task *task)
77
+ {
78
+ gil_scoped_acquire acquire;
79
+ dict data;
80
+ if (task->task_data)
81
+ {
82
+ CThostFtdcUserLogoutField *task_data = (CThostFtdcUserLogoutField*)task->task_data;
83
+ data["BrokerID"] = toUtf(task_data->BrokerID);
84
+ data["UserID"] = toUtf(task_data->UserID);
85
+ delete task_data;
86
+ }
87
+ dict error;
88
+ if (task->task_error)
89
+ {
90
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
91
+ error["ErrorID"] = task_error->ErrorID;
92
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
93
+ delete task_error;
94
+ }
95
+ this->onRspUserLogout(data, error, task->task_id, task->task_last);
96
+ };
97
+
98
+ void TdApi::processRspOrderInsert(Task *task)
99
+ {
100
+ gil_scoped_acquire acquire;
101
+ dict data;
102
+ if (task->task_data)
103
+ {
104
+ CThostFtdcInputOrderField *task_data = (CThostFtdcInputOrderField*)task->task_data;
105
+ data["BrokerID"] = toUtf(task_data->BrokerID);
106
+ data["InvestorID"] = toUtf(task_data->InvestorID);
107
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
108
+ data["OrderRef"] = toUtf(task_data->OrderRef);
109
+ data["UserID"] = toUtf(task_data->UserID);
110
+ data["OrderPriceType"] = task_data->OrderPriceType;
111
+ data["Direction"] = task_data->Direction;
112
+ data["CombOffsetFlag"] = toUtf(task_data->CombOffsetFlag);
113
+ data["CombHedgeFlag"] = toUtf(task_data->CombHedgeFlag);
114
+ data["LimitPrice"] = task_data->LimitPrice;
115
+ data["VolumeTotalOriginal"] = task_data->VolumeTotalOriginal;
116
+ data["TimeCondition"] = task_data->TimeCondition;
117
+ data["GTDDate"] = toUtf(task_data->GTDDate);
118
+ data["VolumeCondition"] = task_data->VolumeCondition;
119
+ data["MinVolume"] = task_data->MinVolume;
120
+ data["ContingentCondition"] = task_data->ContingentCondition;
121
+ data["StopPrice"] = task_data->StopPrice;
122
+ data["ForceCloseReason"] = task_data->ForceCloseReason;
123
+ data["IsAutoSuspend"] = task_data->IsAutoSuspend;
124
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
125
+ data["RequestID"] = task_data->RequestID;
126
+ data["UserForceClose"] = task_data->UserForceClose;
127
+ data["IsSwapOrder"] = task_data->IsSwapOrder;
128
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
129
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
130
+ data["AccountID"] = toUtf(task_data->AccountID);
131
+ data["CurrencyID"] = toUtf(task_data->CurrencyID);
132
+ data["ClientID"] = toUtf(task_data->ClientID);
133
+ data["IPAddress"] = toUtf(task_data->IPAddress);
134
+ data["MacAddress"] = toUtf(task_data->MacAddress);
135
+ delete task_data;
136
+ }
137
+ dict error;
138
+ if (task->task_error)
139
+ {
140
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
141
+ error["ErrorID"] = task_error->ErrorID;
142
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
143
+ delete task_error;
144
+ }
145
+ this->onRspOrderInsert(data, error, task->task_id, task->task_last);
146
+ };
147
+
148
+ void TdApi::processRspOrderAction(Task *task)
149
+ {
150
+ gil_scoped_acquire acquire;
151
+ dict data;
152
+ if (task->task_data)
153
+ {
154
+ CThostFtdcInputOrderActionField *task_data = (CThostFtdcInputOrderActionField*)task->task_data;
155
+ data["BrokerID"] = toUtf(task_data->BrokerID);
156
+ data["InvestorID"] = toUtf(task_data->InvestorID);
157
+ data["OrderActionRef"] = task_data->OrderActionRef;
158
+ data["OrderRef"] = toUtf(task_data->OrderRef);
159
+ data["RequestID"] = task_data->RequestID;
160
+ data["FrontID"] = task_data->FrontID;
161
+ data["SessionID"] = task_data->SessionID;
162
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
163
+ data["OrderSysID"] = toUtf(task_data->OrderSysID);
164
+ data["ActionFlag"] = task_data->ActionFlag;
165
+ data["LimitPrice"] = task_data->LimitPrice;
166
+ data["VolumeChange"] = task_data->VolumeChange;
167
+ data["UserID"] = toUtf(task_data->UserID);
168
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
169
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
170
+ data["IPAddress"] = toUtf(task_data->IPAddress);
171
+ data["MacAddress"] = toUtf(task_data->MacAddress);
172
+ delete task_data;
173
+ }
174
+ dict error;
175
+ if (task->task_error)
176
+ {
177
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
178
+ error["ErrorID"] = task_error->ErrorID;
179
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
180
+ delete task_error;
181
+ }
182
+ this->onRspOrderAction(data, error, task->task_id, task->task_last);
183
+ };
184
+
185
+ void TdApi::processRspExecOrderInsert(Task *task)
186
+ {
187
+ gil_scoped_acquire acquire;
188
+ dict data;
189
+ if (task->task_data)
190
+ {
191
+ CThostFtdcInputExecOrderField *task_data = (CThostFtdcInputExecOrderField*)task->task_data;
192
+ data["BrokerID"] = toUtf(task_data->BrokerID);
193
+ data["InvestorID"] = toUtf(task_data->InvestorID);
194
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
195
+ data["ExecOrderRef"] = toUtf(task_data->ExecOrderRef);
196
+ data["UserID"] = toUtf(task_data->UserID);
197
+ data["Volume"] = task_data->Volume;
198
+ data["RequestID"] = task_data->RequestID;
199
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
200
+ data["OffsetFlag"] = task_data->OffsetFlag;
201
+ data["HedgeFlag"] = task_data->HedgeFlag;
202
+ data["ActionType"] = task_data->ActionType;
203
+ data["PosiDirection"] = task_data->PosiDirection;
204
+ data["ReservePositionFlag"] = task_data->ReservePositionFlag;
205
+ data["CloseFlag"] = task_data->CloseFlag;
206
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
207
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
208
+ data["AccountID"] = toUtf(task_data->AccountID);
209
+ data["CurrencyID"] = toUtf(task_data->CurrencyID);
210
+ data["ClientID"] = toUtf(task_data->ClientID);
211
+ data["IPAddress"] = toUtf(task_data->IPAddress);
212
+ data["MacAddress"] = toUtf(task_data->MacAddress);
213
+ delete task_data;
214
+ }
215
+ dict error;
216
+ if (task->task_error)
217
+ {
218
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
219
+ error["ErrorID"] = task_error->ErrorID;
220
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
221
+ delete task_error;
222
+ }
223
+ this->onRspExecOrderInsert(data, error, task->task_id, task->task_last);
224
+ };
225
+
226
+ void TdApi::processRspExecOrderAction(Task *task)
227
+ {
228
+ gil_scoped_acquire acquire;
229
+ dict data;
230
+ if (task->task_data)
231
+ {
232
+ CThostFtdcInputExecOrderActionField *task_data = (CThostFtdcInputExecOrderActionField*)task->task_data;
233
+ data["BrokerID"] = toUtf(task_data->BrokerID);
234
+ data["InvestorID"] = toUtf(task_data->InvestorID);
235
+ data["ExecOrderActionRef"] = task_data->ExecOrderActionRef;
236
+ data["ExecOrderRef"] = toUtf(task_data->ExecOrderRef);
237
+ data["RequestID"] = task_data->RequestID;
238
+ data["FrontID"] = task_data->FrontID;
239
+ data["SessionID"] = task_data->SessionID;
240
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
241
+ data["ExecOrderSysID"] = toUtf(task_data->ExecOrderSysID);
242
+ data["ActionFlag"] = task_data->ActionFlag;
243
+ data["UserID"] = toUtf(task_data->UserID);
244
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
245
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
246
+ data["IPAddress"] = toUtf(task_data->IPAddress);
247
+ data["MacAddress"] = toUtf(task_data->MacAddress);
248
+ delete task_data;
249
+ }
250
+ dict error;
251
+ if (task->task_error)
252
+ {
253
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
254
+ error["ErrorID"] = task_error->ErrorID;
255
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
256
+ delete task_error;
257
+ }
258
+ this->onRspExecOrderAction(data, error, task->task_id, task->task_last);
259
+ };
260
+
261
+ void TdApi::processRspForQuoteInsert(Task *task)
262
+ {
263
+ gil_scoped_acquire acquire;
264
+ dict data;
265
+ if (task->task_data)
266
+ {
267
+ CThostFtdcInputForQuoteField *task_data = (CThostFtdcInputForQuoteField*)task->task_data;
268
+ data["BrokerID"] = toUtf(task_data->BrokerID);
269
+ data["InvestorID"] = toUtf(task_data->InvestorID);
270
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
271
+ data["ForQuoteRef"] = toUtf(task_data->ForQuoteRef);
272
+ data["UserID"] = toUtf(task_data->UserID);
273
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
274
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
275
+ data["IPAddress"] = toUtf(task_data->IPAddress);
276
+ data["MacAddress"] = toUtf(task_data->MacAddress);
277
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
278
+ delete task_data;
279
+ }
280
+ dict error;
281
+ if (task->task_error)
282
+ {
283
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
284
+ error["ErrorID"] = task_error->ErrorID;
285
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
286
+ delete task_error;
287
+ }
288
+ this->onRspForQuoteInsert(data, error, task->task_id, task->task_last);
289
+ };
290
+
291
+ void TdApi::processRspQuoteInsert(Task *task)
292
+ {
293
+ gil_scoped_acquire acquire;
294
+ dict data;
295
+ if (task->task_data)
296
+ {
297
+ CThostFtdcInputQuoteField *task_data = (CThostFtdcInputQuoteField*)task->task_data;
298
+ data["BrokerID"] = toUtf(task_data->BrokerID);
299
+ data["InvestorID"] = toUtf(task_data->InvestorID);
300
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
301
+ data["QuoteRef"] = toUtf(task_data->QuoteRef);
302
+ data["UserID"] = toUtf(task_data->UserID);
303
+ data["AskPrice"] = task_data->AskPrice;
304
+ data["BidPrice"] = task_data->BidPrice;
305
+ data["AskVolume"] = task_data->AskVolume;
306
+ data["BidVolume"] = task_data->BidVolume;
307
+ data["RequestID"] = task_data->RequestID;
308
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
309
+ data["AskOffsetFlag"] = task_data->AskOffsetFlag;
310
+ data["BidOffsetFlag"] = task_data->BidOffsetFlag;
311
+ data["AskHedgeFlag"] = task_data->AskHedgeFlag;
312
+ data["BidHedgeFlag"] = task_data->BidHedgeFlag;
313
+ data["AskOrderRef"] = toUtf(task_data->AskOrderRef);
314
+ data["BidOrderRef"] = toUtf(task_data->BidOrderRef);
315
+ data["ForQuoteSysID"] = toUtf(task_data->ForQuoteSysID);
316
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
317
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
318
+ data["ClientID"] = toUtf(task_data->ClientID);
319
+ data["IPAddress"] = toUtf(task_data->IPAddress);
320
+ data["MacAddress"] = toUtf(task_data->MacAddress);
321
+ data["ReplaceSysID"] = toUtf(task_data->ReplaceSysID);
322
+ delete task_data;
323
+ }
324
+ dict error;
325
+ if (task->task_error)
326
+ {
327
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
328
+ error["ErrorID"] = task_error->ErrorID;
329
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
330
+ delete task_error;
331
+ }
332
+ this->onRspQuoteInsert(data, error, task->task_id, task->task_last);
333
+ };
334
+
335
+ void TdApi::processRspQuoteAction(Task *task)
336
+ {
337
+ gil_scoped_acquire acquire;
338
+ dict data;
339
+ if (task->task_data)
340
+ {
341
+ CThostFtdcInputQuoteActionField *task_data = (CThostFtdcInputQuoteActionField*)task->task_data;
342
+ data["BrokerID"] = toUtf(task_data->BrokerID);
343
+ data["InvestorID"] = toUtf(task_data->InvestorID);
344
+ data["QuoteActionRef"] = task_data->QuoteActionRef;
345
+ data["QuoteRef"] = toUtf(task_data->QuoteRef);
346
+ data["RequestID"] = task_data->RequestID;
347
+ data["FrontID"] = task_data->FrontID;
348
+ data["SessionID"] = task_data->SessionID;
349
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
350
+ data["QuoteSysID"] = toUtf(task_data->QuoteSysID);
351
+ data["ActionFlag"] = task_data->ActionFlag;
352
+ data["UserID"] = toUtf(task_data->UserID);
353
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
354
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
355
+ data["ClientID"] = toUtf(task_data->ClientID);
356
+ data["IPAddress"] = toUtf(task_data->IPAddress);
357
+ data["MacAddress"] = toUtf(task_data->MacAddress);
358
+ delete task_data;
359
+ }
360
+ dict error;
361
+ if (task->task_error)
362
+ {
363
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
364
+ error["ErrorID"] = task_error->ErrorID;
365
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
366
+ delete task_error;
367
+ }
368
+ this->onRspQuoteAction(data, error, task->task_id, task->task_last);
369
+ };
370
+
371
+ void TdApi::processRspBatchOrderAction(Task *task)
372
+ {
373
+ gil_scoped_acquire acquire;
374
+ dict data;
375
+ if (task->task_data)
376
+ {
377
+ CThostFtdcInputBatchOrderActionField *task_data = (CThostFtdcInputBatchOrderActionField*)task->task_data;
378
+ data["BrokerID"] = toUtf(task_data->BrokerID);
379
+ data["InvestorID"] = toUtf(task_data->InvestorID);
380
+ data["OrderActionRef"] = task_data->OrderActionRef;
381
+ data["RequestID"] = task_data->RequestID;
382
+ data["FrontID"] = task_data->FrontID;
383
+ data["SessionID"] = task_data->SessionID;
384
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
385
+ data["UserID"] = toUtf(task_data->UserID);
386
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
387
+ data["IPAddress"] = toUtf(task_data->IPAddress);
388
+ data["MacAddress"] = toUtf(task_data->MacAddress);
389
+ delete task_data;
390
+ }
391
+ dict error;
392
+ if (task->task_error)
393
+ {
394
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
395
+ error["ErrorID"] = task_error->ErrorID;
396
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
397
+ delete task_error;
398
+ }
399
+ this->onRspBatchOrderAction(data, error, task->task_id, task->task_last);
400
+ };
401
+
402
+ void TdApi::processRspOptionSelfCloseInsert(Task *task)
403
+ {
404
+ gil_scoped_acquire acquire;
405
+ dict data;
406
+ if (task->task_data)
407
+ {
408
+ CThostFtdcInputOptionSelfCloseField *task_data = (CThostFtdcInputOptionSelfCloseField*)task->task_data;
409
+ data["BrokerID"] = toUtf(task_data->BrokerID);
410
+ data["InvestorID"] = toUtf(task_data->InvestorID);
411
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
412
+ data["OptionSelfCloseRef"] = toUtf(task_data->OptionSelfCloseRef);
413
+ data["UserID"] = toUtf(task_data->UserID);
414
+ data["Volume"] = task_data->Volume;
415
+ data["RequestID"] = task_data->RequestID;
416
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
417
+ data["HedgeFlag"] = task_data->HedgeFlag;
418
+ data["OptSelfCloseFlag"] = task_data->OptSelfCloseFlag;
419
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
420
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
421
+ data["AccountID"] = toUtf(task_data->AccountID);
422
+ data["CurrencyID"] = toUtf(task_data->CurrencyID);
423
+ data["ClientID"] = toUtf(task_data->ClientID);
424
+ data["IPAddress"] = toUtf(task_data->IPAddress);
425
+ data["MacAddress"] = toUtf(task_data->MacAddress);
426
+ delete task_data;
427
+ }
428
+ dict error;
429
+ if (task->task_error)
430
+ {
431
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
432
+ error["ErrorID"] = task_error->ErrorID;
433
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
434
+ delete task_error;
435
+ }
436
+ this->onRspOptionSelfCloseInsert(data, error, task->task_id, task->task_last);
437
+ };
438
+
439
+ void TdApi::processRspOptionSelfCloseAction(Task *task)
440
+ {
441
+ gil_scoped_acquire acquire;
442
+ dict data;
443
+ if (task->task_data)
444
+ {
445
+ CThostFtdcInputOptionSelfCloseActionField *task_data = (CThostFtdcInputOptionSelfCloseActionField*)task->task_data;
446
+ data["BrokerID"] = toUtf(task_data->BrokerID);
447
+ data["InvestorID"] = toUtf(task_data->InvestorID);
448
+ data["OptionSelfCloseActionRef"] = task_data->OptionSelfCloseActionRef;
449
+ data["OptionSelfCloseRef"] = toUtf(task_data->OptionSelfCloseRef);
450
+ data["RequestID"] = task_data->RequestID;
451
+ data["FrontID"] = task_data->FrontID;
452
+ data["SessionID"] = task_data->SessionID;
453
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
454
+ data["OptionSelfCloseSysID"] = toUtf(task_data->OptionSelfCloseSysID);
455
+ data["ActionFlag"] = task_data->ActionFlag;
456
+ data["UserID"] = toUtf(task_data->UserID);
457
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
458
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
459
+ data["IPAddress"] = toUtf(task_data->IPAddress);
460
+ data["MacAddress"] = toUtf(task_data->MacAddress);
461
+ delete task_data;
462
+ }
463
+ dict error;
464
+ if (task->task_error)
465
+ {
466
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
467
+ error["ErrorID"] = task_error->ErrorID;
468
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
469
+ delete task_error;
470
+ }
471
+ this->onRspOptionSelfCloseAction(data, error, task->task_id, task->task_last);
472
+ };
473
+
474
+ void TdApi::processRspCombActionInsert(Task *task)
475
+ {
476
+ gil_scoped_acquire acquire;
477
+ dict data;
478
+ if (task->task_data)
479
+ {
480
+ CThostFtdcInputCombActionField *task_data = (CThostFtdcInputCombActionField*)task->task_data;
481
+ data["BrokerID"] = toUtf(task_data->BrokerID);
482
+ data["InvestorID"] = toUtf(task_data->InvestorID);
483
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
484
+ data["CombActionRef"] = toUtf(task_data->CombActionRef);
485
+ data["UserID"] = toUtf(task_data->UserID);
486
+ data["Direction"] = task_data->Direction;
487
+ data["Volume"] = task_data->Volume;
488
+ data["CombDirection"] = task_data->CombDirection;
489
+ data["HedgeFlag"] = task_data->HedgeFlag;
490
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
491
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
492
+ data["IPAddress"] = toUtf(task_data->IPAddress);
493
+ data["MacAddress"] = toUtf(task_data->MacAddress);
494
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
495
+ data["FrontID"] = task_data->FrontID;
496
+ data["SessionID"] = task_data->SessionID;
497
+ delete task_data;
498
+ }
499
+ dict error;
500
+ if (task->task_error)
501
+ {
502
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
503
+ error["ErrorID"] = task_error->ErrorID;
504
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
505
+ delete task_error;
506
+ }
507
+ this->onRspCombActionInsert(data, error, task->task_id, task->task_last);
508
+ };
509
+
510
+ void TdApi::processRspQryOrder(Task *task)
511
+ {
512
+ gil_scoped_acquire acquire;
513
+ dict data;
514
+ if (task->task_data)
515
+ {
516
+ CThostFtdcOrderField *task_data = (CThostFtdcOrderField*)task->task_data;
517
+ data["BrokerID"] = toUtf(task_data->BrokerID);
518
+ data["InvestorID"] = toUtf(task_data->InvestorID);
519
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
520
+ data["OrderRef"] = toUtf(task_data->OrderRef);
521
+ data["UserID"] = toUtf(task_data->UserID);
522
+ data["OrderPriceType"] = task_data->OrderPriceType;
523
+ data["Direction"] = task_data->Direction;
524
+ data["CombOffsetFlag"] = toUtf(task_data->CombOffsetFlag);
525
+ data["CombHedgeFlag"] = toUtf(task_data->CombHedgeFlag);
526
+ data["LimitPrice"] = task_data->LimitPrice;
527
+ data["VolumeTotalOriginal"] = task_data->VolumeTotalOriginal;
528
+ data["TimeCondition"] = task_data->TimeCondition;
529
+ data["GTDDate"] = toUtf(task_data->GTDDate);
530
+ data["VolumeCondition"] = task_data->VolumeCondition;
531
+ data["MinVolume"] = task_data->MinVolume;
532
+ data["ContingentCondition"] = task_data->ContingentCondition;
533
+ data["StopPrice"] = task_data->StopPrice;
534
+ data["ForceCloseReason"] = task_data->ForceCloseReason;
535
+ data["IsAutoSuspend"] = task_data->IsAutoSuspend;
536
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
537
+ data["RequestID"] = task_data->RequestID;
538
+ data["OrderLocalID"] = toUtf(task_data->OrderLocalID);
539
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
540
+ data["ParticipantID"] = toUtf(task_data->ParticipantID);
541
+ data["ClientID"] = toUtf(task_data->ClientID);
542
+ data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID);
543
+ data["TraderID"] = toUtf(task_data->TraderID);
544
+ data["InstallID"] = task_data->InstallID;
545
+ data["OrderSubmitStatus"] = task_data->OrderSubmitStatus;
546
+ data["NotifySequence"] = task_data->NotifySequence;
547
+ data["TradingDay"] = toUtf(task_data->TradingDay);
548
+ data["SettlementID"] = task_data->SettlementID;
549
+ data["OrderSysID"] = toUtf(task_data->OrderSysID);
550
+ data["OrderSource"] = task_data->OrderSource;
551
+ data["OrderStatus"] = task_data->OrderStatus;
552
+ data["OrderType"] = task_data->OrderType;
553
+ data["VolumeTraded"] = task_data->VolumeTraded;
554
+ data["VolumeTotal"] = task_data->VolumeTotal;
555
+ data["InsertDate"] = toUtf(task_data->InsertDate);
556
+ data["InsertTime"] = toUtf(task_data->InsertTime);
557
+ data["ActiveTime"] = toUtf(task_data->ActiveTime);
558
+ data["SuspendTime"] = toUtf(task_data->SuspendTime);
559
+ data["UpdateTime"] = toUtf(task_data->UpdateTime);
560
+ data["CancelTime"] = toUtf(task_data->CancelTime);
561
+ data["ActiveTraderID"] = toUtf(task_data->ActiveTraderID);
562
+ data["ClearingPartID"] = toUtf(task_data->ClearingPartID);
563
+ data["SequenceNo"] = task_data->SequenceNo;
564
+ data["FrontID"] = task_data->FrontID;
565
+ data["SessionID"] = task_data->SessionID;
566
+ data["UserProductInfo"] = toUtf(task_data->UserProductInfo);
567
+ data["StatusMsg"] = toUtf(task_data->StatusMsg);
568
+ data["UserForceClose"] = task_data->UserForceClose;
569
+ data["ActiveUserID"] = toUtf(task_data->ActiveUserID);
570
+ data["BrokerOrderSeq"] = task_data->BrokerOrderSeq;
571
+ data["RelativeOrderSysID"] = toUtf(task_data->RelativeOrderSysID);
572
+ data["ZCETotalTradedVolume"] = task_data->ZCETotalTradedVolume;
573
+ data["IsSwapOrder"] = task_data->IsSwapOrder;
574
+ data["BranchID"] = toUtf(task_data->BranchID);
575
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
576
+ data["AccountID"] = toUtf(task_data->AccountID);
577
+ data["CurrencyID"] = toUtf(task_data->CurrencyID);
578
+ data["IPAddress"] = toUtf(task_data->IPAddress);
579
+ data["MacAddress"] = toUtf(task_data->MacAddress);
580
+ delete task_data;
581
+ }
582
+ dict error;
583
+ if (task->task_error)
584
+ {
585
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
586
+ error["ErrorID"] = task_error->ErrorID;
587
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
588
+ delete task_error;
589
+ }
590
+ this->onRspQryOrder(data, error, task->task_id, task->task_last);
591
+ };
592
+
593
+ void TdApi::processRspQryTrade(Task *task)
594
+ {
595
+ gil_scoped_acquire acquire;
596
+ dict data;
597
+ if (task->task_data)
598
+ {
599
+ CThostFtdcTradeField *task_data = (CThostFtdcTradeField*)task->task_data;
600
+ data["BrokerID"] = toUtf(task_data->BrokerID);
601
+ data["InvestorID"] = toUtf(task_data->InvestorID);
602
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
603
+ data["OrderRef"] = toUtf(task_data->OrderRef);
604
+ data["UserID"] = toUtf(task_data->UserID);
605
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
606
+ data["TradeID"] = toUtf(task_data->TradeID);
607
+ data["Direction"] = task_data->Direction;
608
+ data["OrderSysID"] = toUtf(task_data->OrderSysID);
609
+ data["ParticipantID"] = toUtf(task_data->ParticipantID);
610
+ data["ClientID"] = toUtf(task_data->ClientID);
611
+ data["TradingRole"] = task_data->TradingRole;
612
+ data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID);
613
+ data["OffsetFlag"] = task_data->OffsetFlag;
614
+ data["HedgeFlag"] = task_data->HedgeFlag;
615
+ data["Price"] = task_data->Price;
616
+ data["Volume"] = task_data->Volume;
617
+ data["TradeDate"] = toUtf(task_data->TradeDate);
618
+ data["TradeTime"] = toUtf(task_data->TradeTime);
619
+ data["TradeType"] = task_data->TradeType;
620
+ data["PriceSource"] = task_data->PriceSource;
621
+ data["TraderID"] = toUtf(task_data->TraderID);
622
+ data["OrderLocalID"] = toUtf(task_data->OrderLocalID);
623
+ data["ClearingPartID"] = toUtf(task_data->ClearingPartID);
624
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
625
+ data["SequenceNo"] = task_data->SequenceNo;
626
+ data["TradingDay"] = toUtf(task_data->TradingDay);
627
+ data["SettlementID"] = task_data->SettlementID;
628
+ data["BrokerOrderSeq"] = task_data->BrokerOrderSeq;
629
+ data["TradeSource"] = task_data->TradeSource;
630
+ delete task_data;
631
+ }
632
+ dict error;
633
+ if (task->task_error)
634
+ {
635
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
636
+ error["ErrorID"] = task_error->ErrorID;
637
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
638
+ delete task_error;
639
+ }
640
+ this->onRspQryTrade(data, error, task->task_id, task->task_last);
641
+ };
642
+
643
+ void TdApi::processRspQryInvestorPosition(Task *task)
644
+ {
645
+ gil_scoped_acquire acquire;
646
+ dict data;
647
+ if (task->task_data)
648
+ {
649
+ CThostFtdcInvestorPositionField *task_data = (CThostFtdcInvestorPositionField*)task->task_data;
650
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
651
+ data["BrokerID"] = toUtf(task_data->BrokerID);
652
+ data["InvestorID"] = toUtf(task_data->InvestorID);
653
+ data["PosiDirection"] = task_data->PosiDirection;
654
+ data["HedgeFlag"] = task_data->HedgeFlag;
655
+ data["PositionDate"] = task_data->PositionDate;
656
+ data["YdPosition"] = task_data->YdPosition;
657
+ data["Position"] = task_data->Position;
658
+ data["LongFrozen"] = task_data->LongFrozen;
659
+ data["ShortFrozen"] = task_data->ShortFrozen;
660
+ data["LongFrozenAmount"] = task_data->LongFrozenAmount;
661
+ data["ShortFrozenAmount"] = task_data->ShortFrozenAmount;
662
+ data["OpenVolume"] = task_data->OpenVolume;
663
+ data["CloseVolume"] = task_data->CloseVolume;
664
+ data["OpenAmount"] = task_data->OpenAmount;
665
+ data["CloseAmount"] = task_data->CloseAmount;
666
+ data["PositionCost"] = task_data->PositionCost;
667
+ data["PreMargin"] = task_data->PreMargin;
668
+ data["UseMargin"] = task_data->UseMargin;
669
+ data["FrozenMargin"] = task_data->FrozenMargin;
670
+ data["FrozenCash"] = task_data->FrozenCash;
671
+ data["FrozenCommission"] = task_data->FrozenCommission;
672
+ data["CashIn"] = task_data->CashIn;
673
+ data["Commission"] = task_data->Commission;
674
+ data["CloseProfit"] = task_data->CloseProfit;
675
+ data["PositionProfit"] = task_data->PositionProfit;
676
+ data["PreSettlementPrice"] = task_data->PreSettlementPrice;
677
+ data["SettlementPrice"] = task_data->SettlementPrice;
678
+ data["TradingDay"] = toUtf(task_data->TradingDay);
679
+ data["SettlementID"] = task_data->SettlementID;
680
+ data["OpenCost"] = task_data->OpenCost;
681
+ data["ExchangeMargin"] = task_data->ExchangeMargin;
682
+ data["CombPosition"] = task_data->CombPosition;
683
+ data["CombLongFrozen"] = task_data->CombLongFrozen;
684
+ data["CombShortFrozen"] = task_data->CombShortFrozen;
685
+ data["CloseProfitByDate"] = task_data->CloseProfitByDate;
686
+ data["CloseProfitByTrade"] = task_data->CloseProfitByTrade;
687
+ data["TodayPosition"] = task_data->TodayPosition;
688
+ data["MarginRateByMoney"] = task_data->MarginRateByMoney;
689
+ data["MarginRateByVolume"] = task_data->MarginRateByVolume;
690
+ data["StrikeFrozen"] = task_data->StrikeFrozen;
691
+ data["StrikeFrozenAmount"] = task_data->StrikeFrozenAmount;
692
+ data["AbandonFrozen"] = task_data->AbandonFrozen;
693
+ delete task_data;
694
+ }
695
+ dict error;
696
+ if (task->task_error)
697
+ {
698
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
699
+ error["ErrorID"] = task_error->ErrorID;
700
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
701
+ delete task_error;
702
+ }
703
+ this->onRspQryInvestorPosition(data, error, task->task_id, task->task_last);
704
+ };
705
+
706
+ void TdApi::processRspQryTradingAccount(Task *task)
707
+ {
708
+ gil_scoped_acquire acquire;
709
+ dict data;
710
+ if (task->task_data)
711
+ {
712
+ CThostFtdcTradingAccountField *task_data = (CThostFtdcTradingAccountField*)task->task_data;
713
+ data["BrokerID"] = toUtf(task_data->BrokerID);
714
+ data["AccountID"] = toUtf(task_data->AccountID);
715
+ data["PreMortgage"] = task_data->PreMortgage;
716
+ data["PreCredit"] = task_data->PreCredit;
717
+ data["PreDeposit"] = task_data->PreDeposit;
718
+ data["PreBalance"] = task_data->PreBalance;
719
+ data["PreMargin"] = task_data->PreMargin;
720
+ data["InterestBase"] = task_data->InterestBase;
721
+ data["Interest"] = task_data->Interest;
722
+ data["Deposit"] = task_data->Deposit;
723
+ data["Withdraw"] = task_data->Withdraw;
724
+ data["FrozenMargin"] = task_data->FrozenMargin;
725
+ data["FrozenCash"] = task_data->FrozenCash;
726
+ data["FrozenCommission"] = task_data->FrozenCommission;
727
+ data["CurrMargin"] = task_data->CurrMargin;
728
+ data["CashIn"] = task_data->CashIn;
729
+ data["Commission"] = task_data->Commission;
730
+ data["CloseProfit"] = task_data->CloseProfit;
731
+ data["PositionProfit"] = task_data->PositionProfit;
732
+ data["Balance"] = task_data->Balance;
733
+ data["Available"] = task_data->Available;
734
+ data["WithdrawQuota"] = task_data->WithdrawQuota;
735
+ data["Reserve"] = task_data->Reserve;
736
+ data["TradingDay"] = toUtf(task_data->TradingDay);
737
+ data["SettlementID"] = task_data->SettlementID;
738
+ data["Credit"] = task_data->Credit;
739
+ data["Mortgage"] = task_data->Mortgage;
740
+ data["ExchangeMargin"] = task_data->ExchangeMargin;
741
+ data["DeliveryMargin"] = task_data->DeliveryMargin;
742
+ data["ExchangeDeliveryMargin"] = task_data->ExchangeDeliveryMargin;
743
+ data["ReserveBalance"] = task_data->ReserveBalance;
744
+ data["CurrencyID"] = toUtf(task_data->CurrencyID);
745
+ data["PreFundMortgageIn"] = task_data->PreFundMortgageIn;
746
+ data["PreFundMortgageOut"] = task_data->PreFundMortgageOut;
747
+ data["FundMortgageIn"] = task_data->FundMortgageIn;
748
+ data["FundMortgageOut"] = task_data->FundMortgageOut;
749
+ data["FundMortgageAvailable"] = task_data->FundMortgageAvailable;
750
+ data["MortgageableFund"] = task_data->MortgageableFund;
751
+ data["SpecProductMargin"] = task_data->SpecProductMargin;
752
+ data["SpecProductFrozenMargin"] = task_data->SpecProductFrozenMargin;
753
+ data["SpecProductCommission"] = task_data->SpecProductCommission;
754
+ data["SpecProductFrozenCommission"] = task_data->SpecProductFrozenCommission;
755
+ data["SpecProductPositionProfit"] = task_data->SpecProductPositionProfit;
756
+ data["SpecProductCloseProfit"] = task_data->SpecProductCloseProfit;
757
+ data["SpecProductPositionProfitByAlg"] = task_data->SpecProductPositionProfitByAlg;
758
+ data["SpecProductExchangeMargin"] = task_data->SpecProductExchangeMargin;
759
+ data["FrozenPartition"] = task_data->FrozenPartition;
760
+ delete task_data;
761
+ }
762
+ dict error;
763
+ if (task->task_error)
764
+ {
765
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
766
+ error["ErrorID"] = task_error->ErrorID;
767
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
768
+ delete task_error;
769
+ }
770
+ this->onRspQryTradingAccount(data, error, task->task_id, task->task_last);
771
+ };
772
+
773
+ void TdApi::processRspQryInvestor(Task *task)
774
+ {
775
+ gil_scoped_acquire acquire;
776
+ dict data;
777
+ if (task->task_data)
778
+ {
779
+ CThostFtdcInvestorField *task_data = (CThostFtdcInvestorField*)task->task_data;
780
+ data["InvestorID"] = toUtf(task_data->InvestorID);
781
+ data["BrokerID"] = toUtf(task_data->BrokerID);
782
+ data["InvestorGroupID"] = toUtf(task_data->InvestorGroupID);
783
+ data["InvestorName"] = toUtf(task_data->InvestorName);
784
+ data["IdentifiedCardType"] = task_data->IdentifiedCardType;
785
+ data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo);
786
+ data["IsActive"] = task_data->IsActive;
787
+ data["Telephone"] = toUtf(task_data->Telephone);
788
+ data["Address"] = toUtf(task_data->Address);
789
+ data["OpenDate"] = toUtf(task_data->OpenDate);
790
+ data["Mobile"] = toUtf(task_data->Mobile);
791
+ data["CommModelID"] = toUtf(task_data->CommModelID);
792
+ data["MarginModelID"] = toUtf(task_data->MarginModelID);
793
+ delete task_data;
794
+ }
795
+ dict error;
796
+ if (task->task_error)
797
+ {
798
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
799
+ error["ErrorID"] = task_error->ErrorID;
800
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
801
+ delete task_error;
802
+ }
803
+ this->onRspQryInvestor(data, error, task->task_id, task->task_last);
804
+ };
805
+
806
+ void TdApi::processRspQryTradingCode(Task *task)
807
+ {
808
+ gil_scoped_acquire acquire;
809
+ dict data;
810
+ if (task->task_data)
811
+ {
812
+ CThostFtdcTradingCodeField *task_data = (CThostFtdcTradingCodeField*)task->task_data;
813
+ data["InvestorID"] = toUtf(task_data->InvestorID);
814
+ data["BrokerID"] = toUtf(task_data->BrokerID);
815
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
816
+ data["ClientID"] = toUtf(task_data->ClientID);
817
+ data["IsActive"] = task_data->IsActive;
818
+ data["ClientIDType"] = task_data->ClientIDType;
819
+ delete task_data;
820
+ }
821
+ dict error;
822
+ if (task->task_error)
823
+ {
824
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
825
+ error["ErrorID"] = task_error->ErrorID;
826
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
827
+ delete task_error;
828
+ }
829
+ this->onRspQryTradingCode(data, error, task->task_id, task->task_last);
830
+ };
831
+
832
+ void TdApi::processRspQryInstrumentMarginRate(Task *task)
833
+ {
834
+ gil_scoped_acquire acquire;
835
+ dict data;
836
+ if (task->task_data)
837
+ {
838
+ CThostFtdcInstrumentMarginRateField *task_data = (CThostFtdcInstrumentMarginRateField*)task->task_data;
839
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
840
+ data["InvestorRange"] = task_data->InvestorRange;
841
+ data["BrokerID"] = toUtf(task_data->BrokerID);
842
+ data["InvestorID"] = toUtf(task_data->InvestorID);
843
+ data["HedgeFlag"] = task_data->HedgeFlag;
844
+ data["LongMarginRatioByMoney"] = task_data->LongMarginRatioByMoney;
845
+ data["LongMarginRatioByVolume"] = task_data->LongMarginRatioByVolume;
846
+ data["ShortMarginRatioByMoney"] = task_data->ShortMarginRatioByMoney;
847
+ data["ShortMarginRatioByVolume"] = task_data->ShortMarginRatioByVolume;
848
+ data["IsRelative"] = task_data->IsRelative;
849
+ delete task_data;
850
+ }
851
+ dict error;
852
+ if (task->task_error)
853
+ {
854
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
855
+ error["ErrorID"] = task_error->ErrorID;
856
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
857
+ delete task_error;
858
+ }
859
+ this->onRspQryInstrumentMarginRate(data, error, task->task_id, task->task_last);
860
+ };
861
+
862
+ void TdApi::processRspQryInstrumentCommissionRate(Task *task)
863
+ {
864
+ gil_scoped_acquire acquire;
865
+ dict data;
866
+ if (task->task_data)
867
+ {
868
+ CThostFtdcInstrumentCommissionRateField *task_data = (CThostFtdcInstrumentCommissionRateField*)task->task_data;
869
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
870
+ data["InvestorRange"] = task_data->InvestorRange;
871
+ data["BrokerID"] = toUtf(task_data->BrokerID);
872
+ data["InvestorID"] = toUtf(task_data->InvestorID);
873
+ data["OpenRatioByMoney"] = task_data->OpenRatioByMoney;
874
+ data["OpenRatioByVolume"] = task_data->OpenRatioByVolume;
875
+ data["CloseRatioByMoney"] = task_data->CloseRatioByMoney;
876
+ data["CloseRatioByVolume"] = task_data->CloseRatioByVolume;
877
+ data["CloseTodayRatioByMoney"] = task_data->CloseTodayRatioByMoney;
878
+ data["CloseTodayRatioByVolume"] = task_data->CloseTodayRatioByVolume;
879
+ delete task_data;
880
+ }
881
+ dict error;
882
+ if (task->task_error)
883
+ {
884
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
885
+ error["ErrorID"] = task_error->ErrorID;
886
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
887
+ delete task_error;
888
+ }
889
+ this->onRspQryInstrumentCommissionRate(data, error, task->task_id, task->task_last);
890
+ };
891
+
892
+ void TdApi::processRspQryExchange(Task *task)
893
+ {
894
+ gil_scoped_acquire acquire;
895
+ dict data;
896
+ if (task->task_data)
897
+ {
898
+ CThostFtdcExchangeField *task_data = (CThostFtdcExchangeField*)task->task_data;
899
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
900
+ data["ExchangeName"] = toUtf(task_data->ExchangeName);
901
+ data["ExchangeProperty"] = task_data->ExchangeProperty;
902
+ delete task_data;
903
+ }
904
+ dict error;
905
+ if (task->task_error)
906
+ {
907
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
908
+ error["ErrorID"] = task_error->ErrorID;
909
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
910
+ delete task_error;
911
+ }
912
+ this->onRspQryExchange(data, error, task->task_id, task->task_last);
913
+ };
914
+
915
+ void TdApi::processRspQryProduct(Task *task)
916
+ {
917
+ gil_scoped_acquire acquire;
918
+ dict data;
919
+ if (task->task_data)
920
+ {
921
+ CThostFtdcProductField *task_data = (CThostFtdcProductField*)task->task_data;
922
+ data["ProductID"] = toUtf(task_data->ProductID);
923
+ data["ProductName"] = toUtf(task_data->ProductName);
924
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
925
+ data["ProductClass"] = task_data->ProductClass;
926
+ data["VolumeMultiple"] = task_data->VolumeMultiple;
927
+ data["PriceTick"] = task_data->PriceTick;
928
+ data["MaxMarketOrderVolume"] = task_data->MaxMarketOrderVolume;
929
+ data["MinMarketOrderVolume"] = task_data->MinMarketOrderVolume;
930
+ data["MaxLimitOrderVolume"] = task_data->MaxLimitOrderVolume;
931
+ data["MinLimitOrderVolume"] = task_data->MinLimitOrderVolume;
932
+ data["PositionType"] = task_data->PositionType;
933
+ data["PositionDateType"] = task_data->PositionDateType;
934
+ data["CloseDealType"] = task_data->CloseDealType;
935
+ data["TradeCurrencyID"] = toUtf(task_data->TradeCurrencyID);
936
+ data["MortgageFundUseRange"] = task_data->MortgageFundUseRange;
937
+ data["ExchangeProductID"] = toUtf(task_data->ExchangeProductID);
938
+ data["UnderlyingMultiple"] = task_data->UnderlyingMultiple;
939
+ delete task_data;
940
+ }
941
+ dict error;
942
+ if (task->task_error)
943
+ {
944
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
945
+ error["ErrorID"] = task_error->ErrorID;
946
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
947
+ delete task_error;
948
+ }
949
+ this->onRspQryProduct(data, error, task->task_id, task->task_last);
950
+ };
951
+
952
+ void TdApi::processRspQryInstrument(Task *task)
953
+ {
954
+ gil_scoped_acquire acquire;
955
+ dict data;
956
+ if (task->task_data)
957
+ {
958
+ CThostFtdcInstrumentField *task_data = (CThostFtdcInstrumentField*)task->task_data;
959
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
960
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
961
+ data["InstrumentName"] = toUtf(task_data->InstrumentName);
962
+ data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID);
963
+ data["ProductID"] = toUtf(task_data->ProductID);
964
+ data["ProductClass"] = task_data->ProductClass;
965
+ data["DeliveryYear"] = task_data->DeliveryYear;
966
+ data["DeliveryMonth"] = task_data->DeliveryMonth;
967
+ data["MaxMarketOrderVolume"] = task_data->MaxMarketOrderVolume;
968
+ data["MinMarketOrderVolume"] = task_data->MinMarketOrderVolume;
969
+ data["MaxLimitOrderVolume"] = task_data->MaxLimitOrderVolume;
970
+ data["MinLimitOrderVolume"] = task_data->MinLimitOrderVolume;
971
+ data["VolumeMultiple"] = task_data->VolumeMultiple;
972
+ data["PriceTick"] = task_data->PriceTick;
973
+ data["CreateDate"] = toUtf(task_data->CreateDate);
974
+ data["OpenDate"] = toUtf(task_data->OpenDate);
975
+ data["ExpireDate"] = toUtf(task_data->ExpireDate);
976
+ data["StartDelivDate"] = toUtf(task_data->StartDelivDate);
977
+ data["EndDelivDate"] = toUtf(task_data->EndDelivDate);
978
+ data["InstLifePhase"] = task_data->InstLifePhase;
979
+ data["IsTrading"] = task_data->IsTrading;
980
+ data["PositionType"] = task_data->PositionType;
981
+ data["PositionDateType"] = task_data->PositionDateType;
982
+ data["LongMarginRatio"] = task_data->LongMarginRatio;
983
+ data["ShortMarginRatio"] = task_data->ShortMarginRatio;
984
+ data["MaxMarginSideAlgorithm"] = task_data->MaxMarginSideAlgorithm;
985
+ data["UnderlyingInstrID"] = toUtf(task_data->UnderlyingInstrID);
986
+ data["StrikePrice"] = task_data->StrikePrice;
987
+ data["OptionsType"] = task_data->OptionsType;
988
+ data["UnderlyingMultiple"] = task_data->UnderlyingMultiple;
989
+ data["CombinationType"] = task_data->CombinationType;
990
+ delete task_data;
991
+ }
992
+ dict error;
993
+ if (task->task_error)
994
+ {
995
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
996
+ error["ErrorID"] = task_error->ErrorID;
997
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
998
+ delete task_error;
999
+ }
1000
+ this->onRspQryInstrument(data, error, task->task_id, task->task_last);
1001
+ };
1002
+
1003
+ void TdApi::processRspQryCombInstrument(Task *task)
1004
+ {
1005
+ gil_scoped_acquire acquire;
1006
+ dict data;
1007
+ if (task->task_data)
1008
+ {
1009
+ CThostFtdcCombInstrumentField *task_data = (CThostFtdcCombInstrumentField*)task->task_data;
1010
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
1011
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
1012
+ data["CombinationType"] = task_data->CombinationType;
1013
+ data["ProductID"] = toUtf(task_data->ProductID);
1014
+ data["Xparameter"] = task_data->Xparameter;
1015
+ delete task_data;
1016
+ }
1017
+ dict error;
1018
+ if (task->task_error)
1019
+ {
1020
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
1021
+ error["ErrorID"] = task_error->ErrorID;
1022
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
1023
+ delete task_error;
1024
+ }
1025
+ this->onRspQryCombInstrument(data, error, task->task_id, task->task_last);
1026
+ };
1027
+
1028
+ void TdApi::processRspQryCombAction(Task *task)
1029
+ {
1030
+ gil_scoped_acquire acquire;
1031
+ dict data;
1032
+ if (task->task_data)
1033
+ {
1034
+ CThostFtdcCombActionField *task_data = (CThostFtdcCombActionField*)task->task_data;
1035
+ data["BrokerID"] = toUtf(task_data->BrokerID);
1036
+ data["InvestorID"] = toUtf(task_data->InvestorID);
1037
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
1038
+ data["CombActionRef"] = toUtf(task_data->CombActionRef);
1039
+ data["UserID"] = toUtf(task_data->UserID);
1040
+ data["Direction"] = task_data->Direction;
1041
+ data["Volume"] = task_data->Volume;
1042
+ data["CombDirection"] = task_data->CombDirection;
1043
+ data["HedgeFlag"] = task_data->HedgeFlag;
1044
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
1045
+ data["ActionLocalID"] = toUtf(task_data->ActionLocalID);
1046
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
1047
+ data["ParticipantID"] = toUtf(task_data->ParticipantID);
1048
+ data["ClientID"] = toUtf(task_data->ClientID);
1049
+ data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID);
1050
+ data["TraderID"] = toUtf(task_data->TraderID);
1051
+ data["InstallID"] = task_data->InstallID;
1052
+ data["ActionStatus"] = task_data->ActionStatus;
1053
+ data["NotifySequence"] = task_data->NotifySequence;
1054
+ data["TradingDay"] = toUtf(task_data->TradingDay);
1055
+ data["SettlementID"] = task_data->SettlementID;
1056
+ data["SequenceNo"] = task_data->SequenceNo;
1057
+ data["FrontID"] = task_data->FrontID;
1058
+ data["SessionID"] = task_data->SessionID;
1059
+ data["UserProductInfo"] = toUtf(task_data->UserProductInfo);
1060
+ data["StatusMsg"] = toUtf(task_data->StatusMsg);
1061
+ data["IPAddress"] = toUtf(task_data->IPAddress);
1062
+ data["MacAddress"] = toUtf(task_data->MacAddress);
1063
+ data["ComTradeID"] = toUtf(task_data->ComTradeID);
1064
+ delete task_data;
1065
+ }
1066
+ dict error;
1067
+ if (task->task_error)
1068
+ {
1069
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
1070
+ error["ErrorID"] = task_error->ErrorID;
1071
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
1072
+ delete task_error;
1073
+ }
1074
+ this->onRspQryCombAction(data, error, task->task_id, task->task_last);
1075
+ };
1076
+
1077
+ void TdApi::processRspQryInvestorPositionForComb(Task *task)
1078
+ {
1079
+ gil_scoped_acquire acquire;
1080
+ dict data;
1081
+ if (task->task_data)
1082
+ {
1083
+ CThostFtdcInvestorPositionForCombField *task_data = (CThostFtdcInvestorPositionForCombField*)task->task_data;
1084
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
1085
+ data["BrokerID"] = toUtf(task_data->BrokerID);
1086
+ data["InvestorID"] = toUtf(task_data->InvestorID);
1087
+ data["LegInstrumentID"] = toUtf(task_data->LegInstrumentID);
1088
+ data["LegHedgeFlag"] = task_data->LegHedgeFlag;
1089
+ data["LegDirection"] = task_data->LegDirection;
1090
+ data["TotalAmt"] = task_data->TotalAmt;
1091
+ data["LegID"] = task_data->LegID;
1092
+ data["TradeGroupID"] = task_data->TradeGroupID;
1093
+ data["CombInstrumentID"] = toUtf(task_data->CombInstrumentID);
1094
+ data["CombHedgeFlag"] = task_data->CombHedgeFlag;
1095
+ data["CombinationType"] = task_data->CombinationType;
1096
+ delete task_data;
1097
+ }
1098
+ dict error;
1099
+ if (task->task_error)
1100
+ {
1101
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
1102
+ error["ErrorID"] = task_error->ErrorID;
1103
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
1104
+ delete task_error;
1105
+ }
1106
+ this->onRspQryInvestorPositionForComb(data, error, task->task_id, task->task_last);
1107
+ };
1108
+
1109
+ void TdApi::processRspQryDepthMarketData(Task *task)
1110
+ {
1111
+ gil_scoped_acquire acquire;
1112
+ dict data;
1113
+ if (task->task_data)
1114
+ {
1115
+ CThostFtdcDepthMarketDataField *task_data = (CThostFtdcDepthMarketDataField*)task->task_data;
1116
+ data["TradingDay"] = toUtf(task_data->TradingDay);
1117
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
1118
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
1119
+ data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID);
1120
+ data["LastPrice"] = task_data->LastPrice;
1121
+ data["PreSettlementPrice"] = task_data->PreSettlementPrice;
1122
+ data["PreClosePrice"] = task_data->PreClosePrice;
1123
+ data["PreOpenInterest"] = task_data->PreOpenInterest;
1124
+ data["OpenPrice"] = task_data->OpenPrice;
1125
+ data["HighestPrice"] = task_data->HighestPrice;
1126
+ data["LowestPrice"] = task_data->LowestPrice;
1127
+ data["Volume"] = task_data->Volume;
1128
+ data["Turnover"] = task_data->Turnover;
1129
+ data["OpenInterest"] = task_data->OpenInterest;
1130
+ data["ClosePrice"] = task_data->ClosePrice;
1131
+ data["SettlementPrice"] = task_data->SettlementPrice;
1132
+ data["UpperLimitPrice"] = task_data->UpperLimitPrice;
1133
+ data["LowerLimitPrice"] = task_data->LowerLimitPrice;
1134
+ data["PreDelta"] = task_data->PreDelta;
1135
+ data["CurrDelta"] = task_data->CurrDelta;
1136
+ data["UpdateTime"] = toUtf(task_data->UpdateTime);
1137
+ data["UpdateMillisec"] = task_data->UpdateMillisec;
1138
+ data["BidPrice1"] = task_data->BidPrice1;
1139
+ data["BidVolume1"] = task_data->BidVolume1;
1140
+ data["AskPrice1"] = task_data->AskPrice1;
1141
+ data["AskVolume1"] = task_data->AskVolume1;
1142
+ data["BidPrice2"] = task_data->BidPrice2;
1143
+ data["BidVolume2"] = task_data->BidVolume2;
1144
+ data["AskPrice2"] = task_data->AskPrice2;
1145
+ data["AskVolume2"] = task_data->AskVolume2;
1146
+ data["BidPrice3"] = task_data->BidPrice3;
1147
+ data["BidVolume3"] = task_data->BidVolume3;
1148
+ data["AskPrice3"] = task_data->AskPrice3;
1149
+ data["AskVolume3"] = task_data->AskVolume3;
1150
+ data["BidPrice4"] = task_data->BidPrice4;
1151
+ data["BidVolume4"] = task_data->BidVolume4;
1152
+ data["AskPrice4"] = task_data->AskPrice4;
1153
+ data["AskVolume4"] = task_data->AskVolume4;
1154
+ data["BidPrice5"] = task_data->BidPrice5;
1155
+ data["BidVolume5"] = task_data->BidVolume5;
1156
+ data["AskPrice5"] = task_data->AskPrice5;
1157
+ data["AskVolume5"] = task_data->AskVolume5;
1158
+ data["AveragePrice"] = task_data->AveragePrice;
1159
+ data["ActionDay"] = toUtf(task_data->ActionDay);
1160
+ data["BandingUpperPrice"] = task_data->BandingUpperPrice;
1161
+ data["BandingLowerPrice"] = task_data->BandingLowerPrice;
1162
+ delete task_data;
1163
+ }
1164
+ dict error;
1165
+ if (task->task_error)
1166
+ {
1167
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
1168
+ error["ErrorID"] = task_error->ErrorID;
1169
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
1170
+ delete task_error;
1171
+ }
1172
+ this->onRspQryDepthMarketData(data, error, task->task_id, task->task_last);
1173
+ };
1174
+
1175
+ void TdApi::processRspQryInstrumentStatus(Task *task)
1176
+ {
1177
+ gil_scoped_acquire acquire;
1178
+ dict data;
1179
+ if (task->task_data)
1180
+ {
1181
+ CThostFtdcInstrumentStatusField *task_data = (CThostFtdcInstrumentStatusField*)task->task_data;
1182
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
1183
+ data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID);
1184
+ data["SettlementGroupID"] = toUtf(task_data->SettlementGroupID);
1185
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
1186
+ data["InstrumentStatus"] = task_data->InstrumentStatus;
1187
+ data["TradingSegmentSN"] = task_data->TradingSegmentSN;
1188
+ data["EnterTime"] = toUtf(task_data->EnterTime);
1189
+ data["EnterReason"] = task_data->EnterReason;
1190
+ delete task_data;
1191
+ }
1192
+ dict error;
1193
+ if (task->task_error)
1194
+ {
1195
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
1196
+ error["ErrorID"] = task_error->ErrorID;
1197
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
1198
+ delete task_error;
1199
+ }
1200
+ this->onRspQryInstrumentStatus(data, error, task->task_id, task->task_last);
1201
+ };
1202
+
1203
+ void TdApi::processRspQryInvestorPositionDetail(Task *task)
1204
+ {
1205
+ gil_scoped_acquire acquire;
1206
+ dict data;
1207
+ if (task->task_data)
1208
+ {
1209
+ CThostFtdcInvestorPositionDetailField *task_data = (CThostFtdcInvestorPositionDetailField*)task->task_data;
1210
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
1211
+ data["BrokerID"] = toUtf(task_data->BrokerID);
1212
+ data["InvestorID"] = toUtf(task_data->InvestorID);
1213
+ data["HedgeFlag"] = task_data->HedgeFlag;
1214
+ data["Direction"] = task_data->Direction;
1215
+ data["OpenDate"] = toUtf(task_data->OpenDate);
1216
+ data["TradeID"] = toUtf(task_data->TradeID);
1217
+ data["Volume"] = task_data->Volume;
1218
+ data["OpenPrice"] = task_data->OpenPrice;
1219
+ data["TradingDay"] = toUtf(task_data->TradingDay);
1220
+ data["SettlementID"] = task_data->SettlementID;
1221
+ data["TradeType"] = task_data->TradeType;
1222
+ data["CombInstrumentID"] = toUtf(task_data->CombInstrumentID);
1223
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
1224
+ data["CloseProfitByDate"] = task_data->CloseProfitByDate;
1225
+ data["CloseProfitByTrade"] = task_data->CloseProfitByTrade;
1226
+ data["PositionProfitByDate"] = task_data->PositionProfitByDate;
1227
+ data["PositionProfitByTrade"] = task_data->PositionProfitByTrade;
1228
+ data["Margin"] = task_data->Margin;
1229
+ data["ExchMargin"] = task_data->ExchMargin;
1230
+ data["MarginRateByMoney"] = task_data->MarginRateByMoney;
1231
+ data["MarginRateByVolume"] = task_data->MarginRateByVolume;
1232
+ data["LastSettlementPrice"] = task_data->LastSettlementPrice;
1233
+ data["SettlementPrice"] = task_data->SettlementPrice;
1234
+ data["CloseVolume"] = task_data->CloseVolume;
1235
+ data["CloseAmount"] = task_data->CloseAmount;
1236
+ delete task_data;
1237
+ }
1238
+ dict error;
1239
+ if (task->task_error)
1240
+ {
1241
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
1242
+ error["ErrorID"] = task_error->ErrorID;
1243
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
1244
+ delete task_error;
1245
+ }
1246
+ this->onRspQryInvestorPositionDetail(data, error, task->task_id, task->task_last);
1247
+ };
1248
+
1249
+ void TdApi::processRspQryInvestorPositionCombineDetail(Task *task)
1250
+ {
1251
+ gil_scoped_acquire acquire;
1252
+ dict data;
1253
+ if (task->task_data)
1254
+ {
1255
+ CThostFtdcInvestorPositionCombineDetailField *task_data = (CThostFtdcInvestorPositionCombineDetailField*)task->task_data;
1256
+ data["TradingDay"] = toUtf(task_data->TradingDay);
1257
+ data["OpenDate"] = toUtf(task_data->OpenDate);
1258
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
1259
+ data["SettlementID"] = task_data->SettlementID;
1260
+ data["BrokerID"] = toUtf(task_data->BrokerID);
1261
+ data["InvestorID"] = toUtf(task_data->InvestorID);
1262
+ data["ComTradeID"] = toUtf(task_data->ComTradeID);
1263
+ data["TradeID"] = toUtf(task_data->TradeID);
1264
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
1265
+ data["HedgeFlag"] = task_data->HedgeFlag;
1266
+ data["Direction"] = task_data->Direction;
1267
+ data["TotalAmt"] = task_data->TotalAmt;
1268
+ data["Margin"] = task_data->Margin;
1269
+ data["ExchMargin"] = task_data->ExchMargin;
1270
+ data["MarginRateByMoney"] = task_data->MarginRateByMoney;
1271
+ data["MarginRateByVolume"] = task_data->MarginRateByVolume;
1272
+ data["LegID"] = task_data->LegID;
1273
+ data["LegMultiple"] = task_data->LegMultiple;
1274
+ data["CombInstrumentID"] = toUtf(task_data->CombInstrumentID);
1275
+ data["TradeGroupID"] = task_data->TradeGroupID;
1276
+ delete task_data;
1277
+ }
1278
+ dict error;
1279
+ if (task->task_error)
1280
+ {
1281
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
1282
+ error["ErrorID"] = task_error->ErrorID;
1283
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
1284
+ delete task_error;
1285
+ }
1286
+ this->onRspQryInvestorPositionCombineDetail(data, error, task->task_id, task->task_last);
1287
+ };
1288
+
1289
+ void TdApi::processRspQryExchangeMarginRate(Task *task)
1290
+ {
1291
+ gil_scoped_acquire acquire;
1292
+ dict data;
1293
+ if (task->task_data)
1294
+ {
1295
+ CThostFtdcExchangeMarginRateField *task_data = (CThostFtdcExchangeMarginRateField*)task->task_data;
1296
+ data["BrokerID"] = toUtf(task_data->BrokerID);
1297
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
1298
+ data["HedgeFlag"] = task_data->HedgeFlag;
1299
+ data["LongMarginRatioByMoney"] = task_data->LongMarginRatioByMoney;
1300
+ data["LongMarginRatioByVolume"] = task_data->LongMarginRatioByVolume;
1301
+ data["ShortMarginRatioByMoney"] = task_data->ShortMarginRatioByMoney;
1302
+ data["ShortMarginRatioByVolume"] = task_data->ShortMarginRatioByVolume;
1303
+ delete task_data;
1304
+ }
1305
+ dict error;
1306
+ if (task->task_error)
1307
+ {
1308
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
1309
+ error["ErrorID"] = task_error->ErrorID;
1310
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
1311
+ delete task_error;
1312
+ }
1313
+ this->onRspQryExchangeMarginRate(data, error, task->task_id, task->task_last);
1314
+ };
1315
+
1316
+ void TdApi::processRspQryExchangeMarginRateAdjust(Task *task)
1317
+ {
1318
+ gil_scoped_acquire acquire;
1319
+ dict data;
1320
+ if (task->task_data)
1321
+ {
1322
+ CThostFtdcExchangeMarginRateAdjustField *task_data = (CThostFtdcExchangeMarginRateAdjustField*)task->task_data;
1323
+ data["BrokerID"] = toUtf(task_data->BrokerID);
1324
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
1325
+ data["HedgeFlag"] = task_data->HedgeFlag;
1326
+ data["LongMarginRatioByMoney"] = task_data->LongMarginRatioByMoney;
1327
+ data["LongMarginRatioByVolume"] = task_data->LongMarginRatioByVolume;
1328
+ data["ShortMarginRatioByMoney"] = task_data->ShortMarginRatioByMoney;
1329
+ data["ShortMarginRatioByVolume"] = task_data->ShortMarginRatioByVolume;
1330
+ data["ExchLongMarginRatioByMoney"] = task_data->ExchLongMarginRatioByMoney;
1331
+ data["ExchLongMarginRatioByVolume"] = task_data->ExchLongMarginRatioByVolume;
1332
+ data["ExchShortMarginRatioByMoney"] = task_data->ExchShortMarginRatioByMoney;
1333
+ data["ExchShortMarginRatioByVolume"] = task_data->ExchShortMarginRatioByVolume;
1334
+ data["NoLongMarginRatioByMoney"] = task_data->NoLongMarginRatioByMoney;
1335
+ data["NoLongMarginRatioByVolume"] = task_data->NoLongMarginRatioByVolume;
1336
+ data["NoShortMarginRatioByMoney"] = task_data->NoShortMarginRatioByMoney;
1337
+ data["NoShortMarginRatioByVolume"] = task_data->NoShortMarginRatioByVolume;
1338
+ delete task_data;
1339
+ }
1340
+ dict error;
1341
+ if (task->task_error)
1342
+ {
1343
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
1344
+ error["ErrorID"] = task_error->ErrorID;
1345
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
1346
+ delete task_error;
1347
+ }
1348
+ this->onRspQryExchangeMarginRateAdjust(data, error, task->task_id, task->task_last);
1349
+ };
1350
+
1351
+ void TdApi::processRspQryOptionInstrTradeCost(Task *task)
1352
+ {
1353
+ gil_scoped_acquire acquire;
1354
+ dict data;
1355
+ if (task->task_data)
1356
+ {
1357
+ CThostFtdcOptionInstrTradeCostField *task_data = (CThostFtdcOptionInstrTradeCostField*)task->task_data;
1358
+ data["BrokerID"] = toUtf(task_data->BrokerID);
1359
+ data["InvestorID"] = toUtf(task_data->InvestorID);
1360
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
1361
+ data["HedgeFlag"] = task_data->HedgeFlag;
1362
+ data["FixedMargin"] = task_data->FixedMargin;
1363
+ data["MiniMargin"] = task_data->MiniMargin;
1364
+ data["Royalty"] = task_data->Royalty;
1365
+ data["ExchFixedMargin"] = task_data->ExchFixedMargin;
1366
+ data["ExchMiniMargin"] = task_data->ExchMiniMargin;
1367
+ delete task_data;
1368
+ }
1369
+ dict error;
1370
+ if (task->task_error)
1371
+ {
1372
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
1373
+ error["ErrorID"] = task_error->ErrorID;
1374
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
1375
+ delete task_error;
1376
+ }
1377
+ this->onRspQryOptionInstrTradeCost(data, error, task->task_id, task->task_last);
1378
+ };
1379
+
1380
+ void TdApi::processRspQryOptionInstrCommRate(Task *task)
1381
+ {
1382
+ gil_scoped_acquire acquire;
1383
+ dict data;
1384
+ if (task->task_data)
1385
+ {
1386
+ CThostFtdcOptionInstrCommRateField *task_data = (CThostFtdcOptionInstrCommRateField*)task->task_data;
1387
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
1388
+ data["InvestorRange"] = task_data->InvestorRange;
1389
+ data["BrokerID"] = toUtf(task_data->BrokerID);
1390
+ data["InvestorID"] = toUtf(task_data->InvestorID);
1391
+ data["OpenRatioByMoney"] = task_data->OpenRatioByMoney;
1392
+ data["OpenRatioByVolume"] = task_data->OpenRatioByVolume;
1393
+ data["CloseRatioByMoney"] = task_data->CloseRatioByMoney;
1394
+ data["CloseRatioByVolume"] = task_data->CloseRatioByVolume;
1395
+ data["CloseTodayRatioByMoney"] = task_data->CloseTodayRatioByMoney;
1396
+ data["CloseTodayRatioByVolume"] = task_data->CloseTodayRatioByVolume;
1397
+ data["StrikeRatioByMoney"] = task_data->StrikeRatioByMoney;
1398
+ data["StrikeRatioByVolume"] = task_data->StrikeRatioByVolume;
1399
+ delete task_data;
1400
+ }
1401
+ dict error;
1402
+ if (task->task_error)
1403
+ {
1404
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
1405
+ error["ErrorID"] = task_error->ErrorID;
1406
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
1407
+ delete task_error;
1408
+ }
1409
+ this->onRspQryOptionInstrCommRate(data, error, task->task_id, task->task_last);
1410
+ };
1411
+
1412
+ void TdApi::processRspQryExecOrder(Task *task)
1413
+ {
1414
+ gil_scoped_acquire acquire;
1415
+ dict data;
1416
+ if (task->task_data)
1417
+ {
1418
+ CThostFtdcExecOrderField *task_data = (CThostFtdcExecOrderField*)task->task_data;
1419
+ data["BrokerID"] = toUtf(task_data->BrokerID);
1420
+ data["InvestorID"] = toUtf(task_data->InvestorID);
1421
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
1422
+ data["ExecOrderRef"] = toUtf(task_data->ExecOrderRef);
1423
+ data["UserID"] = toUtf(task_data->UserID);
1424
+ data["Volume"] = task_data->Volume;
1425
+ data["RequestID"] = task_data->RequestID;
1426
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
1427
+ data["OffsetFlag"] = task_data->OffsetFlag;
1428
+ data["HedgeFlag"] = task_data->HedgeFlag;
1429
+ data["ActionType"] = task_data->ActionType;
1430
+ data["PosiDirection"] = task_data->PosiDirection;
1431
+ data["ReservePositionFlag"] = task_data->ReservePositionFlag;
1432
+ data["CloseFlag"] = task_data->CloseFlag;
1433
+ data["ExecOrderLocalID"] = toUtf(task_data->ExecOrderLocalID);
1434
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
1435
+ data["ParticipantID"] = toUtf(task_data->ParticipantID);
1436
+ data["ClientID"] = toUtf(task_data->ClientID);
1437
+ data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID);
1438
+ data["TraderID"] = toUtf(task_data->TraderID);
1439
+ data["InstallID"] = task_data->InstallID;
1440
+ data["OrderSubmitStatus"] = task_data->OrderSubmitStatus;
1441
+ data["NotifySequence"] = task_data->NotifySequence;
1442
+ data["TradingDay"] = toUtf(task_data->TradingDay);
1443
+ data["SettlementID"] = task_data->SettlementID;
1444
+ data["ExecOrderSysID"] = toUtf(task_data->ExecOrderSysID);
1445
+ data["InsertDate"] = toUtf(task_data->InsertDate);
1446
+ data["InsertTime"] = toUtf(task_data->InsertTime);
1447
+ data["CancelTime"] = toUtf(task_data->CancelTime);
1448
+ data["ExecResult"] = task_data->ExecResult;
1449
+ data["ClearingPartID"] = toUtf(task_data->ClearingPartID);
1450
+ data["SequenceNo"] = task_data->SequenceNo;
1451
+ data["FrontID"] = task_data->FrontID;
1452
+ data["SessionID"] = task_data->SessionID;
1453
+ data["UserProductInfo"] = toUtf(task_data->UserProductInfo);
1454
+ data["StatusMsg"] = toUtf(task_data->StatusMsg);
1455
+ data["ActiveUserID"] = toUtf(task_data->ActiveUserID);
1456
+ data["BrokerExecOrderSeq"] = task_data->BrokerExecOrderSeq;
1457
+ data["BranchID"] = toUtf(task_data->BranchID);
1458
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
1459
+ data["AccountID"] = toUtf(task_data->AccountID);
1460
+ data["CurrencyID"] = toUtf(task_data->CurrencyID);
1461
+ data["IPAddress"] = toUtf(task_data->IPAddress);
1462
+ data["MacAddress"] = toUtf(task_data->MacAddress);
1463
+ delete task_data;
1464
+ }
1465
+ dict error;
1466
+ if (task->task_error)
1467
+ {
1468
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
1469
+ error["ErrorID"] = task_error->ErrorID;
1470
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
1471
+ delete task_error;
1472
+ }
1473
+ this->onRspQryExecOrder(data, error, task->task_id, task->task_last);
1474
+ };
1475
+
1476
+ void TdApi::processRspQryForQuote(Task *task)
1477
+ {
1478
+ gil_scoped_acquire acquire;
1479
+ dict data;
1480
+ if (task->task_data)
1481
+ {
1482
+ CThostFtdcForQuoteField *task_data = (CThostFtdcForQuoteField*)task->task_data;
1483
+ data["BrokerID"] = toUtf(task_data->BrokerID);
1484
+ data["InvestorID"] = toUtf(task_data->InvestorID);
1485
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
1486
+ data["ForQuoteRef"] = toUtf(task_data->ForQuoteRef);
1487
+ data["UserID"] = toUtf(task_data->UserID);
1488
+ data["ForQuoteLocalID"] = toUtf(task_data->ForQuoteLocalID);
1489
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
1490
+ data["ParticipantID"] = toUtf(task_data->ParticipantID);
1491
+ data["ClientID"] = toUtf(task_data->ClientID);
1492
+ data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID);
1493
+ data["TraderID"] = toUtf(task_data->TraderID);
1494
+ data["InstallID"] = task_data->InstallID;
1495
+ data["InsertDate"] = toUtf(task_data->InsertDate);
1496
+ data["InsertTime"] = toUtf(task_data->InsertTime);
1497
+ data["ForQuoteStatus"] = task_data->ForQuoteStatus;
1498
+ data["FrontID"] = task_data->FrontID;
1499
+ data["SessionID"] = task_data->SessionID;
1500
+ data["StatusMsg"] = toUtf(task_data->StatusMsg);
1501
+ data["ActiveUserID"] = toUtf(task_data->ActiveUserID);
1502
+ data["BrokerForQutoSeq"] = task_data->BrokerForQutoSeq;
1503
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
1504
+ data["IPAddress"] = toUtf(task_data->IPAddress);
1505
+ data["MacAddress"] = toUtf(task_data->MacAddress);
1506
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
1507
+ delete task_data;
1508
+ }
1509
+ dict error;
1510
+ if (task->task_error)
1511
+ {
1512
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
1513
+ error["ErrorID"] = task_error->ErrorID;
1514
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
1515
+ delete task_error;
1516
+ }
1517
+ this->onRspQryForQuote(data, error, task->task_id, task->task_last);
1518
+ };
1519
+
1520
+ void TdApi::processRspQryQuote(Task *task)
1521
+ {
1522
+ gil_scoped_acquire acquire;
1523
+ dict data;
1524
+ if (task->task_data)
1525
+ {
1526
+ CThostFtdcQuoteField *task_data = (CThostFtdcQuoteField*)task->task_data;
1527
+ data["BrokerID"] = toUtf(task_data->BrokerID);
1528
+ data["InvestorID"] = toUtf(task_data->InvestorID);
1529
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
1530
+ data["QuoteRef"] = toUtf(task_data->QuoteRef);
1531
+ data["UserID"] = toUtf(task_data->UserID);
1532
+ data["AskPrice"] = task_data->AskPrice;
1533
+ data["BidPrice"] = task_data->BidPrice;
1534
+ data["AskVolume"] = task_data->AskVolume;
1535
+ data["BidVolume"] = task_data->BidVolume;
1536
+ data["RequestID"] = task_data->RequestID;
1537
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
1538
+ data["AskOffsetFlag"] = task_data->AskOffsetFlag;
1539
+ data["BidOffsetFlag"] = task_data->BidOffsetFlag;
1540
+ data["AskHedgeFlag"] = task_data->AskHedgeFlag;
1541
+ data["BidHedgeFlag"] = task_data->BidHedgeFlag;
1542
+ data["QuoteLocalID"] = toUtf(task_data->QuoteLocalID);
1543
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
1544
+ data["ParticipantID"] = toUtf(task_data->ParticipantID);
1545
+ data["ClientID"] = toUtf(task_data->ClientID);
1546
+ data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID);
1547
+ data["TraderID"] = toUtf(task_data->TraderID);
1548
+ data["InstallID"] = task_data->InstallID;
1549
+ data["NotifySequence"] = task_data->NotifySequence;
1550
+ data["OrderSubmitStatus"] = task_data->OrderSubmitStatus;
1551
+ data["TradingDay"] = toUtf(task_data->TradingDay);
1552
+ data["SettlementID"] = task_data->SettlementID;
1553
+ data["QuoteSysID"] = toUtf(task_data->QuoteSysID);
1554
+ data["InsertDate"] = toUtf(task_data->InsertDate);
1555
+ data["InsertTime"] = toUtf(task_data->InsertTime);
1556
+ data["CancelTime"] = toUtf(task_data->CancelTime);
1557
+ data["QuoteStatus"] = task_data->QuoteStatus;
1558
+ data["ClearingPartID"] = toUtf(task_data->ClearingPartID);
1559
+ data["SequenceNo"] = task_data->SequenceNo;
1560
+ data["AskOrderSysID"] = toUtf(task_data->AskOrderSysID);
1561
+ data["BidOrderSysID"] = toUtf(task_data->BidOrderSysID);
1562
+ data["FrontID"] = task_data->FrontID;
1563
+ data["SessionID"] = task_data->SessionID;
1564
+ data["UserProductInfo"] = toUtf(task_data->UserProductInfo);
1565
+ data["StatusMsg"] = toUtf(task_data->StatusMsg);
1566
+ data["ActiveUserID"] = toUtf(task_data->ActiveUserID);
1567
+ data["BrokerQuoteSeq"] = task_data->BrokerQuoteSeq;
1568
+ data["AskOrderRef"] = toUtf(task_data->AskOrderRef);
1569
+ data["BidOrderRef"] = toUtf(task_data->BidOrderRef);
1570
+ data["ForQuoteSysID"] = toUtf(task_data->ForQuoteSysID);
1571
+ data["BranchID"] = toUtf(task_data->BranchID);
1572
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
1573
+ data["AccountID"] = toUtf(task_data->AccountID);
1574
+ data["CurrencyID"] = toUtf(task_data->CurrencyID);
1575
+ data["IPAddress"] = toUtf(task_data->IPAddress);
1576
+ data["MacAddress"] = toUtf(task_data->MacAddress);
1577
+ data["ReplaceSysID"] = toUtf(task_data->ReplaceSysID);
1578
+ delete task_data;
1579
+ }
1580
+ dict error;
1581
+ if (task->task_error)
1582
+ {
1583
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
1584
+ error["ErrorID"] = task_error->ErrorID;
1585
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
1586
+ delete task_error;
1587
+ }
1588
+ this->onRspQryQuote(data, error, task->task_id, task->task_last);
1589
+ };
1590
+
1591
+ void TdApi::processRspQryOptionSelfClose(Task *task)
1592
+ {
1593
+ gil_scoped_acquire acquire;
1594
+ dict data;
1595
+ if (task->task_data)
1596
+ {
1597
+ CThostFtdcOptionSelfCloseField *task_data = (CThostFtdcOptionSelfCloseField*)task->task_data;
1598
+ data["BrokerID"] = toUtf(task_data->BrokerID);
1599
+ data["InvestorID"] = toUtf(task_data->InvestorID);
1600
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
1601
+ data["OptionSelfCloseRef"] = toUtf(task_data->OptionSelfCloseRef);
1602
+ data["UserID"] = toUtf(task_data->UserID);
1603
+ data["Volume"] = task_data->Volume;
1604
+ data["RequestID"] = task_data->RequestID;
1605
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
1606
+ data["HedgeFlag"] = task_data->HedgeFlag;
1607
+ data["OptSelfCloseFlag"] = task_data->OptSelfCloseFlag;
1608
+ data["OptionSelfCloseLocalID"] = toUtf(task_data->OptionSelfCloseLocalID);
1609
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
1610
+ data["ParticipantID"] = toUtf(task_data->ParticipantID);
1611
+ data["ClientID"] = toUtf(task_data->ClientID);
1612
+ data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID);
1613
+ data["TraderID"] = toUtf(task_data->TraderID);
1614
+ data["InstallID"] = task_data->InstallID;
1615
+ data["OrderSubmitStatus"] = task_data->OrderSubmitStatus;
1616
+ data["NotifySequence"] = task_data->NotifySequence;
1617
+ data["TradingDay"] = toUtf(task_data->TradingDay);
1618
+ data["SettlementID"] = task_data->SettlementID;
1619
+ data["OptionSelfCloseSysID"] = toUtf(task_data->OptionSelfCloseSysID);
1620
+ data["InsertDate"] = toUtf(task_data->InsertDate);
1621
+ data["InsertTime"] = toUtf(task_data->InsertTime);
1622
+ data["CancelTime"] = toUtf(task_data->CancelTime);
1623
+ data["ExecResult"] = task_data->ExecResult;
1624
+ data["ClearingPartID"] = toUtf(task_data->ClearingPartID);
1625
+ data["SequenceNo"] = task_data->SequenceNo;
1626
+ data["FrontID"] = task_data->FrontID;
1627
+ data["SessionID"] = task_data->SessionID;
1628
+ data["UserProductInfo"] = toUtf(task_data->UserProductInfo);
1629
+ data["StatusMsg"] = toUtf(task_data->StatusMsg);
1630
+ data["ActiveUserID"] = toUtf(task_data->ActiveUserID);
1631
+ data["BrokerOptionSelfCloseSeq"] = task_data->BrokerOptionSelfCloseSeq;
1632
+ data["BranchID"] = toUtf(task_data->BranchID);
1633
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
1634
+ data["AccountID"] = toUtf(task_data->AccountID);
1635
+ data["CurrencyID"] = toUtf(task_data->CurrencyID);
1636
+ data["IPAddress"] = toUtf(task_data->IPAddress);
1637
+ data["MacAddress"] = toUtf(task_data->MacAddress);
1638
+ delete task_data;
1639
+ }
1640
+ dict error;
1641
+ if (task->task_error)
1642
+ {
1643
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
1644
+ error["ErrorID"] = task_error->ErrorID;
1645
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
1646
+ delete task_error;
1647
+ }
1648
+ this->onRspQryOptionSelfClose(data, error, task->task_id, task->task_last);
1649
+ };
1650
+
1651
+ void TdApi::processRspError(Task *task)
1652
+ {
1653
+ gil_scoped_acquire acquire;
1654
+ dict error;
1655
+ if (task->task_error)
1656
+ {
1657
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
1658
+ error["ErrorID"] = task_error->ErrorID;
1659
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
1660
+ delete task_error;
1661
+ }
1662
+ this->onRspError(error, task->task_id, task->task_last);
1663
+ };
1664
+
1665
+ void TdApi::processRtnOrder(Task *task)
1666
+ {
1667
+ gil_scoped_acquire acquire;
1668
+ dict data;
1669
+ if (task->task_data)
1670
+ {
1671
+ CThostFtdcOrderField *task_data = (CThostFtdcOrderField*)task->task_data;
1672
+ data["BrokerID"] = toUtf(task_data->BrokerID);
1673
+ data["InvestorID"] = toUtf(task_data->InvestorID);
1674
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
1675
+ data["OrderRef"] = toUtf(task_data->OrderRef);
1676
+ data["UserID"] = toUtf(task_data->UserID);
1677
+ data["OrderPriceType"] = task_data->OrderPriceType;
1678
+ data["Direction"] = task_data->Direction;
1679
+ data["CombOffsetFlag"] = toUtf(task_data->CombOffsetFlag);
1680
+ data["CombHedgeFlag"] = toUtf(task_data->CombHedgeFlag);
1681
+ data["LimitPrice"] = task_data->LimitPrice;
1682
+ data["VolumeTotalOriginal"] = task_data->VolumeTotalOriginal;
1683
+ data["TimeCondition"] = task_data->TimeCondition;
1684
+ data["GTDDate"] = toUtf(task_data->GTDDate);
1685
+ data["VolumeCondition"] = task_data->VolumeCondition;
1686
+ data["MinVolume"] = task_data->MinVolume;
1687
+ data["ContingentCondition"] = task_data->ContingentCondition;
1688
+ data["StopPrice"] = task_data->StopPrice;
1689
+ data["ForceCloseReason"] = task_data->ForceCloseReason;
1690
+ data["IsAutoSuspend"] = task_data->IsAutoSuspend;
1691
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
1692
+ data["RequestID"] = task_data->RequestID;
1693
+ data["OrderLocalID"] = toUtf(task_data->OrderLocalID);
1694
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
1695
+ data["ParticipantID"] = toUtf(task_data->ParticipantID);
1696
+ data["ClientID"] = toUtf(task_data->ClientID);
1697
+ data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID);
1698
+ data["TraderID"] = toUtf(task_data->TraderID);
1699
+ data["InstallID"] = task_data->InstallID;
1700
+ data["OrderSubmitStatus"] = task_data->OrderSubmitStatus;
1701
+ data["NotifySequence"] = task_data->NotifySequence;
1702
+ data["TradingDay"] = toUtf(task_data->TradingDay);
1703
+ data["SettlementID"] = task_data->SettlementID;
1704
+ data["OrderSysID"] = toUtf(task_data->OrderSysID);
1705
+ data["OrderSource"] = task_data->OrderSource;
1706
+ data["OrderStatus"] = task_data->OrderStatus;
1707
+ data["OrderType"] = task_data->OrderType;
1708
+ data["VolumeTraded"] = task_data->VolumeTraded;
1709
+ data["VolumeTotal"] = task_data->VolumeTotal;
1710
+ data["InsertDate"] = toUtf(task_data->InsertDate);
1711
+ data["InsertTime"] = toUtf(task_data->InsertTime);
1712
+ data["ActiveTime"] = toUtf(task_data->ActiveTime);
1713
+ data["SuspendTime"] = toUtf(task_data->SuspendTime);
1714
+ data["UpdateTime"] = toUtf(task_data->UpdateTime);
1715
+ data["CancelTime"] = toUtf(task_data->CancelTime);
1716
+ data["ActiveTraderID"] = toUtf(task_data->ActiveTraderID);
1717
+ data["ClearingPartID"] = toUtf(task_data->ClearingPartID);
1718
+ data["SequenceNo"] = task_data->SequenceNo;
1719
+ data["FrontID"] = task_data->FrontID;
1720
+ data["SessionID"] = task_data->SessionID;
1721
+ data["UserProductInfo"] = toUtf(task_data->UserProductInfo);
1722
+ data["StatusMsg"] = toUtf(task_data->StatusMsg);
1723
+ data["UserForceClose"] = task_data->UserForceClose;
1724
+ data["ActiveUserID"] = toUtf(task_data->ActiveUserID);
1725
+ data["BrokerOrderSeq"] = task_data->BrokerOrderSeq;
1726
+ data["RelativeOrderSysID"] = toUtf(task_data->RelativeOrderSysID);
1727
+ data["ZCETotalTradedVolume"] = task_data->ZCETotalTradedVolume;
1728
+ data["IsSwapOrder"] = task_data->IsSwapOrder;
1729
+ data["BranchID"] = toUtf(task_data->BranchID);
1730
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
1731
+ data["AccountID"] = toUtf(task_data->AccountID);
1732
+ data["CurrencyID"] = toUtf(task_data->CurrencyID);
1733
+ data["IPAddress"] = toUtf(task_data->IPAddress);
1734
+ data["MacAddress"] = toUtf(task_data->MacAddress);
1735
+ delete task_data;
1736
+ }
1737
+ this->onRtnOrder(data);
1738
+ };
1739
+
1740
+ void TdApi::processRtnTrade(Task *task)
1741
+ {
1742
+ gil_scoped_acquire acquire;
1743
+ dict data;
1744
+ if (task->task_data)
1745
+ {
1746
+ CThostFtdcTradeField *task_data = (CThostFtdcTradeField*)task->task_data;
1747
+ data["BrokerID"] = toUtf(task_data->BrokerID);
1748
+ data["InvestorID"] = toUtf(task_data->InvestorID);
1749
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
1750
+ data["OrderRef"] = toUtf(task_data->OrderRef);
1751
+ data["UserID"] = toUtf(task_data->UserID);
1752
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
1753
+ data["TradeID"] = toUtf(task_data->TradeID);
1754
+ data["Direction"] = task_data->Direction;
1755
+ data["OrderSysID"] = toUtf(task_data->OrderSysID);
1756
+ data["ParticipantID"] = toUtf(task_data->ParticipantID);
1757
+ data["ClientID"] = toUtf(task_data->ClientID);
1758
+ data["TradingRole"] = task_data->TradingRole;
1759
+ data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID);
1760
+ data["OffsetFlag"] = task_data->OffsetFlag;
1761
+ data["HedgeFlag"] = task_data->HedgeFlag;
1762
+ data["Price"] = task_data->Price;
1763
+ data["Volume"] = task_data->Volume;
1764
+ data["TradeDate"] = toUtf(task_data->TradeDate);
1765
+ data["TradeTime"] = toUtf(task_data->TradeTime);
1766
+ data["TradeType"] = task_data->TradeType;
1767
+ data["PriceSource"] = task_data->PriceSource;
1768
+ data["TraderID"] = toUtf(task_data->TraderID);
1769
+ data["OrderLocalID"] = toUtf(task_data->OrderLocalID);
1770
+ data["ClearingPartID"] = toUtf(task_data->ClearingPartID);
1771
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
1772
+ data["SequenceNo"] = task_data->SequenceNo;
1773
+ data["TradingDay"] = toUtf(task_data->TradingDay);
1774
+ data["SettlementID"] = task_data->SettlementID;
1775
+ data["BrokerOrderSeq"] = task_data->BrokerOrderSeq;
1776
+ data["TradeSource"] = task_data->TradeSource;
1777
+ delete task_data;
1778
+ }
1779
+ this->onRtnTrade(data);
1780
+ };
1781
+
1782
+ void TdApi::processErrRtnOrderInsert(Task *task)
1783
+ {
1784
+ gil_scoped_acquire acquire;
1785
+ dict data;
1786
+ if (task->task_data)
1787
+ {
1788
+ CThostFtdcInputOrderField *task_data = (CThostFtdcInputOrderField*)task->task_data;
1789
+ data["BrokerID"] = toUtf(task_data->BrokerID);
1790
+ data["InvestorID"] = toUtf(task_data->InvestorID);
1791
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
1792
+ data["OrderRef"] = toUtf(task_data->OrderRef);
1793
+ data["UserID"] = toUtf(task_data->UserID);
1794
+ data["OrderPriceType"] = task_data->OrderPriceType;
1795
+ data["Direction"] = task_data->Direction;
1796
+ data["CombOffsetFlag"] = toUtf(task_data->CombOffsetFlag);
1797
+ data["CombHedgeFlag"] = toUtf(task_data->CombHedgeFlag);
1798
+ data["LimitPrice"] = task_data->LimitPrice;
1799
+ data["VolumeTotalOriginal"] = task_data->VolumeTotalOriginal;
1800
+ data["TimeCondition"] = task_data->TimeCondition;
1801
+ data["GTDDate"] = toUtf(task_data->GTDDate);
1802
+ data["VolumeCondition"] = task_data->VolumeCondition;
1803
+ data["MinVolume"] = task_data->MinVolume;
1804
+ data["ContingentCondition"] = task_data->ContingentCondition;
1805
+ data["StopPrice"] = task_data->StopPrice;
1806
+ data["ForceCloseReason"] = task_data->ForceCloseReason;
1807
+ data["IsAutoSuspend"] = task_data->IsAutoSuspend;
1808
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
1809
+ data["RequestID"] = task_data->RequestID;
1810
+ data["UserForceClose"] = task_data->UserForceClose;
1811
+ data["IsSwapOrder"] = task_data->IsSwapOrder;
1812
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
1813
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
1814
+ data["AccountID"] = toUtf(task_data->AccountID);
1815
+ data["CurrencyID"] = toUtf(task_data->CurrencyID);
1816
+ data["ClientID"] = toUtf(task_data->ClientID);
1817
+ data["IPAddress"] = toUtf(task_data->IPAddress);
1818
+ data["MacAddress"] = toUtf(task_data->MacAddress);
1819
+ delete task_data;
1820
+ }
1821
+ dict error;
1822
+ if (task->task_error)
1823
+ {
1824
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
1825
+ error["ErrorID"] = task_error->ErrorID;
1826
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
1827
+ delete task_error;
1828
+ }
1829
+ this->onErrRtnOrderInsert(data, error);
1830
+ };
1831
+
1832
+ void TdApi::processErrRtnOrderAction(Task *task)
1833
+ {
1834
+ gil_scoped_acquire acquire;
1835
+ dict data;
1836
+ if (task->task_data)
1837
+ {
1838
+ CThostFtdcOrderActionField *task_data = (CThostFtdcOrderActionField*)task->task_data;
1839
+ data["BrokerID"] = toUtf(task_data->BrokerID);
1840
+ data["InvestorID"] = toUtf(task_data->InvestorID);
1841
+ data["OrderActionRef"] = task_data->OrderActionRef;
1842
+ data["OrderRef"] = toUtf(task_data->OrderRef);
1843
+ data["RequestID"] = task_data->RequestID;
1844
+ data["FrontID"] = task_data->FrontID;
1845
+ data["SessionID"] = task_data->SessionID;
1846
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
1847
+ data["OrderSysID"] = toUtf(task_data->OrderSysID);
1848
+ data["ActionFlag"] = task_data->ActionFlag;
1849
+ data["LimitPrice"] = task_data->LimitPrice;
1850
+ data["VolumeChange"] = task_data->VolumeChange;
1851
+ data["ActionDate"] = toUtf(task_data->ActionDate);
1852
+ data["ActionTime"] = toUtf(task_data->ActionTime);
1853
+ data["TraderID"] = toUtf(task_data->TraderID);
1854
+ data["InstallID"] = task_data->InstallID;
1855
+ data["OrderLocalID"] = toUtf(task_data->OrderLocalID);
1856
+ data["ActionLocalID"] = toUtf(task_data->ActionLocalID);
1857
+ data["ParticipantID"] = toUtf(task_data->ParticipantID);
1858
+ data["ClientID"] = toUtf(task_data->ClientID);
1859
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
1860
+ data["OrderActionStatus"] = task_data->OrderActionStatus;
1861
+ data["UserID"] = toUtf(task_data->UserID);
1862
+ data["StatusMsg"] = toUtf(task_data->StatusMsg);
1863
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
1864
+ data["BranchID"] = toUtf(task_data->BranchID);
1865
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
1866
+ data["IPAddress"] = toUtf(task_data->IPAddress);
1867
+ data["MacAddress"] = toUtf(task_data->MacAddress);
1868
+ delete task_data;
1869
+ }
1870
+ dict error;
1871
+ if (task->task_error)
1872
+ {
1873
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
1874
+ error["ErrorID"] = task_error->ErrorID;
1875
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
1876
+ delete task_error;
1877
+ }
1878
+ this->onErrRtnOrderAction(data, error);
1879
+ };
1880
+
1881
+ void TdApi::processRtnInstrumentStatus(Task *task)
1882
+ {
1883
+ gil_scoped_acquire acquire;
1884
+ dict data;
1885
+ if (task->task_data)
1886
+ {
1887
+ CThostFtdcInstrumentStatusField *task_data = (CThostFtdcInstrumentStatusField*)task->task_data;
1888
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
1889
+ data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID);
1890
+ data["SettlementGroupID"] = toUtf(task_data->SettlementGroupID);
1891
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
1892
+ data["InstrumentStatus"] = task_data->InstrumentStatus;
1893
+ data["TradingSegmentSN"] = task_data->TradingSegmentSN;
1894
+ data["EnterTime"] = toUtf(task_data->EnterTime);
1895
+ data["EnterReason"] = task_data->EnterReason;
1896
+ delete task_data;
1897
+ }
1898
+ this->onRtnInstrumentStatus(data);
1899
+ };
1900
+
1901
+ void TdApi::processRtnExecOrder(Task *task)
1902
+ {
1903
+ gil_scoped_acquire acquire;
1904
+ dict data;
1905
+ if (task->task_data)
1906
+ {
1907
+ CThostFtdcExecOrderField *task_data = (CThostFtdcExecOrderField*)task->task_data;
1908
+ data["BrokerID"] = toUtf(task_data->BrokerID);
1909
+ data["InvestorID"] = toUtf(task_data->InvestorID);
1910
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
1911
+ data["ExecOrderRef"] = toUtf(task_data->ExecOrderRef);
1912
+ data["UserID"] = toUtf(task_data->UserID);
1913
+ data["Volume"] = task_data->Volume;
1914
+ data["RequestID"] = task_data->RequestID;
1915
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
1916
+ data["OffsetFlag"] = task_data->OffsetFlag;
1917
+ data["HedgeFlag"] = task_data->HedgeFlag;
1918
+ data["ActionType"] = task_data->ActionType;
1919
+ data["PosiDirection"] = task_data->PosiDirection;
1920
+ data["ReservePositionFlag"] = task_data->ReservePositionFlag;
1921
+ data["CloseFlag"] = task_data->CloseFlag;
1922
+ data["ExecOrderLocalID"] = toUtf(task_data->ExecOrderLocalID);
1923
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
1924
+ data["ParticipantID"] = toUtf(task_data->ParticipantID);
1925
+ data["ClientID"] = toUtf(task_data->ClientID);
1926
+ data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID);
1927
+ data["TraderID"] = toUtf(task_data->TraderID);
1928
+ data["InstallID"] = task_data->InstallID;
1929
+ data["OrderSubmitStatus"] = task_data->OrderSubmitStatus;
1930
+ data["NotifySequence"] = task_data->NotifySequence;
1931
+ data["TradingDay"] = toUtf(task_data->TradingDay);
1932
+ data["SettlementID"] = task_data->SettlementID;
1933
+ data["ExecOrderSysID"] = toUtf(task_data->ExecOrderSysID);
1934
+ data["InsertDate"] = toUtf(task_data->InsertDate);
1935
+ data["InsertTime"] = toUtf(task_data->InsertTime);
1936
+ data["CancelTime"] = toUtf(task_data->CancelTime);
1937
+ data["ExecResult"] = task_data->ExecResult;
1938
+ data["ClearingPartID"] = toUtf(task_data->ClearingPartID);
1939
+ data["SequenceNo"] = task_data->SequenceNo;
1940
+ data["FrontID"] = task_data->FrontID;
1941
+ data["SessionID"] = task_data->SessionID;
1942
+ data["UserProductInfo"] = toUtf(task_data->UserProductInfo);
1943
+ data["StatusMsg"] = toUtf(task_data->StatusMsg);
1944
+ data["ActiveUserID"] = toUtf(task_data->ActiveUserID);
1945
+ data["BrokerExecOrderSeq"] = task_data->BrokerExecOrderSeq;
1946
+ data["BranchID"] = toUtf(task_data->BranchID);
1947
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
1948
+ data["AccountID"] = toUtf(task_data->AccountID);
1949
+ data["CurrencyID"] = toUtf(task_data->CurrencyID);
1950
+ data["IPAddress"] = toUtf(task_data->IPAddress);
1951
+ data["MacAddress"] = toUtf(task_data->MacAddress);
1952
+ delete task_data;
1953
+ }
1954
+ this->onRtnExecOrder(data);
1955
+ };
1956
+
1957
+ void TdApi::processErrRtnExecOrderInsert(Task *task)
1958
+ {
1959
+ gil_scoped_acquire acquire;
1960
+ dict data;
1961
+ if (task->task_data)
1962
+ {
1963
+ CThostFtdcInputExecOrderField *task_data = (CThostFtdcInputExecOrderField*)task->task_data;
1964
+ data["BrokerID"] = toUtf(task_data->BrokerID);
1965
+ data["InvestorID"] = toUtf(task_data->InvestorID);
1966
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
1967
+ data["ExecOrderRef"] = toUtf(task_data->ExecOrderRef);
1968
+ data["UserID"] = toUtf(task_data->UserID);
1969
+ data["Volume"] = task_data->Volume;
1970
+ data["RequestID"] = task_data->RequestID;
1971
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
1972
+ data["OffsetFlag"] = task_data->OffsetFlag;
1973
+ data["HedgeFlag"] = task_data->HedgeFlag;
1974
+ data["ActionType"] = task_data->ActionType;
1975
+ data["PosiDirection"] = task_data->PosiDirection;
1976
+ data["ReservePositionFlag"] = task_data->ReservePositionFlag;
1977
+ data["CloseFlag"] = task_data->CloseFlag;
1978
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
1979
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
1980
+ data["AccountID"] = toUtf(task_data->AccountID);
1981
+ data["CurrencyID"] = toUtf(task_data->CurrencyID);
1982
+ data["ClientID"] = toUtf(task_data->ClientID);
1983
+ data["IPAddress"] = toUtf(task_data->IPAddress);
1984
+ data["MacAddress"] = toUtf(task_data->MacAddress);
1985
+ delete task_data;
1986
+ }
1987
+ dict error;
1988
+ if (task->task_error)
1989
+ {
1990
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
1991
+ error["ErrorID"] = task_error->ErrorID;
1992
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
1993
+ delete task_error;
1994
+ }
1995
+ this->onErrRtnExecOrderInsert(data, error);
1996
+ };
1997
+
1998
+ void TdApi::processErrRtnExecOrderAction(Task *task)
1999
+ {
2000
+ gil_scoped_acquire acquire;
2001
+ dict data;
2002
+ if (task->task_data)
2003
+ {
2004
+ CThostFtdcExecOrderActionField *task_data = (CThostFtdcExecOrderActionField*)task->task_data;
2005
+ data["BrokerID"] = toUtf(task_data->BrokerID);
2006
+ data["InvestorID"] = toUtf(task_data->InvestorID);
2007
+ data["ExecOrderActionRef"] = task_data->ExecOrderActionRef;
2008
+ data["ExecOrderRef"] = toUtf(task_data->ExecOrderRef);
2009
+ data["RequestID"] = task_data->RequestID;
2010
+ data["FrontID"] = task_data->FrontID;
2011
+ data["SessionID"] = task_data->SessionID;
2012
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
2013
+ data["ExecOrderSysID"] = toUtf(task_data->ExecOrderSysID);
2014
+ data["ActionFlag"] = task_data->ActionFlag;
2015
+ data["ActionDate"] = toUtf(task_data->ActionDate);
2016
+ data["ActionTime"] = toUtf(task_data->ActionTime);
2017
+ data["TraderID"] = toUtf(task_data->TraderID);
2018
+ data["InstallID"] = task_data->InstallID;
2019
+ data["ExecOrderLocalID"] = toUtf(task_data->ExecOrderLocalID);
2020
+ data["ActionLocalID"] = toUtf(task_data->ActionLocalID);
2021
+ data["ParticipantID"] = toUtf(task_data->ParticipantID);
2022
+ data["ClientID"] = toUtf(task_data->ClientID);
2023
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
2024
+ data["OrderActionStatus"] = task_data->OrderActionStatus;
2025
+ data["UserID"] = toUtf(task_data->UserID);
2026
+ data["ActionType"] = task_data->ActionType;
2027
+ data["StatusMsg"] = toUtf(task_data->StatusMsg);
2028
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
2029
+ data["BranchID"] = toUtf(task_data->BranchID);
2030
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
2031
+ data["IPAddress"] = toUtf(task_data->IPAddress);
2032
+ data["MacAddress"] = toUtf(task_data->MacAddress);
2033
+ delete task_data;
2034
+ }
2035
+ dict error;
2036
+ if (task->task_error)
2037
+ {
2038
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
2039
+ error["ErrorID"] = task_error->ErrorID;
2040
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
2041
+ delete task_error;
2042
+ }
2043
+ this->onErrRtnExecOrderAction(data, error);
2044
+ };
2045
+
2046
+ void TdApi::processErrRtnForQuoteInsert(Task *task)
2047
+ {
2048
+ gil_scoped_acquire acquire;
2049
+ dict data;
2050
+ if (task->task_data)
2051
+ {
2052
+ CThostFtdcInputForQuoteField *task_data = (CThostFtdcInputForQuoteField*)task->task_data;
2053
+ data["BrokerID"] = toUtf(task_data->BrokerID);
2054
+ data["InvestorID"] = toUtf(task_data->InvestorID);
2055
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
2056
+ data["ForQuoteRef"] = toUtf(task_data->ForQuoteRef);
2057
+ data["UserID"] = toUtf(task_data->UserID);
2058
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
2059
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
2060
+ data["IPAddress"] = toUtf(task_data->IPAddress);
2061
+ data["MacAddress"] = toUtf(task_data->MacAddress);
2062
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
2063
+ delete task_data;
2064
+ }
2065
+ dict error;
2066
+ if (task->task_error)
2067
+ {
2068
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
2069
+ error["ErrorID"] = task_error->ErrorID;
2070
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
2071
+ delete task_error;
2072
+ }
2073
+ this->onErrRtnForQuoteInsert(data, error);
2074
+ };
2075
+
2076
+ void TdApi::processRtnQuote(Task *task)
2077
+ {
2078
+ gil_scoped_acquire acquire;
2079
+ dict data;
2080
+ if (task->task_data)
2081
+ {
2082
+ CThostFtdcQuoteField *task_data = (CThostFtdcQuoteField*)task->task_data;
2083
+ data["BrokerID"] = toUtf(task_data->BrokerID);
2084
+ data["InvestorID"] = toUtf(task_data->InvestorID);
2085
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
2086
+ data["QuoteRef"] = toUtf(task_data->QuoteRef);
2087
+ data["UserID"] = toUtf(task_data->UserID);
2088
+ data["AskPrice"] = task_data->AskPrice;
2089
+ data["BidPrice"] = task_data->BidPrice;
2090
+ data["AskVolume"] = task_data->AskVolume;
2091
+ data["BidVolume"] = task_data->BidVolume;
2092
+ data["RequestID"] = task_data->RequestID;
2093
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
2094
+ data["AskOffsetFlag"] = task_data->AskOffsetFlag;
2095
+ data["BidOffsetFlag"] = task_data->BidOffsetFlag;
2096
+ data["AskHedgeFlag"] = task_data->AskHedgeFlag;
2097
+ data["BidHedgeFlag"] = task_data->BidHedgeFlag;
2098
+ data["QuoteLocalID"] = toUtf(task_data->QuoteLocalID);
2099
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
2100
+ data["ParticipantID"] = toUtf(task_data->ParticipantID);
2101
+ data["ClientID"] = toUtf(task_data->ClientID);
2102
+ data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID);
2103
+ data["TraderID"] = toUtf(task_data->TraderID);
2104
+ data["InstallID"] = task_data->InstallID;
2105
+ data["NotifySequence"] = task_data->NotifySequence;
2106
+ data["OrderSubmitStatus"] = task_data->OrderSubmitStatus;
2107
+ data["TradingDay"] = toUtf(task_data->TradingDay);
2108
+ data["SettlementID"] = task_data->SettlementID;
2109
+ data["QuoteSysID"] = toUtf(task_data->QuoteSysID);
2110
+ data["InsertDate"] = toUtf(task_data->InsertDate);
2111
+ data["InsertTime"] = toUtf(task_data->InsertTime);
2112
+ data["CancelTime"] = toUtf(task_data->CancelTime);
2113
+ data["QuoteStatus"] = task_data->QuoteStatus;
2114
+ data["ClearingPartID"] = toUtf(task_data->ClearingPartID);
2115
+ data["SequenceNo"] = task_data->SequenceNo;
2116
+ data["AskOrderSysID"] = toUtf(task_data->AskOrderSysID);
2117
+ data["BidOrderSysID"] = toUtf(task_data->BidOrderSysID);
2118
+ data["FrontID"] = task_data->FrontID;
2119
+ data["SessionID"] = task_data->SessionID;
2120
+ data["UserProductInfo"] = toUtf(task_data->UserProductInfo);
2121
+ data["StatusMsg"] = toUtf(task_data->StatusMsg);
2122
+ data["ActiveUserID"] = toUtf(task_data->ActiveUserID);
2123
+ data["BrokerQuoteSeq"] = task_data->BrokerQuoteSeq;
2124
+ data["AskOrderRef"] = toUtf(task_data->AskOrderRef);
2125
+ data["BidOrderRef"] = toUtf(task_data->BidOrderRef);
2126
+ data["ForQuoteSysID"] = toUtf(task_data->ForQuoteSysID);
2127
+ data["BranchID"] = toUtf(task_data->BranchID);
2128
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
2129
+ data["AccountID"] = toUtf(task_data->AccountID);
2130
+ data["CurrencyID"] = toUtf(task_data->CurrencyID);
2131
+ data["IPAddress"] = toUtf(task_data->IPAddress);
2132
+ data["MacAddress"] = toUtf(task_data->MacAddress);
2133
+ data["ReplaceSysID"] = toUtf(task_data->ReplaceSysID);
2134
+ delete task_data;
2135
+ }
2136
+ this->onRtnQuote(data);
2137
+ };
2138
+
2139
+ void TdApi::processErrRtnQuoteInsert(Task *task)
2140
+ {
2141
+ gil_scoped_acquire acquire;
2142
+ dict data;
2143
+ if (task->task_data)
2144
+ {
2145
+ CThostFtdcInputQuoteField *task_data = (CThostFtdcInputQuoteField*)task->task_data;
2146
+ data["BrokerID"] = toUtf(task_data->BrokerID);
2147
+ data["InvestorID"] = toUtf(task_data->InvestorID);
2148
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
2149
+ data["QuoteRef"] = toUtf(task_data->QuoteRef);
2150
+ data["UserID"] = toUtf(task_data->UserID);
2151
+ data["AskPrice"] = task_data->AskPrice;
2152
+ data["BidPrice"] = task_data->BidPrice;
2153
+ data["AskVolume"] = task_data->AskVolume;
2154
+ data["BidVolume"] = task_data->BidVolume;
2155
+ data["RequestID"] = task_data->RequestID;
2156
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
2157
+ data["AskOffsetFlag"] = task_data->AskOffsetFlag;
2158
+ data["BidOffsetFlag"] = task_data->BidOffsetFlag;
2159
+ data["AskHedgeFlag"] = task_data->AskHedgeFlag;
2160
+ data["BidHedgeFlag"] = task_data->BidHedgeFlag;
2161
+ data["AskOrderRef"] = toUtf(task_data->AskOrderRef);
2162
+ data["BidOrderRef"] = toUtf(task_data->BidOrderRef);
2163
+ data["ForQuoteSysID"] = toUtf(task_data->ForQuoteSysID);
2164
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
2165
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
2166
+ data["ClientID"] = toUtf(task_data->ClientID);
2167
+ data["IPAddress"] = toUtf(task_data->IPAddress);
2168
+ data["MacAddress"] = toUtf(task_data->MacAddress);
2169
+ data["ReplaceSysID"] = toUtf(task_data->ReplaceSysID);
2170
+ delete task_data;
2171
+ }
2172
+ dict error;
2173
+ if (task->task_error)
2174
+ {
2175
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
2176
+ error["ErrorID"] = task_error->ErrorID;
2177
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
2178
+ delete task_error;
2179
+ }
2180
+ this->onErrRtnQuoteInsert(data, error);
2181
+ };
2182
+
2183
+ void TdApi::processErrRtnQuoteAction(Task *task)
2184
+ {
2185
+ gil_scoped_acquire acquire;
2186
+ dict data;
2187
+ if (task->task_data)
2188
+ {
2189
+ CThostFtdcQuoteActionField *task_data = (CThostFtdcQuoteActionField*)task->task_data;
2190
+ data["BrokerID"] = toUtf(task_data->BrokerID);
2191
+ data["InvestorID"] = toUtf(task_data->InvestorID);
2192
+ data["QuoteActionRef"] = task_data->QuoteActionRef;
2193
+ data["QuoteRef"] = toUtf(task_data->QuoteRef);
2194
+ data["RequestID"] = task_data->RequestID;
2195
+ data["FrontID"] = task_data->FrontID;
2196
+ data["SessionID"] = task_data->SessionID;
2197
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
2198
+ data["QuoteSysID"] = toUtf(task_data->QuoteSysID);
2199
+ data["ActionFlag"] = task_data->ActionFlag;
2200
+ data["ActionDate"] = toUtf(task_data->ActionDate);
2201
+ data["ActionTime"] = toUtf(task_data->ActionTime);
2202
+ data["TraderID"] = toUtf(task_data->TraderID);
2203
+ data["InstallID"] = task_data->InstallID;
2204
+ data["QuoteLocalID"] = toUtf(task_data->QuoteLocalID);
2205
+ data["ActionLocalID"] = toUtf(task_data->ActionLocalID);
2206
+ data["ParticipantID"] = toUtf(task_data->ParticipantID);
2207
+ data["ClientID"] = toUtf(task_data->ClientID);
2208
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
2209
+ data["OrderActionStatus"] = task_data->OrderActionStatus;
2210
+ data["UserID"] = toUtf(task_data->UserID);
2211
+ data["StatusMsg"] = toUtf(task_data->StatusMsg);
2212
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
2213
+ data["BranchID"] = toUtf(task_data->BranchID);
2214
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
2215
+ data["IPAddress"] = toUtf(task_data->IPAddress);
2216
+ data["MacAddress"] = toUtf(task_data->MacAddress);
2217
+ delete task_data;
2218
+ }
2219
+ dict error;
2220
+ if (task->task_error)
2221
+ {
2222
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
2223
+ error["ErrorID"] = task_error->ErrorID;
2224
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
2225
+ delete task_error;
2226
+ }
2227
+ this->onErrRtnQuoteAction(data, error);
2228
+ };
2229
+
2230
+ void TdApi::processRtnForQuoteRsp(Task *task)
2231
+ {
2232
+ gil_scoped_acquire acquire;
2233
+ dict data;
2234
+ if (task->task_data)
2235
+ {
2236
+ CThostFtdcForQuoteRspField *task_data = (CThostFtdcForQuoteRspField*)task->task_data;
2237
+ data["TradingDay"] = toUtf(task_data->TradingDay);
2238
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
2239
+ data["ForQuoteSysID"] = toUtf(task_data->ForQuoteSysID);
2240
+ data["ForQuoteTime"] = toUtf(task_data->ForQuoteTime);
2241
+ data["ActionDay"] = toUtf(task_data->ActionDay);
2242
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
2243
+ delete task_data;
2244
+ }
2245
+ this->onRtnForQuoteRsp(data);
2246
+ };
2247
+
2248
+ void TdApi::processErrRtnBatchOrderAction(Task *task)
2249
+ {
2250
+ gil_scoped_acquire acquire;
2251
+ dict data;
2252
+ if (task->task_data)
2253
+ {
2254
+ CThostFtdcBatchOrderActionField *task_data = (CThostFtdcBatchOrderActionField*)task->task_data;
2255
+ data["BrokerID"] = toUtf(task_data->BrokerID);
2256
+ data["InvestorID"] = toUtf(task_data->InvestorID);
2257
+ data["OrderActionRef"] = task_data->OrderActionRef;
2258
+ data["RequestID"] = task_data->RequestID;
2259
+ data["FrontID"] = task_data->FrontID;
2260
+ data["SessionID"] = task_data->SessionID;
2261
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
2262
+ data["ActionDate"] = toUtf(task_data->ActionDate);
2263
+ data["ActionTime"] = toUtf(task_data->ActionTime);
2264
+ data["TraderID"] = toUtf(task_data->TraderID);
2265
+ data["InstallID"] = task_data->InstallID;
2266
+ data["ActionLocalID"] = toUtf(task_data->ActionLocalID);
2267
+ data["ParticipantID"] = toUtf(task_data->ParticipantID);
2268
+ data["ClientID"] = toUtf(task_data->ClientID);
2269
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
2270
+ data["OrderActionStatus"] = task_data->OrderActionStatus;
2271
+ data["UserID"] = toUtf(task_data->UserID);
2272
+ data["StatusMsg"] = toUtf(task_data->StatusMsg);
2273
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
2274
+ data["IPAddress"] = toUtf(task_data->IPAddress);
2275
+ data["MacAddress"] = toUtf(task_data->MacAddress);
2276
+ delete task_data;
2277
+ }
2278
+ dict error;
2279
+ if (task->task_error)
2280
+ {
2281
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
2282
+ error["ErrorID"] = task_error->ErrorID;
2283
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
2284
+ delete task_error;
2285
+ }
2286
+ this->onErrRtnBatchOrderAction(data, error);
2287
+ };
2288
+
2289
+ void TdApi::processRtnOptionSelfClose(Task *task)
2290
+ {
2291
+ gil_scoped_acquire acquire;
2292
+ dict data;
2293
+ if (task->task_data)
2294
+ {
2295
+ CThostFtdcOptionSelfCloseField *task_data = (CThostFtdcOptionSelfCloseField*)task->task_data;
2296
+ data["BrokerID"] = toUtf(task_data->BrokerID);
2297
+ data["InvestorID"] = toUtf(task_data->InvestorID);
2298
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
2299
+ data["OptionSelfCloseRef"] = toUtf(task_data->OptionSelfCloseRef);
2300
+ data["UserID"] = toUtf(task_data->UserID);
2301
+ data["Volume"] = task_data->Volume;
2302
+ data["RequestID"] = task_data->RequestID;
2303
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
2304
+ data["HedgeFlag"] = task_data->HedgeFlag;
2305
+ data["OptSelfCloseFlag"] = task_data->OptSelfCloseFlag;
2306
+ data["OptionSelfCloseLocalID"] = toUtf(task_data->OptionSelfCloseLocalID);
2307
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
2308
+ data["ParticipantID"] = toUtf(task_data->ParticipantID);
2309
+ data["ClientID"] = toUtf(task_data->ClientID);
2310
+ data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID);
2311
+ data["TraderID"] = toUtf(task_data->TraderID);
2312
+ data["InstallID"] = task_data->InstallID;
2313
+ data["OrderSubmitStatus"] = task_data->OrderSubmitStatus;
2314
+ data["NotifySequence"] = task_data->NotifySequence;
2315
+ data["TradingDay"] = toUtf(task_data->TradingDay);
2316
+ data["SettlementID"] = task_data->SettlementID;
2317
+ data["OptionSelfCloseSysID"] = toUtf(task_data->OptionSelfCloseSysID);
2318
+ data["InsertDate"] = toUtf(task_data->InsertDate);
2319
+ data["InsertTime"] = toUtf(task_data->InsertTime);
2320
+ data["CancelTime"] = toUtf(task_data->CancelTime);
2321
+ data["ExecResult"] = task_data->ExecResult;
2322
+ data["ClearingPartID"] = toUtf(task_data->ClearingPartID);
2323
+ data["SequenceNo"] = task_data->SequenceNo;
2324
+ data["FrontID"] = task_data->FrontID;
2325
+ data["SessionID"] = task_data->SessionID;
2326
+ data["UserProductInfo"] = toUtf(task_data->UserProductInfo);
2327
+ data["StatusMsg"] = toUtf(task_data->StatusMsg);
2328
+ data["ActiveUserID"] = toUtf(task_data->ActiveUserID);
2329
+ data["BrokerOptionSelfCloseSeq"] = task_data->BrokerOptionSelfCloseSeq;
2330
+ data["BranchID"] = toUtf(task_data->BranchID);
2331
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
2332
+ data["AccountID"] = toUtf(task_data->AccountID);
2333
+ data["CurrencyID"] = toUtf(task_data->CurrencyID);
2334
+ data["IPAddress"] = toUtf(task_data->IPAddress);
2335
+ data["MacAddress"] = toUtf(task_data->MacAddress);
2336
+ delete task_data;
2337
+ }
2338
+ this->onRtnOptionSelfClose(data);
2339
+ };
2340
+
2341
+ void TdApi::processErrRtnOptionSelfCloseInsert(Task *task)
2342
+ {
2343
+ gil_scoped_acquire acquire;
2344
+ dict data;
2345
+ if (task->task_data)
2346
+ {
2347
+ CThostFtdcInputOptionSelfCloseField *task_data = (CThostFtdcInputOptionSelfCloseField*)task->task_data;
2348
+ data["BrokerID"] = toUtf(task_data->BrokerID);
2349
+ data["InvestorID"] = toUtf(task_data->InvestorID);
2350
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
2351
+ data["OptionSelfCloseRef"] = toUtf(task_data->OptionSelfCloseRef);
2352
+ data["UserID"] = toUtf(task_data->UserID);
2353
+ data["Volume"] = task_data->Volume;
2354
+ data["RequestID"] = task_data->RequestID;
2355
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
2356
+ data["HedgeFlag"] = task_data->HedgeFlag;
2357
+ data["OptSelfCloseFlag"] = task_data->OptSelfCloseFlag;
2358
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
2359
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
2360
+ data["AccountID"] = toUtf(task_data->AccountID);
2361
+ data["CurrencyID"] = toUtf(task_data->CurrencyID);
2362
+ data["ClientID"] = toUtf(task_data->ClientID);
2363
+ data["IPAddress"] = toUtf(task_data->IPAddress);
2364
+ data["MacAddress"] = toUtf(task_data->MacAddress);
2365
+ delete task_data;
2366
+ }
2367
+ dict error;
2368
+ if (task->task_error)
2369
+ {
2370
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
2371
+ error["ErrorID"] = task_error->ErrorID;
2372
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
2373
+ delete task_error;
2374
+ }
2375
+ this->onErrRtnOptionSelfCloseInsert(data, error);
2376
+ };
2377
+
2378
+ void TdApi::processErrRtnOptionSelfCloseAction(Task *task)
2379
+ {
2380
+ gil_scoped_acquire acquire;
2381
+ dict data;
2382
+ if (task->task_data)
2383
+ {
2384
+ CThostFtdcOptionSelfCloseActionField *task_data = (CThostFtdcOptionSelfCloseActionField*)task->task_data;
2385
+ data["BrokerID"] = toUtf(task_data->BrokerID);
2386
+ data["InvestorID"] = toUtf(task_data->InvestorID);
2387
+ data["OptionSelfCloseActionRef"] = task_data->OptionSelfCloseActionRef;
2388
+ data["OptionSelfCloseRef"] = toUtf(task_data->OptionSelfCloseRef);
2389
+ data["RequestID"] = task_data->RequestID;
2390
+ data["FrontID"] = task_data->FrontID;
2391
+ data["SessionID"] = task_data->SessionID;
2392
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
2393
+ data["OptionSelfCloseSysID"] = toUtf(task_data->OptionSelfCloseSysID);
2394
+ data["ActionFlag"] = task_data->ActionFlag;
2395
+ data["ActionDate"] = toUtf(task_data->ActionDate);
2396
+ data["ActionTime"] = toUtf(task_data->ActionTime);
2397
+ data["TraderID"] = toUtf(task_data->TraderID);
2398
+ data["InstallID"] = task_data->InstallID;
2399
+ data["OptionSelfCloseLocalID"] = toUtf(task_data->OptionSelfCloseLocalID);
2400
+ data["ActionLocalID"] = toUtf(task_data->ActionLocalID);
2401
+ data["ParticipantID"] = toUtf(task_data->ParticipantID);
2402
+ data["ClientID"] = toUtf(task_data->ClientID);
2403
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
2404
+ data["OrderActionStatus"] = task_data->OrderActionStatus;
2405
+ data["UserID"] = toUtf(task_data->UserID);
2406
+ data["StatusMsg"] = toUtf(task_data->StatusMsg);
2407
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
2408
+ data["BranchID"] = toUtf(task_data->BranchID);
2409
+ data["InvestUnitID"] = toUtf(task_data->InvestUnitID);
2410
+ data["IPAddress"] = toUtf(task_data->IPAddress);
2411
+ data["MacAddress"] = toUtf(task_data->MacAddress);
2412
+ delete task_data;
2413
+ }
2414
+ dict error;
2415
+ if (task->task_error)
2416
+ {
2417
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
2418
+ error["ErrorID"] = task_error->ErrorID;
2419
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
2420
+ delete task_error;
2421
+ }
2422
+ this->onErrRtnOptionSelfCloseAction(data, error);
2423
+ };
2424
+
2425
+ void TdApi::processRtnCombAction(Task *task)
2426
+ {
2427
+ gil_scoped_acquire acquire;
2428
+ dict data;
2429
+ if (task->task_data)
2430
+ {
2431
+ CThostFtdcCombActionField *task_data = (CThostFtdcCombActionField*)task->task_data;
2432
+ data["BrokerID"] = toUtf(task_data->BrokerID);
2433
+ data["InvestorID"] = toUtf(task_data->InvestorID);
2434
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
2435
+ data["CombActionRef"] = toUtf(task_data->CombActionRef);
2436
+ data["UserID"] = toUtf(task_data->UserID);
2437
+ data["Direction"] = task_data->Direction;
2438
+ data["Volume"] = task_data->Volume;
2439
+ data["CombDirection"] = task_data->CombDirection;
2440
+ data["HedgeFlag"] = task_data->HedgeFlag;
2441
+ data["BusinessUnit"] = toUtf(task_data->BusinessUnit);
2442
+ data["ActionLocalID"] = toUtf(task_data->ActionLocalID);
2443
+ data["ExchangeID"] = toUtf(task_data->ExchangeID);
2444
+ data["ParticipantID"] = toUtf(task_data->ParticipantID);
2445
+ data["ClientID"] = toUtf(task_data->ClientID);
2446
+ data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID);
2447
+ data["TraderID"] = toUtf(task_data->TraderID);
2448
+ data["InstallID"] = task_data->InstallID;
2449
+ data["ActionStatus"] = task_data->ActionStatus;
2450
+ data["NotifySequence"] = task_data->NotifySequence;
2451
+ data["TradingDay"] = toUtf(task_data->TradingDay);
2452
+ data["SettlementID"] = task_data->SettlementID;
2453
+ data["SequenceNo"] = task_data->SequenceNo;
2454
+ data["FrontID"] = task_data->FrontID;
2455
+ data["SessionID"] = task_data->SessionID;
2456
+ data["UserProductInfo"] = toUtf(task_data->UserProductInfo);
2457
+ data["StatusMsg"] = toUtf(task_data->StatusMsg);
2458
+ data["IPAddress"] = toUtf(task_data->IPAddress);
2459
+ data["MacAddress"] = toUtf(task_data->MacAddress);
2460
+ data["ComTradeID"] = toUtf(task_data->ComTradeID);
2461
+ delete task_data;
2462
+ }
2463
+ this->onRtnCombAction(data);
2464
+ };
2465
+
2466
+ void TdApi::processRspQryInstrumentOrderCommRate(Task *task)
2467
+ {
2468
+ gil_scoped_acquire acquire;
2469
+ dict data;
2470
+ if (task->task_data)
2471
+ {
2472
+ CThostFtdcInstrumentOrderCommRateField *task_data = (CThostFtdcInstrumentOrderCommRateField*)task->task_data;
2473
+ data["InstrumentID"] = toUtf(task_data->InstrumentID);
2474
+ data["InvestorRange"] = task_data->InvestorRange;
2475
+ data["BrokerID"] = toUtf(task_data->BrokerID);
2476
+ data["InvestorID"] = toUtf(task_data->InvestorID);
2477
+ data["HedgeFlag"] = task_data->HedgeFlag;
2478
+ data["OrderCommByVolume"] = task_data->OrderCommByVolume;
2479
+ data["OrderActionCommByVolume"] = task_data->OrderActionCommByVolume;
2480
+ delete task_data;
2481
+ }
2482
+ dict error;
2483
+ if (task->task_error)
2484
+ {
2485
+ CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error;
2486
+ error["ErrorID"] = task_error->ErrorID;
2487
+ error["ErrorMsg"] = toUtf(task_error->ErrorMsg);
2488
+ delete task_error;
2489
+ }
2490
+ this->onRspQryInstrumentOrderCommRate(data, error, task->task_id, task->task_last);
2491
+ };
2492
+