ThostFtdcTraderApi.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. /////////////////////////////////////////////////////////////////////////
  2. ///@system 新一代交易所系统
  3. ///@company 上海期货信息技术有限公司
  4. ///@file ThostFtdcTraderApi.h
  5. ///@brief 定义了客户端接口
  6. ///@history
  7. ///20060106 赵鸿昊 创建该文件
  8. /////////////////////////////////////////////////////////////////////////
  9. #if !defined(THOST_FTDCTRADERAPI_H)
  10. #define THOST_FTDCTRADERAPI_H
  11. #if _MSC_VER > 1000
  12. #pragma once
  13. #endif // _MSC_VER > 1000
  14. #include "ThostFtdcUserApiStruct.h"
  15. #if defined(ISLIB) && defined(WIN32)
  16. #ifdef LIB_TRADER_API_EXPORT
  17. #define TRADER_API_EXPORT __declspec(dllexport)
  18. #else
  19. #define TRADER_API_EXPORT __declspec(dllimport)
  20. #endif
  21. #else
  22. #define TRADER_API_EXPORT
  23. #endif
  24. class CThostFtdcTraderSpi
  25. {
  26. public:
  27. ///当客户端与交易后台建立起通信连接时(还未登录前),该方法被调用。
  28. virtual void OnFrontConnected(){};
  29. ///当客户端与交易后台通信连接断开时,该方法被调用。当发生这个情况后,API会自动重新连接,客户端可不做处理。
  30. ///@param nReason 错误原因
  31. /// 0x1001 网络读失败
  32. /// 0x1002 网络写失败
  33. /// 0x2001 接收心跳超时
  34. /// 0x2002 发送心跳失败
  35. /// 0x2003 收到错误报文
  36. virtual void OnFrontDisconnected(int nReason){};
  37. ///心跳超时警告。当长时间未收到报文时,该方法被调用。
  38. ///@param nTimeLapse 距离上次接收报文的时间
  39. virtual void OnHeartBeatWarning(int nTimeLapse){};
  40. ///客户端认证响应
  41. virtual void OnRspAuthenticate(CThostFtdcRspAuthenticateField *pRspAuthenticateField, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  42. ///登录请求响应
  43. virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  44. ///登出请求响应
  45. virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  46. ///用户口令更新请求响应
  47. virtual void OnRspUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  48. ///资金账户口令更新请求响应
  49. virtual void OnRspTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  50. ///报单录入请求响应
  51. virtual void OnRspOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  52. ///预埋单录入请求响应
  53. virtual void OnRspParkedOrderInsert(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  54. ///预埋撤单录入请求响应
  55. virtual void OnRspParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  56. ///报单操作请求响应
  57. virtual void OnRspOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  58. ///查询最大报单数量响应
  59. virtual void OnRspQueryMaxOrderVolume(CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  60. ///投资者结算结果确认响应
  61. virtual void OnRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  62. ///删除预埋单响应
  63. virtual void OnRspRemoveParkedOrder(CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  64. ///删除预埋撤单响应
  65. virtual void OnRspRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  66. ///请求查询报单响应
  67. virtual void OnRspQryOrder(CThostFtdcOrderField *pOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  68. ///请求查询成交响应
  69. virtual void OnRspQryTrade(CThostFtdcTradeField *pTrade, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  70. ///请求查询投资者持仓响应
  71. virtual void OnRspQryInvestorPosition(CThostFtdcInvestorPositionField *pInvestorPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  72. ///请求查询资金账户响应
  73. virtual void OnRspQryTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  74. ///请求查询投资者响应
  75. virtual void OnRspQryInvestor(CThostFtdcInvestorField *pInvestor, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  76. ///请求查询交易编码响应
  77. virtual void OnRspQryTradingCode(CThostFtdcTradingCodeField *pTradingCode, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  78. ///请求查询合约保证金率响应
  79. virtual void OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField *pInstrumentMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  80. ///请求查询合约手续费率响应
  81. virtual void OnRspQryInstrumentCommissionRate(CThostFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  82. ///请求查询交易所响应
  83. virtual void OnRspQryExchange(CThostFtdcExchangeField *pExchange, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  84. ///请求查询产品响应
  85. virtual void OnRspQryProduct(CThostFtdcProductField *pProduct, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  86. ///请求查询合约响应
  87. virtual void OnRspQryInstrument(CThostFtdcInstrumentField *pInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  88. ///请求查询行情响应
  89. virtual void OnRspQryDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  90. ///请求查询投资者结算结果响应
  91. virtual void OnRspQrySettlementInfo(CThostFtdcSettlementInfoField *pSettlementInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  92. ///请求查询转帐银行响应
  93. virtual void OnRspQryTransferBank(CThostFtdcTransferBankField *pTransferBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  94. ///请求查询投资者持仓明细响应
  95. virtual void OnRspQryInvestorPositionDetail(CThostFtdcInvestorPositionDetailField *pInvestorPositionDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  96. ///请求查询客户通知响应
  97. virtual void OnRspQryNotice(CThostFtdcNoticeField *pNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  98. ///请求查询结算信息确认响应
  99. virtual void OnRspQrySettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  100. ///请求查询投资者持仓明细响应
  101. virtual void OnRspQryInvestorPositionCombineDetail(CThostFtdcInvestorPositionCombineDetailField *pInvestorPositionCombineDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  102. ///查询保证金监管系统经纪公司资金账户密钥响应
  103. virtual void OnRspQryCFMMCTradingAccountKey(CThostFtdcCFMMCTradingAccountKeyField *pCFMMCTradingAccountKey, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  104. ///请求查询仓单折抵信息响应
  105. virtual void OnRspQryEWarrantOffset(CThostFtdcEWarrantOffsetField *pEWarrantOffset, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  106. ///请求查询投资者品种/跨品种保证金响应
  107. virtual void OnRspQryInvestorProductGroupMargin(CThostFtdcInvestorProductGroupMarginField *pInvestorProductGroupMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  108. ///请求查询交易所保证金率响应
  109. virtual void OnRspQryExchangeMarginRate(CThostFtdcExchangeMarginRateField *pExchangeMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  110. ///请求查询交易所调整保证金率响应
  111. virtual void OnRspQryExchangeMarginRateAdjust(CThostFtdcExchangeMarginRateAdjustField *pExchangeMarginRateAdjust, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  112. ///请求查询汇率响应
  113. virtual void OnRspQryExchangeRate(CThostFtdcExchangeRateField *pExchangeRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  114. ///请求查询二级代理操作员银期权限响应
  115. virtual void OnRspQrySecAgentACIDMap(CThostFtdcSecAgentACIDMapField *pSecAgentACIDMap, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  116. ///请求查询转帐流水响应
  117. virtual void OnRspQryTransferSerial(CThostFtdcTransferSerialField *pTransferSerial, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  118. ///请求查询银期签约关系响应
  119. virtual void OnRspQryAccountregister(CThostFtdcAccountregisterField *pAccountregister, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  120. ///错误应答
  121. virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  122. ///报单通知
  123. virtual void OnRtnOrder(CThostFtdcOrderField *pOrder) {};
  124. ///成交通知
  125. virtual void OnRtnTrade(CThostFtdcTradeField *pTrade) {};
  126. ///报单录入错误回报
  127. virtual void OnErrRtnOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo) {};
  128. ///报单操作错误回报
  129. virtual void OnErrRtnOrderAction(CThostFtdcOrderActionField *pOrderAction, CThostFtdcRspInfoField *pRspInfo) {};
  130. ///合约交易状态通知
  131. virtual void OnRtnInstrumentStatus(CThostFtdcInstrumentStatusField *pInstrumentStatus) {};
  132. ///交易通知
  133. virtual void OnRtnTradingNotice(CThostFtdcTradingNoticeInfoField *pTradingNoticeInfo) {};
  134. ///提示条件单校验错误
  135. virtual void OnRtnErrorConditionalOrder(CThostFtdcErrorConditionalOrderField *pErrorConditionalOrder) {};
  136. ///请求查询签约银行响应
  137. virtual void OnRspQryContractBank(CThostFtdcContractBankField *pContractBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  138. ///请求查询预埋单响应
  139. virtual void OnRspQryParkedOrder(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  140. ///请求查询预埋撤单响应
  141. virtual void OnRspQryParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  142. ///请求查询交易通知响应
  143. virtual void OnRspQryTradingNotice(CThostFtdcTradingNoticeField *pTradingNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  144. ///请求查询经纪公司交易参数响应
  145. virtual void OnRspQryBrokerTradingParams(CThostFtdcBrokerTradingParamsField *pBrokerTradingParams, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  146. ///请求查询经纪公司交易算法响应
  147. virtual void OnRspQryBrokerTradingAlgos(CThostFtdcBrokerTradingAlgosField *pBrokerTradingAlgos, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  148. ///银行发起银行资金转期货通知
  149. virtual void OnRtnFromBankToFutureByBank(CThostFtdcRspTransferField *pRspTransfer) {};
  150. ///银行发起期货资金转银行通知
  151. virtual void OnRtnFromFutureToBankByBank(CThostFtdcRspTransferField *pRspTransfer) {};
  152. ///银行发起冲正银行转期货通知
  153. virtual void OnRtnRepealFromBankToFutureByBank(CThostFtdcRspRepealField *pRspRepeal) {};
  154. ///银行发起冲正期货转银行通知
  155. virtual void OnRtnRepealFromFutureToBankByBank(CThostFtdcRspRepealField *pRspRepeal) {};
  156. ///期货发起银行资金转期货通知
  157. virtual void OnRtnFromBankToFutureByFuture(CThostFtdcRspTransferField *pRspTransfer) {};
  158. ///期货发起期货资金转银行通知
  159. virtual void OnRtnFromFutureToBankByFuture(CThostFtdcRspTransferField *pRspTransfer) {};
  160. ///系统运行时期货端手工发起冲正银行转期货请求,银行处理完毕后报盘发回的通知
  161. virtual void OnRtnRepealFromBankToFutureByFutureManual(CThostFtdcRspRepealField *pRspRepeal) {};
  162. ///系统运行时期货端手工发起冲正期货转银行请求,银行处理完毕后报盘发回的通知
  163. virtual void OnRtnRepealFromFutureToBankByFutureManual(CThostFtdcRspRepealField *pRspRepeal) {};
  164. ///期货发起查询银行余额通知
  165. virtual void OnRtnQueryBankBalanceByFuture(CThostFtdcNotifyQueryAccountField *pNotifyQueryAccount) {};
  166. ///期货发起银行资金转期货错误回报
  167. virtual void OnErrRtnBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) {};
  168. ///期货发起期货资金转银行错误回报
  169. virtual void OnErrRtnFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) {};
  170. ///系统运行时期货端手工发起冲正银行转期货错误回报
  171. virtual void OnErrRtnRepealBankToFutureByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) {};
  172. ///系统运行时期货端手工发起冲正期货转银行错误回报
  173. virtual void OnErrRtnRepealFutureToBankByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) {};
  174. ///期货发起查询银行余额错误回报
  175. virtual void OnErrRtnQueryBankBalanceByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo) {};
  176. ///期货发起冲正银行转期货请求,银行处理完毕后报盘发回的通知
  177. virtual void OnRtnRepealFromBankToFutureByFuture(CThostFtdcRspRepealField *pRspRepeal) {};
  178. ///期货发起冲正期货转银行请求,银行处理完毕后报盘发回的通知
  179. virtual void OnRtnRepealFromFutureToBankByFuture(CThostFtdcRspRepealField *pRspRepeal) {};
  180. ///期货发起银行资金转期货应答
  181. virtual void OnRspFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  182. ///期货发起期货资金转银行应答
  183. virtual void OnRspFromFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  184. ///期货发起查询银行余额应答
  185. virtual void OnRspQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
  186. ///银行发起银期开户通知
  187. virtual void OnRtnOpenAccountByBank(CThostFtdcOpenAccountField *pOpenAccount) {};
  188. ///银行发起银期销户通知
  189. virtual void OnRtnCancelAccountByBank(CThostFtdcCancelAccountField *pCancelAccount) {};
  190. ///银行发起变更银行账号通知
  191. virtual void OnRtnChangeAccountByBank(CThostFtdcChangeAccountField *pChangeAccount) {};
  192. };
  193. class TRADER_API_EXPORT CThostFtdcTraderApi
  194. {
  195. public:
  196. ///创建TraderApi
  197. ///@param pszFlowPath 存贮订阅信息文件的目录,默认为当前目录
  198. ///@return 创建出的UserApi
  199. static CThostFtdcTraderApi *CreateFtdcTraderApi(const char *pszFlowPath = "");
  200. ///删除接口对象本身
  201. ///@remark 不再使用本接口对象时,调用该函数删除接口对象
  202. virtual void Release() = 0;
  203. ///初始化
  204. ///@remark 初始化运行环境,只有调用后,接口才开始工作
  205. virtual void Init() = 0;
  206. ///等待接口线程结束运行
  207. ///@return 线程退出代码
  208. virtual int Join() = 0;
  209. ///获取当前交易日
  210. ///@retrun 获取到的交易日
  211. ///@remark 只有登录成功后,才能得到正确的交易日
  212. virtual const char *GetTradingDay() = 0;
  213. ///注册前置机网络地址
  214. ///@param pszFrontAddress:前置机网络地址。
  215. ///@remark 网络地址的格式为:“protocol://ipaddress:port”,如:”tcp://127.0.0.1:17001”。
  216. ///@remark “tcp”代表传输协议,“127.0.0.1”代表服务器地址。”17001”代表服务器端口号。
  217. virtual void RegisterFront(char *pszFrontAddress) = 0;
  218. ///注册名字服务器网络地址
  219. ///@param pszNsAddress:名字服务器网络地址。
  220. ///@remark 网络地址的格式为:“protocol://ipaddress:port”,如:”tcp://127.0.0.1:12001”。
  221. ///@remark “tcp”代表传输协议,“127.0.0.1”代表服务器地址。”12001”代表服务器端口号。
  222. ///@remark RegisterNameServer优先于RegisterFront
  223. virtual void RegisterNameServer(char *pszNsAddress) = 0;
  224. ///注册名字服务器用户信息
  225. ///@param pFensUserInfo:用户信息。
  226. virtual void RegisterFensUserInfo(CThostFtdcFensUserInfoField * pFensUserInfo) = 0;
  227. ///注册回调接口
  228. ///@param pSpi 派生自回调接口类的实例
  229. virtual void RegisterSpi(CThostFtdcTraderSpi *pSpi) = 0;
  230. ///订阅私有流。
  231. ///@param nResumeType 私有流重传方式
  232. /// THOST_TERT_RESTART:从本交易日开始重传
  233. /// THOST_TERT_RESUME:从上次收到的续传
  234. /// THOST_TERT_QUICK:只传送登录后私有流的内容
  235. ///@remark 该方法要在Init方法前调用。若不调用则不会收到私有流的数据。
  236. virtual void SubscribePrivateTopic(THOST_TE_RESUME_TYPE nResumeType) = 0;
  237. ///订阅公共流。
  238. ///@param nResumeType 公共流重传方式
  239. /// THOST_TERT_RESTART:从本交易日开始重传
  240. /// THOST_TERT_RESUME:从上次收到的续传
  241. /// THOST_TERT_QUICK:只传送登录后公共流的内容
  242. ///@remark 该方法要在Init方法前调用。若不调用则不会收到公共流的数据。
  243. virtual void SubscribePublicTopic(THOST_TE_RESUME_TYPE nResumeType) = 0;
  244. ///客户端认证请求
  245. virtual int ReqAuthenticate(CThostFtdcReqAuthenticateField *pReqAuthenticateField, int nRequestID) = 0;
  246. ///用户登录请求
  247. virtual int ReqUserLogin(CThostFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0;
  248. ///登出请求
  249. virtual int ReqUserLogout(CThostFtdcUserLogoutField *pUserLogout, int nRequestID) = 0;
  250. ///用户口令更新请求
  251. virtual int ReqUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, int nRequestID) = 0;
  252. ///资金账户口令更新请求
  253. virtual int ReqTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, int nRequestID) = 0;
  254. ///报单录入请求
  255. virtual int ReqOrderInsert(CThostFtdcInputOrderField *pInputOrder, int nRequestID) = 0;
  256. ///预埋单录入请求
  257. virtual int ReqParkedOrderInsert(CThostFtdcParkedOrderField *pParkedOrder, int nRequestID) = 0;
  258. ///预埋撤单录入请求
  259. virtual int ReqParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, int nRequestID) = 0;
  260. ///报单操作请求
  261. virtual int ReqOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, int nRequestID) = 0;
  262. ///查询最大报单数量请求
  263. virtual int ReqQueryMaxOrderVolume(CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume, int nRequestID) = 0;
  264. ///投资者结算结果确认
  265. virtual int ReqSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, int nRequestID) = 0;
  266. ///请求删除预埋单
  267. virtual int ReqRemoveParkedOrder(CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder, int nRequestID) = 0;
  268. ///请求删除预埋撤单
  269. virtual int ReqRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction, int nRequestID) = 0;
  270. ///请求查询报单
  271. virtual int ReqQryOrder(CThostFtdcQryOrderField *pQryOrder, int nRequestID) = 0;
  272. ///请求查询成交
  273. virtual int ReqQryTrade(CThostFtdcQryTradeField *pQryTrade, int nRequestID) = 0;
  274. ///请求查询投资者持仓
  275. virtual int ReqQryInvestorPosition(CThostFtdcQryInvestorPositionField *pQryInvestorPosition, int nRequestID) = 0;
  276. ///请求查询资金账户
  277. virtual int ReqQryTradingAccount(CThostFtdcQryTradingAccountField *pQryTradingAccount, int nRequestID) = 0;
  278. ///请求查询投资者
  279. virtual int ReqQryInvestor(CThostFtdcQryInvestorField *pQryInvestor, int nRequestID) = 0;
  280. ///请求查询交易编码
  281. virtual int ReqQryTradingCode(CThostFtdcQryTradingCodeField *pQryTradingCode, int nRequestID) = 0;
  282. ///请求查询合约保证金率
  283. virtual int ReqQryInstrumentMarginRate(CThostFtdcQryInstrumentMarginRateField *pQryInstrumentMarginRate, int nRequestID) = 0;
  284. ///请求查询合约手续费率
  285. virtual int ReqQryInstrumentCommissionRate(CThostFtdcQryInstrumentCommissionRateField *pQryInstrumentCommissionRate, int nRequestID) = 0;
  286. ///请求查询交易所
  287. virtual int ReqQryExchange(CThostFtdcQryExchangeField *pQryExchange, int nRequestID) = 0;
  288. ///请求查询产品
  289. virtual int ReqQryProduct(CThostFtdcQryProductField *pQryProduct, int nRequestID) = 0;
  290. ///请求查询合约
  291. virtual int ReqQryInstrument(CThostFtdcQryInstrumentField *pQryInstrument, int nRequestID) = 0;
  292. ///请求查询行情
  293. virtual int ReqQryDepthMarketData(CThostFtdcQryDepthMarketDataField *pQryDepthMarketData, int nRequestID) = 0;
  294. ///请求查询投资者结算结果
  295. virtual int ReqQrySettlementInfo(CThostFtdcQrySettlementInfoField *pQrySettlementInfo, int nRequestID) = 0;
  296. ///请求查询转帐银行
  297. virtual int ReqQryTransferBank(CThostFtdcQryTransferBankField *pQryTransferBank, int nRequestID) = 0;
  298. ///请求查询投资者持仓明细
  299. virtual int ReqQryInvestorPositionDetail(CThostFtdcQryInvestorPositionDetailField *pQryInvestorPositionDetail, int nRequestID) = 0;
  300. ///请求查询客户通知
  301. virtual int ReqQryNotice(CThostFtdcQryNoticeField *pQryNotice, int nRequestID) = 0;
  302. ///请求查询结算信息确认
  303. virtual int ReqQrySettlementInfoConfirm(CThostFtdcQrySettlementInfoConfirmField *pQrySettlementInfoConfirm, int nRequestID) = 0;
  304. ///请求查询投资者持仓明细
  305. virtual int ReqQryInvestorPositionCombineDetail(CThostFtdcQryInvestorPositionCombineDetailField *pQryInvestorPositionCombineDetail, int nRequestID) = 0;
  306. ///请求查询保证金监管系统经纪公司资金账户密钥
  307. virtual int ReqQryCFMMCTradingAccountKey(CThostFtdcQryCFMMCTradingAccountKeyField *pQryCFMMCTradingAccountKey, int nRequestID) = 0;
  308. ///请求查询仓单折抵信息
  309. virtual int ReqQryEWarrantOffset(CThostFtdcQryEWarrantOffsetField *pQryEWarrantOffset, int nRequestID) = 0;
  310. ///请求查询投资者品种/跨品种保证金
  311. virtual int ReqQryInvestorProductGroupMargin(CThostFtdcQryInvestorProductGroupMarginField *pQryInvestorProductGroupMargin, int nRequestID) = 0;
  312. ///请求查询交易所保证金率
  313. virtual int ReqQryExchangeMarginRate(CThostFtdcQryExchangeMarginRateField *pQryExchangeMarginRate, int nRequestID) = 0;
  314. ///请求查询交易所调整保证金率
  315. virtual int ReqQryExchangeMarginRateAdjust(CThostFtdcQryExchangeMarginRateAdjustField *pQryExchangeMarginRateAdjust, int nRequestID) = 0;
  316. ///请求查询汇率
  317. virtual int ReqQryExchangeRate(CThostFtdcQryExchangeRateField *pQryExchangeRate, int nRequestID) = 0;
  318. ///请求查询二级代理操作员银期权限
  319. virtual int ReqQrySecAgentACIDMap(CThostFtdcQrySecAgentACIDMapField *pQrySecAgentACIDMap, int nRequestID) = 0;
  320. ///请求查询转帐流水
  321. virtual int ReqQryTransferSerial(CThostFtdcQryTransferSerialField *pQryTransferSerial, int nRequestID) = 0;
  322. ///请求查询银期签约关系
  323. virtual int ReqQryAccountregister(CThostFtdcQryAccountregisterField *pQryAccountregister, int nRequestID) = 0;
  324. ///请求查询签约银行
  325. virtual int ReqQryContractBank(CThostFtdcQryContractBankField *pQryContractBank, int nRequestID) = 0;
  326. ///请求查询预埋单
  327. virtual int ReqQryParkedOrder(CThostFtdcQryParkedOrderField *pQryParkedOrder, int nRequestID) = 0;
  328. ///请求查询预埋撤单
  329. virtual int ReqQryParkedOrderAction(CThostFtdcQryParkedOrderActionField *pQryParkedOrderAction, int nRequestID) = 0;
  330. ///请求查询交易通知
  331. virtual int ReqQryTradingNotice(CThostFtdcQryTradingNoticeField *pQryTradingNotice, int nRequestID) = 0;
  332. ///请求查询经纪公司交易参数
  333. virtual int ReqQryBrokerTradingParams(CThostFtdcQryBrokerTradingParamsField *pQryBrokerTradingParams, int nRequestID) = 0;
  334. ///请求查询经纪公司交易算法
  335. virtual int ReqQryBrokerTradingAlgos(CThostFtdcQryBrokerTradingAlgosField *pQryBrokerTradingAlgos, int nRequestID) = 0;
  336. ///期货发起银行资金转期货请求
  337. virtual int ReqFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, int nRequestID) = 0;
  338. ///期货发起期货资金转银行请求
  339. virtual int ReqFromFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, int nRequestID) = 0;
  340. ///期货发起查询银行余额请求
  341. virtual int ReqQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, int nRequestID) = 0;
  342. protected:
  343. ~CThostFtdcTraderApi(){};
  344. };
  345. #endif