#ifndef CTraderSpi_H
#define CTraderSpi_H

#include "ThostFtdcTraderApi.h"


#include "MyTools.h"

//声明静态函数，并没有实现，在Cython中实现，以实现回调 python 代码
//目的就是解决 C 回调 python 代码，才能实现在python中实现编写业务逻辑





static inline int TraderSpi_OnFrontConnected(PyObject *);

static inline int TraderSpi_OnFrontDisconnected(PyObject *, int);

static inline int TraderSpi_OnHeartBeatWarning(PyObject *, int);

static inline int TraderSpi_OnRspAuthenticate(PyObject *, CThostFtdcRspAuthenticateField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspUserLogin(PyObject *, CThostFtdcRspUserLoginField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspUserLogout(PyObject *, CThostFtdcUserLogoutField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspUserPasswordUpdate(PyObject *, CThostFtdcUserPasswordUpdateField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspTradingAccountPasswordUpdate(PyObject *, CThostFtdcTradingAccountPasswordUpdateField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspOrderInsert(PyObject *, CThostFtdcInputOrderField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspParkedOrderInsert(PyObject *, CThostFtdcParkedOrderField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspParkedOrderAction(PyObject *, CThostFtdcParkedOrderActionField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspOrderAction(PyObject *, CThostFtdcInputOrderActionField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQueryMaxOrderVolume(PyObject *, CThostFtdcQueryMaxOrderVolumeField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspSettlementInfoConfirm(PyObject *, CThostFtdcSettlementInfoConfirmField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspRemoveParkedOrder(PyObject *, CThostFtdcRemoveParkedOrderField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspRemoveParkedOrderAction(PyObject *, CThostFtdcRemoveParkedOrderActionField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspExecOrderInsert(PyObject *, CThostFtdcInputExecOrderField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspExecOrderAction(PyObject *, CThostFtdcInputExecOrderActionField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspForQuoteInsert(PyObject *, CThostFtdcInputForQuoteField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQuoteInsert(PyObject *, CThostFtdcInputQuoteField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQuoteAction(PyObject *, CThostFtdcInputQuoteActionField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspBatchOrderAction(PyObject *, CThostFtdcInputBatchOrderActionField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspOptionSelfCloseInsert(PyObject *, CThostFtdcInputOptionSelfCloseField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspOptionSelfCloseAction(PyObject *, CThostFtdcInputOptionSelfCloseActionField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspCombActionInsert(PyObject *, CThostFtdcInputCombActionField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryOrder(PyObject *, CThostFtdcOrderField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryTrade(PyObject *, CThostFtdcTradeField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryInvestorPosition(PyObject *, CThostFtdcInvestorPositionField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryTradingAccount(PyObject *, CThostFtdcTradingAccountField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryInvestor(PyObject *, CThostFtdcInvestorField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryTradingCode(PyObject *, CThostFtdcTradingCodeField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryInstrumentMarginRate(PyObject *, CThostFtdcInstrumentMarginRateField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryInstrumentCommissionRate(PyObject *, CThostFtdcInstrumentCommissionRateField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryExchange(PyObject *, CThostFtdcExchangeField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryProduct(PyObject *, CThostFtdcProductField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryInstrument(PyObject *, CThostFtdcInstrumentField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryDepthMarketData(PyObject *, CThostFtdcDepthMarketDataField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQrySettlementInfo(PyObject *, CThostFtdcSettlementInfoField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryTransferBank(PyObject *, CThostFtdcTransferBankField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryInvestorPositionDetail(PyObject *, CThostFtdcInvestorPositionDetailField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryNotice(PyObject *, CThostFtdcNoticeField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQrySettlementInfoConfirm(PyObject *, CThostFtdcSettlementInfoConfirmField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryInvestorPositionCombineDetail(PyObject *, CThostFtdcInvestorPositionCombineDetailField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryCFMMCTradingAccountKey(PyObject *, CThostFtdcCFMMCTradingAccountKeyField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryEWarrantOffset(PyObject *, CThostFtdcEWarrantOffsetField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryInvestorProductGroupMargin(PyObject *, CThostFtdcInvestorProductGroupMarginField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryExchangeMarginRate(PyObject *, CThostFtdcExchangeMarginRateField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryExchangeMarginRateAdjust(PyObject *, CThostFtdcExchangeMarginRateAdjustField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryExchangeRate(PyObject *, CThostFtdcExchangeRateField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQrySecAgentACIDMap(PyObject *, CThostFtdcSecAgentACIDMapField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryProductExchRate(PyObject *, CThostFtdcProductExchRateField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryProductGroup(PyObject *, CThostFtdcProductGroupField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryMMInstrumentCommissionRate(PyObject *, CThostFtdcMMInstrumentCommissionRateField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryMMOptionInstrCommRate(PyObject *, CThostFtdcMMOptionInstrCommRateField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryInstrumentOrderCommRate(PyObject *, CThostFtdcInstrumentOrderCommRateField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQrySecAgentTradingAccount(PyObject *, CThostFtdcTradingAccountField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQrySecAgentCheckMode(PyObject *, CThostFtdcSecAgentCheckModeField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryOptionInstrTradeCost(PyObject *, CThostFtdcOptionInstrTradeCostField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryOptionInstrCommRate(PyObject *, CThostFtdcOptionInstrCommRateField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryExecOrder(PyObject *, CThostFtdcExecOrderField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryForQuote(PyObject *, CThostFtdcForQuoteField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryQuote(PyObject *, CThostFtdcQuoteField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryOptionSelfClose(PyObject *, CThostFtdcOptionSelfCloseField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryInvestUnit(PyObject *, CThostFtdcInvestUnitField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryCombInstrumentGuard(PyObject *, CThostFtdcCombInstrumentGuardField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryCombAction(PyObject *, CThostFtdcCombActionField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryTransferSerial(PyObject *, CThostFtdcTransferSerialField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryAccountregister(PyObject *, CThostFtdcAccountregisterField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspError(PyObject *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRtnOrder(PyObject *, CThostFtdcOrderField *);

static inline int TraderSpi_OnRtnTrade(PyObject *, CThostFtdcTradeField *);

static inline int TraderSpi_OnErrRtnOrderInsert(PyObject *, CThostFtdcInputOrderField *, CThostFtdcRspInfoField *);

static inline int TraderSpi_OnErrRtnOrderAction(PyObject *, CThostFtdcOrderActionField *, CThostFtdcRspInfoField *);

static inline int TraderSpi_OnRtnInstrumentStatus(PyObject *, CThostFtdcInstrumentStatusField *);

static inline int TraderSpi_OnRtnBulletin(PyObject *, CThostFtdcBulletinField *);

static inline int TraderSpi_OnRtnTradingNotice(PyObject *, CThostFtdcTradingNoticeInfoField *);

static inline int TraderSpi_OnRtnErrorConditionalOrder(PyObject *, CThostFtdcErrorConditionalOrderField *);

static inline int TraderSpi_OnRtnExecOrder(PyObject *, CThostFtdcExecOrderField *);

static inline int TraderSpi_OnErrRtnExecOrderInsert(PyObject *, CThostFtdcInputExecOrderField *, CThostFtdcRspInfoField *);

static inline int TraderSpi_OnErrRtnExecOrderAction(PyObject *, CThostFtdcExecOrderActionField *, CThostFtdcRspInfoField *);

static inline int TraderSpi_OnErrRtnForQuoteInsert(PyObject *, CThostFtdcInputForQuoteField *, CThostFtdcRspInfoField *);

static inline int TraderSpi_OnRtnQuote(PyObject *, CThostFtdcQuoteField *);

static inline int TraderSpi_OnErrRtnQuoteInsert(PyObject *, CThostFtdcInputQuoteField *, CThostFtdcRspInfoField *);

static inline int TraderSpi_OnErrRtnQuoteAction(PyObject *, CThostFtdcQuoteActionField *, CThostFtdcRspInfoField *);

static inline int TraderSpi_OnRtnForQuoteRsp(PyObject *, CThostFtdcForQuoteRspField *);

static inline int TraderSpi_OnRtnCFMMCTradingAccountToken(PyObject *, CThostFtdcCFMMCTradingAccountTokenField *);

static inline int TraderSpi_OnErrRtnBatchOrderAction(PyObject *, CThostFtdcBatchOrderActionField *, CThostFtdcRspInfoField *);

static inline int TraderSpi_OnRtnOptionSelfClose(PyObject *, CThostFtdcOptionSelfCloseField *);

static inline int TraderSpi_OnErrRtnOptionSelfCloseInsert(PyObject *, CThostFtdcInputOptionSelfCloseField *, CThostFtdcRspInfoField *);

static inline int TraderSpi_OnErrRtnOptionSelfCloseAction(PyObject *, CThostFtdcOptionSelfCloseActionField *, CThostFtdcRspInfoField *);

static inline int TraderSpi_OnRtnCombAction(PyObject *, CThostFtdcCombActionField *);

static inline int TraderSpi_OnErrRtnCombActionInsert(PyObject *, CThostFtdcInputCombActionField *, CThostFtdcRspInfoField *);

static inline int TraderSpi_OnRspQryContractBank(PyObject *, CThostFtdcContractBankField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryParkedOrder(PyObject *, CThostFtdcParkedOrderField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryParkedOrderAction(PyObject *, CThostFtdcParkedOrderActionField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryTradingNotice(PyObject *, CThostFtdcTradingNoticeField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryBrokerTradingParams(PyObject *, CThostFtdcBrokerTradingParamsField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQryBrokerTradingAlgos(PyObject *, CThostFtdcBrokerTradingAlgosField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQueryCFMMCTradingAccountToken(PyObject *, CThostFtdcQueryCFMMCTradingAccountTokenField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRtnFromBankToFutureByBank(PyObject *, CThostFtdcRspTransferField *);

static inline int TraderSpi_OnRtnFromFutureToBankByBank(PyObject *, CThostFtdcRspTransferField *);

static inline int TraderSpi_OnRtnRepealFromBankToFutureByBank(PyObject *, CThostFtdcRspRepealField *);

static inline int TraderSpi_OnRtnRepealFromFutureToBankByBank(PyObject *, CThostFtdcRspRepealField *);

static inline int TraderSpi_OnRtnFromBankToFutureByFuture(PyObject *, CThostFtdcRspTransferField *);

static inline int TraderSpi_OnRtnFromFutureToBankByFuture(PyObject *, CThostFtdcRspTransferField *);

static inline int TraderSpi_OnRtnRepealFromBankToFutureByFutureManual(PyObject *, CThostFtdcRspRepealField *);

static inline int TraderSpi_OnRtnRepealFromFutureToBankByFutureManual(PyObject *, CThostFtdcRspRepealField *);

static inline int TraderSpi_OnRtnQueryBankBalanceByFuture(PyObject *, CThostFtdcNotifyQueryAccountField *);

static inline int TraderSpi_OnErrRtnBankToFutureByFuture(PyObject *, CThostFtdcReqTransferField *, CThostFtdcRspInfoField *);

static inline int TraderSpi_OnErrRtnFutureToBankByFuture(PyObject *, CThostFtdcReqTransferField *, CThostFtdcRspInfoField *);

static inline int TraderSpi_OnErrRtnRepealBankToFutureByFutureManual(PyObject *, CThostFtdcReqRepealField *, CThostFtdcRspInfoField *);

static inline int TraderSpi_OnErrRtnRepealFutureToBankByFutureManual(PyObject *, CThostFtdcReqRepealField *, CThostFtdcRspInfoField *);

static inline int TraderSpi_OnErrRtnQueryBankBalanceByFuture(PyObject *, CThostFtdcReqQueryAccountField *, CThostFtdcRspInfoField *);

static inline int TraderSpi_OnRtnRepealFromBankToFutureByFuture(PyObject *, CThostFtdcRspRepealField *);

static inline int TraderSpi_OnRtnRepealFromFutureToBankByFuture(PyObject *, CThostFtdcRspRepealField *);

static inline int TraderSpi_OnRspFromBankToFutureByFuture(PyObject *, CThostFtdcReqTransferField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspFromFutureToBankByFuture(PyObject *, CThostFtdcReqTransferField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRspQueryBankAccountMoneyByFuture(PyObject *, CThostFtdcReqQueryAccountField *, CThostFtdcRspInfoField *, int, bool);

static inline int TraderSpi_OnRtnOpenAccountByBank(PyObject *, CThostFtdcOpenAccountField *);

static inline int TraderSpi_OnRtnCancelAccountByBank(PyObject *, CThostFtdcCancelAccountField *);

static inline int TraderSpi_OnRtnChangeAccountByBank(PyObject *, CThostFtdcChangeAccountField *);

#define Python_GIL(func) \
  do { \
    PyGILState_STATE gil_state = PyGILState_Ensure(); \
    if ((func) == -1) PyErr_Print();  \
    PyGILState_Release(gil_state); \
  } while (false)

class CTraderSpi : public CThostFtdcTraderSpi{
public:

    CTraderSpi(PyObject *obj):self(obj) {};

  virtual ~CTraderSpi() {};



  ///当客户端与交易后台建立起通信连接时（还未登录前），该方法被调用。
  virtual void  OnFrontConnected() {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    TraderSpi_OnFrontConnected(self);

    printString("TraderSpiOnFrontConnected","null","null",dwTime);

  };

  ///当客户端与交易后台通信连接断开时，该方法被调用。当发生这个情况后，API会自动重新连接，客户端可不做处理。
///@param nReason 错误原因
///        0x1001 网络读失败
///        0x1002 网络写失败
///        0x2001 接收心跳超时
///        0x2002 发送心跳失败
///        0x2003 收到错误报文
  virtual void  OnFrontDisconnected(int nReason) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    TraderSpi_OnFrontDisconnected(self, nReason);

    printNumber("TraderSpiOnFrontDisconnected","nReason",nReason,dwTime);

  };

  ///心跳超时警告。当长时间未收到报文时，该方法被调用。
///@param nTimeLapse 距离上次接收报文的时间
  virtual void  OnHeartBeatWarning(int nTimeLapse) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    TraderSpi_OnHeartBeatWarning(self, nTimeLapse);

    printNumber("TraderSpiOnHeartBeatWarning","nTimeLapse",nTimeLapse,dwTime);

  };

  ///客户端认证响应
  virtual void  OnRspAuthenticate(CThostFtdcRspAuthenticateField *pRspAuthenticateField, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspAuthenticate", "Enter", dwTime);

    if (NULL==pRspAuthenticateField)
    {
      printString("pRspAuthenticateField","CThostFtdcRspAuthenticateField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pRspAuthenticateField","BrokerID",pRspAuthenticateField->BrokerID,dwTime);
      printString("pRspAuthenticateField","UserID",pRspAuthenticateField->UserID,dwTime);
      printString("pRspAuthenticateField","UserProductInfo",pRspAuthenticateField->UserProductInfo,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspAuthenticate", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspAuthenticate(self, pRspAuthenticateField, pRspInfo, nRequestID, bIsLast);

  };

  ///登录请求响应
  virtual void  OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspUserLogin", "Enter", dwTime);

    if (NULL==pRspUserLogin)
    {
      printString("pRspUserLogin","CThostFtdcRspUserLoginField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pRspUserLogin","TradingDay",pRspUserLogin->TradingDay,dwTime);
      printString("pRspUserLogin","LoginTime",pRspUserLogin->LoginTime,dwTime);
      printString("pRspUserLogin","BrokerID",pRspUserLogin->BrokerID,dwTime);
      printString("pRspUserLogin","UserID",pRspUserLogin->UserID,dwTime);
      printString("pRspUserLogin","SystemName",pRspUserLogin->SystemName,dwTime);
      printNumber("pRspUserLogin","FrontID",pRspUserLogin->FrontID,dwTime);
      printNumber("pRspUserLogin","SessionID",pRspUserLogin->SessionID,dwTime);
      printString("pRspUserLogin","MaxOrderRef",pRspUserLogin->MaxOrderRef,dwTime);
      printString("pRspUserLogin","SHFETime",pRspUserLogin->SHFETime,dwTime);
      printString("pRspUserLogin","DCETime",pRspUserLogin->DCETime,dwTime);
      printString("pRspUserLogin","CZCETime",pRspUserLogin->CZCETime,dwTime);
      printString("pRspUserLogin","FFEXTime",pRspUserLogin->FFEXTime,dwTime);
      printString("pRspUserLogin","INETime",pRspUserLogin->INETime,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspUserLogin", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspUserLogin(self, pRspUserLogin, pRspInfo, nRequestID, bIsLast);

  };

  ///登出请求响应
  virtual void  OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspUserLogout", "Enter", dwTime);

    if (NULL==pUserLogout)
    {
      printString("pUserLogout","CThostFtdcUserLogoutField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pUserLogout","BrokerID",pUserLogout->BrokerID,dwTime);
      printString("pUserLogout","UserID",pUserLogout->UserID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspUserLogout", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspUserLogout(self, pUserLogout, pRspInfo, nRequestID, bIsLast);

  };

  ///用户口令更新请求响应
  virtual void  OnRspUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspUserPasswordUpdate", "Enter", dwTime);

    if (NULL==pUserPasswordUpdate)
    {
      printString("pUserPasswordUpdate","CThostFtdcUserPasswordUpdateField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pUserPasswordUpdate","BrokerID",pUserPasswordUpdate->BrokerID,dwTime);
      printString("pUserPasswordUpdate","UserID",pUserPasswordUpdate->UserID,dwTime);
      printString("pUserPasswordUpdate","OldPassword",pUserPasswordUpdate->OldPassword,dwTime);
      printString("pUserPasswordUpdate","NewPassword",pUserPasswordUpdate->NewPassword,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspUserPasswordUpdate", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspUserPasswordUpdate(self, pUserPasswordUpdate, pRspInfo, nRequestID, bIsLast);

  };

  ///资金账户口令更新请求响应
  virtual void  OnRspTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspTradingAccountPasswordUpdate", "Enter", dwTime);

    if (NULL==pTradingAccountPasswordUpdate)
    {
      printString("pTradingAccountPasswordUpdate","CThostFtdcTradingAccountPasswordUpdateField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pTradingAccountPasswordUpdate","BrokerID",pTradingAccountPasswordUpdate->BrokerID,dwTime);
      printString("pTradingAccountPasswordUpdate","AccountID",pTradingAccountPasswordUpdate->AccountID,dwTime);
      printString("pTradingAccountPasswordUpdate","OldPassword",pTradingAccountPasswordUpdate->OldPassword,dwTime);
      printString("pTradingAccountPasswordUpdate","NewPassword",pTradingAccountPasswordUpdate->NewPassword,dwTime);
      printString("pTradingAccountPasswordUpdate","CurrencyID",pTradingAccountPasswordUpdate->CurrencyID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspTradingAccountPasswordUpdate", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspTradingAccountPasswordUpdate(self, pTradingAccountPasswordUpdate, pRspInfo, nRequestID, bIsLast);

  };

  ///报单录入请求响应
  virtual void  OnRspOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspOrderInsert", "Enter", dwTime);

    if (NULL==pInputOrder)
    {
      printString("pInputOrder","CThostFtdcInputOrderField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInputOrder","BrokerID",pInputOrder->BrokerID,dwTime);
      printString("pInputOrder","InvestorID",pInputOrder->InvestorID,dwTime);
      printString("pInputOrder","InstrumentID",pInputOrder->InstrumentID,dwTime);
      printString("pInputOrder","OrderRef",pInputOrder->OrderRef,dwTime);
      printString("pInputOrder","UserID",pInputOrder->UserID,dwTime);
      printNumber("pInputOrder","OrderPriceType",pInputOrder->OrderPriceType,dwTime);
      printNumber("pInputOrder","Direction",pInputOrder->Direction,dwTime);
      printString("pInputOrder","CombOffsetFlag",pInputOrder->CombOffsetFlag,dwTime);
      printString("pInputOrder","CombHedgeFlag",pInputOrder->CombHedgeFlag,dwTime);
      printNumber("pInputOrder","LimitPrice",pInputOrder->LimitPrice,dwTime);
      printNumber("pInputOrder","VolumeTotalOriginal",pInputOrder->VolumeTotalOriginal,dwTime);
      printNumber("pInputOrder","TimeCondition",pInputOrder->TimeCondition,dwTime);
      printString("pInputOrder","GTDDate",pInputOrder->GTDDate,dwTime);
      printNumber("pInputOrder","VolumeCondition",pInputOrder->VolumeCondition,dwTime);
      printNumber("pInputOrder","MinVolume",pInputOrder->MinVolume,dwTime);
      printNumber("pInputOrder","ContingentCondition",pInputOrder->ContingentCondition,dwTime);
      printNumber("pInputOrder","StopPrice",pInputOrder->StopPrice,dwTime);
      printNumber("pInputOrder","ForceCloseReason",pInputOrder->ForceCloseReason,dwTime);
      printNumber("pInputOrder","IsAutoSuspend",pInputOrder->IsAutoSuspend,dwTime);
      printString("pInputOrder","BusinessUnit",pInputOrder->BusinessUnit,dwTime);
      printNumber("pInputOrder","RequestID",pInputOrder->RequestID,dwTime);
      printNumber("pInputOrder","UserForceClose",pInputOrder->UserForceClose,dwTime);
      printNumber("pInputOrder","IsSwapOrder",pInputOrder->IsSwapOrder,dwTime);
      printString("pInputOrder","ExchangeID",pInputOrder->ExchangeID,dwTime);
      printString("pInputOrder","InvestUnitID",pInputOrder->InvestUnitID,dwTime);
      printString("pInputOrder","AccountID",pInputOrder->AccountID,dwTime);
      printString("pInputOrder","CurrencyID",pInputOrder->CurrencyID,dwTime);
      printString("pInputOrder","ClientID",pInputOrder->ClientID,dwTime);
      printString("pInputOrder","IPAddress",pInputOrder->IPAddress,dwTime);
      printString("pInputOrder","MacAddress",pInputOrder->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspOrderInsert", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspOrderInsert(self, pInputOrder, pRspInfo, nRequestID, bIsLast);

  };

  ///预埋单录入请求响应
  virtual void  OnRspParkedOrderInsert(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspParkedOrderInsert", "Enter", dwTime);

    if (NULL==pParkedOrder)
    {
      printString("pParkedOrder","CThostFtdcParkedOrderField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pParkedOrder","BrokerID",pParkedOrder->BrokerID,dwTime);
      printString("pParkedOrder","InvestorID",pParkedOrder->InvestorID,dwTime);
      printString("pParkedOrder","InstrumentID",pParkedOrder->InstrumentID,dwTime);
      printString("pParkedOrder","OrderRef",pParkedOrder->OrderRef,dwTime);
      printString("pParkedOrder","UserID",pParkedOrder->UserID,dwTime);
      printNumber("pParkedOrder","OrderPriceType",pParkedOrder->OrderPriceType,dwTime);
      printNumber("pParkedOrder","Direction",pParkedOrder->Direction,dwTime);
      printString("pParkedOrder","CombOffsetFlag",pParkedOrder->CombOffsetFlag,dwTime);
      printString("pParkedOrder","CombHedgeFlag",pParkedOrder->CombHedgeFlag,dwTime);
      printNumber("pParkedOrder","LimitPrice",pParkedOrder->LimitPrice,dwTime);
      printNumber("pParkedOrder","VolumeTotalOriginal",pParkedOrder->VolumeTotalOriginal,dwTime);
      printNumber("pParkedOrder","TimeCondition",pParkedOrder->TimeCondition,dwTime);
      printString("pParkedOrder","GTDDate",pParkedOrder->GTDDate,dwTime);
      printNumber("pParkedOrder","VolumeCondition",pParkedOrder->VolumeCondition,dwTime);
      printNumber("pParkedOrder","MinVolume",pParkedOrder->MinVolume,dwTime);
      printNumber("pParkedOrder","ContingentCondition",pParkedOrder->ContingentCondition,dwTime);
      printNumber("pParkedOrder","StopPrice",pParkedOrder->StopPrice,dwTime);
      printNumber("pParkedOrder","ForceCloseReason",pParkedOrder->ForceCloseReason,dwTime);
      printNumber("pParkedOrder","IsAutoSuspend",pParkedOrder->IsAutoSuspend,dwTime);
      printString("pParkedOrder","BusinessUnit",pParkedOrder->BusinessUnit,dwTime);
      printNumber("pParkedOrder","RequestID",pParkedOrder->RequestID,dwTime);
      printNumber("pParkedOrder","UserForceClose",pParkedOrder->UserForceClose,dwTime);
      printString("pParkedOrder","ExchangeID",pParkedOrder->ExchangeID,dwTime);
      printString("pParkedOrder","ParkedOrderID",pParkedOrder->ParkedOrderID,dwTime);
      printNumber("pParkedOrder","UserType",pParkedOrder->UserType,dwTime);
      printNumber("pParkedOrder","Status",pParkedOrder->Status,dwTime);
      printNumber("pParkedOrder","ErrorID",pParkedOrder->ErrorID,dwTime);
      printString("pParkedOrder","ErrorMsg",pParkedOrder->ErrorMsg,dwTime);
      printNumber("pParkedOrder","IsSwapOrder",pParkedOrder->IsSwapOrder,dwTime);
      printString("pParkedOrder","AccountID",pParkedOrder->AccountID,dwTime);
      printString("pParkedOrder","CurrencyID",pParkedOrder->CurrencyID,dwTime);
      printString("pParkedOrder","ClientID",pParkedOrder->ClientID,dwTime);
      printString("pParkedOrder","InvestUnitID",pParkedOrder->InvestUnitID,dwTime);
      printString("pParkedOrder","IPAddress",pParkedOrder->IPAddress,dwTime);
      printString("pParkedOrder","MacAddress",pParkedOrder->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspParkedOrderInsert", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspParkedOrderInsert(self, pParkedOrder, pRspInfo, nRequestID, bIsLast);

  };

  ///预埋撤单录入请求响应
  virtual void  OnRspParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspParkedOrderAction", "Enter", dwTime);

    if (NULL==pParkedOrderAction)
    {
      printString("pParkedOrderAction","CThostFtdcParkedOrderActionField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pParkedOrderAction","BrokerID",pParkedOrderAction->BrokerID,dwTime);
      printString("pParkedOrderAction","InvestorID",pParkedOrderAction->InvestorID,dwTime);
      printNumber("pParkedOrderAction","OrderActionRef",pParkedOrderAction->OrderActionRef,dwTime);
      printString("pParkedOrderAction","OrderRef",pParkedOrderAction->OrderRef,dwTime);
      printNumber("pParkedOrderAction","RequestID",pParkedOrderAction->RequestID,dwTime);
      printNumber("pParkedOrderAction","FrontID",pParkedOrderAction->FrontID,dwTime);
      printNumber("pParkedOrderAction","SessionID",pParkedOrderAction->SessionID,dwTime);
      printString("pParkedOrderAction","ExchangeID",pParkedOrderAction->ExchangeID,dwTime);
      printString("pParkedOrderAction","OrderSysID",pParkedOrderAction->OrderSysID,dwTime);
      printNumber("pParkedOrderAction","ActionFlag",pParkedOrderAction->ActionFlag,dwTime);
      printNumber("pParkedOrderAction","LimitPrice",pParkedOrderAction->LimitPrice,dwTime);
      printNumber("pParkedOrderAction","VolumeChange",pParkedOrderAction->VolumeChange,dwTime);
      printString("pParkedOrderAction","UserID",pParkedOrderAction->UserID,dwTime);
      printString("pParkedOrderAction","InstrumentID",pParkedOrderAction->InstrumentID,dwTime);
      printString("pParkedOrderAction","ParkedOrderActionID",pParkedOrderAction->ParkedOrderActionID,dwTime);
      printNumber("pParkedOrderAction","UserType",pParkedOrderAction->UserType,dwTime);
      printNumber("pParkedOrderAction","Status",pParkedOrderAction->Status,dwTime);
      printNumber("pParkedOrderAction","ErrorID",pParkedOrderAction->ErrorID,dwTime);
      printString("pParkedOrderAction","ErrorMsg",pParkedOrderAction->ErrorMsg,dwTime);
      printString("pParkedOrderAction","InvestUnitID",pParkedOrderAction->InvestUnitID,dwTime);
      printString("pParkedOrderAction","IPAddress",pParkedOrderAction->IPAddress,dwTime);
      printString("pParkedOrderAction","MacAddress",pParkedOrderAction->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspParkedOrderAction", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspParkedOrderAction(self, pParkedOrderAction, pRspInfo, nRequestID, bIsLast);

  };

  ///报单操作请求响应
  virtual void  OnRspOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspOrderAction", "Enter", dwTime);

    if (NULL==pInputOrderAction)
    {
      printString("pInputOrderAction","CThostFtdcInputOrderActionField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInputOrderAction","BrokerID",pInputOrderAction->BrokerID,dwTime);
      printString("pInputOrderAction","InvestorID",pInputOrderAction->InvestorID,dwTime);
      printNumber("pInputOrderAction","OrderActionRef",pInputOrderAction->OrderActionRef,dwTime);
      printString("pInputOrderAction","OrderRef",pInputOrderAction->OrderRef,dwTime);
      printNumber("pInputOrderAction","RequestID",pInputOrderAction->RequestID,dwTime);
      printNumber("pInputOrderAction","FrontID",pInputOrderAction->FrontID,dwTime);
      printNumber("pInputOrderAction","SessionID",pInputOrderAction->SessionID,dwTime);
      printString("pInputOrderAction","ExchangeID",pInputOrderAction->ExchangeID,dwTime);
      printString("pInputOrderAction","OrderSysID",pInputOrderAction->OrderSysID,dwTime);
      printNumber("pInputOrderAction","ActionFlag",pInputOrderAction->ActionFlag,dwTime);
      printNumber("pInputOrderAction","LimitPrice",pInputOrderAction->LimitPrice,dwTime);
      printNumber("pInputOrderAction","VolumeChange",pInputOrderAction->VolumeChange,dwTime);
      printString("pInputOrderAction","UserID",pInputOrderAction->UserID,dwTime);
      printString("pInputOrderAction","InstrumentID",pInputOrderAction->InstrumentID,dwTime);
      printString("pInputOrderAction","InvestUnitID",pInputOrderAction->InvestUnitID,dwTime);
      printString("pInputOrderAction","IPAddress",pInputOrderAction->IPAddress,dwTime);
      printString("pInputOrderAction","MacAddress",pInputOrderAction->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspOrderAction", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspOrderAction(self, pInputOrderAction, pRspInfo, nRequestID, bIsLast);

  };

  ///查询最大报单数量响应
  virtual void  OnRspQueryMaxOrderVolume(CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQueryMaxOrderVolume", "Enter", dwTime);

    if (NULL==pQueryMaxOrderVolume)
    {
      printString("pQueryMaxOrderVolume","CThostFtdcQueryMaxOrderVolumeField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pQueryMaxOrderVolume","BrokerID",pQueryMaxOrderVolume->BrokerID,dwTime);
      printString("pQueryMaxOrderVolume","InvestorID",pQueryMaxOrderVolume->InvestorID,dwTime);
      printString("pQueryMaxOrderVolume","InstrumentID",pQueryMaxOrderVolume->InstrumentID,dwTime);
      printNumber("pQueryMaxOrderVolume","Direction",pQueryMaxOrderVolume->Direction,dwTime);
      printNumber("pQueryMaxOrderVolume","OffsetFlag",pQueryMaxOrderVolume->OffsetFlag,dwTime);
      printNumber("pQueryMaxOrderVolume","HedgeFlag",pQueryMaxOrderVolume->HedgeFlag,dwTime);
      printNumber("pQueryMaxOrderVolume","MaxVolume",pQueryMaxOrderVolume->MaxVolume,dwTime);
      printString("pQueryMaxOrderVolume","ExchangeID",pQueryMaxOrderVolume->ExchangeID,dwTime);
      printString("pQueryMaxOrderVolume","InvestUnitID",pQueryMaxOrderVolume->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQueryMaxOrderVolume", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQueryMaxOrderVolume(self, pQueryMaxOrderVolume, pRspInfo, nRequestID, bIsLast);

  };

  ///投资者结算结果确认响应
  virtual void  OnRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspSettlementInfoConfirm", "Enter", dwTime);

    if (NULL==pSettlementInfoConfirm)
    {
      printString("pSettlementInfoConfirm","CThostFtdcSettlementInfoConfirmField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pSettlementInfoConfirm","BrokerID",pSettlementInfoConfirm->BrokerID,dwTime);
      printString("pSettlementInfoConfirm","InvestorID",pSettlementInfoConfirm->InvestorID,dwTime);
      printString("pSettlementInfoConfirm","ConfirmDate",pSettlementInfoConfirm->ConfirmDate,dwTime);
      printString("pSettlementInfoConfirm","ConfirmTime",pSettlementInfoConfirm->ConfirmTime,dwTime);
      printNumber("pSettlementInfoConfirm","SettlementID",pSettlementInfoConfirm->SettlementID,dwTime);
      printString("pSettlementInfoConfirm","AccountID",pSettlementInfoConfirm->AccountID,dwTime);
      printString("pSettlementInfoConfirm","CurrencyID",pSettlementInfoConfirm->CurrencyID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspSettlementInfoConfirm", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspSettlementInfoConfirm(self, pSettlementInfoConfirm, pRspInfo, nRequestID, bIsLast);

  };

  ///删除预埋单响应
  virtual void  OnRspRemoveParkedOrder(CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspRemoveParkedOrder", "Enter", dwTime);

    if (NULL==pRemoveParkedOrder)
    {
      printString("pRemoveParkedOrder","CThostFtdcRemoveParkedOrderField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pRemoveParkedOrder","BrokerID",pRemoveParkedOrder->BrokerID,dwTime);
      printString("pRemoveParkedOrder","InvestorID",pRemoveParkedOrder->InvestorID,dwTime);
      printString("pRemoveParkedOrder","ParkedOrderID",pRemoveParkedOrder->ParkedOrderID,dwTime);
      printString("pRemoveParkedOrder","InvestUnitID",pRemoveParkedOrder->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspRemoveParkedOrder", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspRemoveParkedOrder(self, pRemoveParkedOrder, pRspInfo, nRequestID, bIsLast);

  };

  ///删除预埋撤单响应
  virtual void  OnRspRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspRemoveParkedOrderAction", "Enter", dwTime);

    if (NULL==pRemoveParkedOrderAction)
    {
      printString("pRemoveParkedOrderAction","CThostFtdcRemoveParkedOrderActionField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pRemoveParkedOrderAction","BrokerID",pRemoveParkedOrderAction->BrokerID,dwTime);
      printString("pRemoveParkedOrderAction","InvestorID",pRemoveParkedOrderAction->InvestorID,dwTime);
      printString("pRemoveParkedOrderAction","ParkedOrderActionID",pRemoveParkedOrderAction->ParkedOrderActionID,dwTime);
      printString("pRemoveParkedOrderAction","InvestUnitID",pRemoveParkedOrderAction->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspRemoveParkedOrderAction", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspRemoveParkedOrderAction(self, pRemoveParkedOrderAction, pRspInfo, nRequestID, bIsLast);

  };

  ///执行宣告录入请求响应
  virtual void  OnRspExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspExecOrderInsert", "Enter", dwTime);

    if (NULL==pInputExecOrder)
    {
      printString("pInputExecOrder","CThostFtdcInputExecOrderField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInputExecOrder","BrokerID",pInputExecOrder->BrokerID,dwTime);
      printString("pInputExecOrder","InvestorID",pInputExecOrder->InvestorID,dwTime);
      printString("pInputExecOrder","InstrumentID",pInputExecOrder->InstrumentID,dwTime);
      printString("pInputExecOrder","ExecOrderRef",pInputExecOrder->ExecOrderRef,dwTime);
      printString("pInputExecOrder","UserID",pInputExecOrder->UserID,dwTime);
      printNumber("pInputExecOrder","Volume",pInputExecOrder->Volume,dwTime);
      printNumber("pInputExecOrder","RequestID",pInputExecOrder->RequestID,dwTime);
      printString("pInputExecOrder","BusinessUnit",pInputExecOrder->BusinessUnit,dwTime);
      printNumber("pInputExecOrder","OffsetFlag",pInputExecOrder->OffsetFlag,dwTime);
      printNumber("pInputExecOrder","HedgeFlag",pInputExecOrder->HedgeFlag,dwTime);
      printNumber("pInputExecOrder","ActionType",pInputExecOrder->ActionType,dwTime);
      printNumber("pInputExecOrder","PosiDirection",pInputExecOrder->PosiDirection,dwTime);
      printNumber("pInputExecOrder","ReservePositionFlag",pInputExecOrder->ReservePositionFlag,dwTime);
      printNumber("pInputExecOrder","CloseFlag",pInputExecOrder->CloseFlag,dwTime);
      printString("pInputExecOrder","ExchangeID",pInputExecOrder->ExchangeID,dwTime);
      printString("pInputExecOrder","InvestUnitID",pInputExecOrder->InvestUnitID,dwTime);
      printString("pInputExecOrder","AccountID",pInputExecOrder->AccountID,dwTime);
      printString("pInputExecOrder","CurrencyID",pInputExecOrder->CurrencyID,dwTime);
      printString("pInputExecOrder","ClientID",pInputExecOrder->ClientID,dwTime);
      printString("pInputExecOrder","IPAddress",pInputExecOrder->IPAddress,dwTime);
      printString("pInputExecOrder","MacAddress",pInputExecOrder->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspExecOrderInsert", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspExecOrderInsert(self, pInputExecOrder, pRspInfo, nRequestID, bIsLast);

  };

  ///执行宣告操作请求响应
  virtual void  OnRspExecOrderAction(CThostFtdcInputExecOrderActionField *pInputExecOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspExecOrderAction", "Enter", dwTime);

    if (NULL==pInputExecOrderAction)
    {
      printString("pInputExecOrderAction","CThostFtdcInputExecOrderActionField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInputExecOrderAction","BrokerID",pInputExecOrderAction->BrokerID,dwTime);
      printString("pInputExecOrderAction","InvestorID",pInputExecOrderAction->InvestorID,dwTime);
      printNumber("pInputExecOrderAction","ExecOrderActionRef",pInputExecOrderAction->ExecOrderActionRef,dwTime);
      printString("pInputExecOrderAction","ExecOrderRef",pInputExecOrderAction->ExecOrderRef,dwTime);
      printNumber("pInputExecOrderAction","RequestID",pInputExecOrderAction->RequestID,dwTime);
      printNumber("pInputExecOrderAction","FrontID",pInputExecOrderAction->FrontID,dwTime);
      printNumber("pInputExecOrderAction","SessionID",pInputExecOrderAction->SessionID,dwTime);
      printString("pInputExecOrderAction","ExchangeID",pInputExecOrderAction->ExchangeID,dwTime);
      printString("pInputExecOrderAction","ExecOrderSysID",pInputExecOrderAction->ExecOrderSysID,dwTime);
      printNumber("pInputExecOrderAction","ActionFlag",pInputExecOrderAction->ActionFlag,dwTime);
      printString("pInputExecOrderAction","UserID",pInputExecOrderAction->UserID,dwTime);
      printString("pInputExecOrderAction","InstrumentID",pInputExecOrderAction->InstrumentID,dwTime);
      printString("pInputExecOrderAction","InvestUnitID",pInputExecOrderAction->InvestUnitID,dwTime);
      printString("pInputExecOrderAction","IPAddress",pInputExecOrderAction->IPAddress,dwTime);
      printString("pInputExecOrderAction","MacAddress",pInputExecOrderAction->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspExecOrderAction", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspExecOrderAction(self, pInputExecOrderAction, pRspInfo, nRequestID, bIsLast);

  };

  ///询价录入请求响应
  virtual void  OnRspForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspForQuoteInsert", "Enter", dwTime);

    if (NULL==pInputForQuote)
    {
      printString("pInputForQuote","CThostFtdcInputForQuoteField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInputForQuote","BrokerID",pInputForQuote->BrokerID,dwTime);
      printString("pInputForQuote","InvestorID",pInputForQuote->InvestorID,dwTime);
      printString("pInputForQuote","InstrumentID",pInputForQuote->InstrumentID,dwTime);
      printString("pInputForQuote","ForQuoteRef",pInputForQuote->ForQuoteRef,dwTime);
      printString("pInputForQuote","UserID",pInputForQuote->UserID,dwTime);
      printString("pInputForQuote","ExchangeID",pInputForQuote->ExchangeID,dwTime);
      printString("pInputForQuote","InvestUnitID",pInputForQuote->InvestUnitID,dwTime);
      printString("pInputForQuote","IPAddress",pInputForQuote->IPAddress,dwTime);
      printString("pInputForQuote","MacAddress",pInputForQuote->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspForQuoteInsert", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspForQuoteInsert(self, pInputForQuote, pRspInfo, nRequestID, bIsLast);

  };

  ///报价录入请求响应
  virtual void  OnRspQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQuoteInsert", "Enter", dwTime);

    if (NULL==pInputQuote)
    {
      printString("pInputQuote","CThostFtdcInputQuoteField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInputQuote","BrokerID",pInputQuote->BrokerID,dwTime);
      printString("pInputQuote","InvestorID",pInputQuote->InvestorID,dwTime);
      printString("pInputQuote","InstrumentID",pInputQuote->InstrumentID,dwTime);
      printString("pInputQuote","QuoteRef",pInputQuote->QuoteRef,dwTime);
      printString("pInputQuote","UserID",pInputQuote->UserID,dwTime);
      printNumber("pInputQuote","AskPrice",pInputQuote->AskPrice,dwTime);
      printNumber("pInputQuote","BidPrice",pInputQuote->BidPrice,dwTime);
      printNumber("pInputQuote","AskVolume",pInputQuote->AskVolume,dwTime);
      printNumber("pInputQuote","BidVolume",pInputQuote->BidVolume,dwTime);
      printNumber("pInputQuote","RequestID",pInputQuote->RequestID,dwTime);
      printString("pInputQuote","BusinessUnit",pInputQuote->BusinessUnit,dwTime);
      printNumber("pInputQuote","AskOffsetFlag",pInputQuote->AskOffsetFlag,dwTime);
      printNumber("pInputQuote","BidOffsetFlag",pInputQuote->BidOffsetFlag,dwTime);
      printNumber("pInputQuote","AskHedgeFlag",pInputQuote->AskHedgeFlag,dwTime);
      printNumber("pInputQuote","BidHedgeFlag",pInputQuote->BidHedgeFlag,dwTime);
      printString("pInputQuote","AskOrderRef",pInputQuote->AskOrderRef,dwTime);
      printString("pInputQuote","BidOrderRef",pInputQuote->BidOrderRef,dwTime);
      printString("pInputQuote","ForQuoteSysID",pInputQuote->ForQuoteSysID,dwTime);
      printString("pInputQuote","ExchangeID",pInputQuote->ExchangeID,dwTime);
      printString("pInputQuote","InvestUnitID",pInputQuote->InvestUnitID,dwTime);
      printString("pInputQuote","ClientID",pInputQuote->ClientID,dwTime);
      printString("pInputQuote","IPAddress",pInputQuote->IPAddress,dwTime);
      printString("pInputQuote","MacAddress",pInputQuote->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQuoteInsert", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQuoteInsert(self, pInputQuote, pRspInfo, nRequestID, bIsLast);

  };

  ///报价操作请求响应
  virtual void  OnRspQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQuoteAction", "Enter", dwTime);

    if (NULL==pInputQuoteAction)
    {
      printString("pInputQuoteAction","CThostFtdcInputQuoteActionField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInputQuoteAction","BrokerID",pInputQuoteAction->BrokerID,dwTime);
      printString("pInputQuoteAction","InvestorID",pInputQuoteAction->InvestorID,dwTime);
      printNumber("pInputQuoteAction","QuoteActionRef",pInputQuoteAction->QuoteActionRef,dwTime);
      printString("pInputQuoteAction","QuoteRef",pInputQuoteAction->QuoteRef,dwTime);
      printNumber("pInputQuoteAction","RequestID",pInputQuoteAction->RequestID,dwTime);
      printNumber("pInputQuoteAction","FrontID",pInputQuoteAction->FrontID,dwTime);
      printNumber("pInputQuoteAction","SessionID",pInputQuoteAction->SessionID,dwTime);
      printString("pInputQuoteAction","ExchangeID",pInputQuoteAction->ExchangeID,dwTime);
      printString("pInputQuoteAction","QuoteSysID",pInputQuoteAction->QuoteSysID,dwTime);
      printNumber("pInputQuoteAction","ActionFlag",pInputQuoteAction->ActionFlag,dwTime);
      printString("pInputQuoteAction","UserID",pInputQuoteAction->UserID,dwTime);
      printString("pInputQuoteAction","InstrumentID",pInputQuoteAction->InstrumentID,dwTime);
      printString("pInputQuoteAction","InvestUnitID",pInputQuoteAction->InvestUnitID,dwTime);
      printString("pInputQuoteAction","ClientID",pInputQuoteAction->ClientID,dwTime);
      printString("pInputQuoteAction","IPAddress",pInputQuoteAction->IPAddress,dwTime);
      printString("pInputQuoteAction","MacAddress",pInputQuoteAction->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQuoteAction", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQuoteAction(self, pInputQuoteAction, pRspInfo, nRequestID, bIsLast);

  };

  ///批量报单操作请求响应
  virtual void  OnRspBatchOrderAction(CThostFtdcInputBatchOrderActionField *pInputBatchOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspBatchOrderAction", "Enter", dwTime);

    if (NULL==pInputBatchOrderAction)
    {
      printString("pInputBatchOrderAction","CThostFtdcInputBatchOrderActionField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInputBatchOrderAction","BrokerID",pInputBatchOrderAction->BrokerID,dwTime);
      printString("pInputBatchOrderAction","InvestorID",pInputBatchOrderAction->InvestorID,dwTime);
      printNumber("pInputBatchOrderAction","OrderActionRef",pInputBatchOrderAction->OrderActionRef,dwTime);
      printNumber("pInputBatchOrderAction","RequestID",pInputBatchOrderAction->RequestID,dwTime);
      printNumber("pInputBatchOrderAction","FrontID",pInputBatchOrderAction->FrontID,dwTime);
      printNumber("pInputBatchOrderAction","SessionID",pInputBatchOrderAction->SessionID,dwTime);
      printString("pInputBatchOrderAction","ExchangeID",pInputBatchOrderAction->ExchangeID,dwTime);
      printString("pInputBatchOrderAction","UserID",pInputBatchOrderAction->UserID,dwTime);
      printString("pInputBatchOrderAction","InvestUnitID",pInputBatchOrderAction->InvestUnitID,dwTime);
      printString("pInputBatchOrderAction","IPAddress",pInputBatchOrderAction->IPAddress,dwTime);
      printString("pInputBatchOrderAction","MacAddress",pInputBatchOrderAction->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspBatchOrderAction", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspBatchOrderAction(self, pInputBatchOrderAction, pRspInfo, nRequestID, bIsLast);

  };

  ///期权自对冲录入请求响应
  virtual void  OnRspOptionSelfCloseInsert(CThostFtdcInputOptionSelfCloseField *pInputOptionSelfClose, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspOptionSelfCloseInsert", "Enter", dwTime);

    if (NULL==pInputOptionSelfClose)
    {
      printString("pInputOptionSelfClose","CThostFtdcInputOptionSelfCloseField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInputOptionSelfClose","BrokerID",pInputOptionSelfClose->BrokerID,dwTime);
      printString("pInputOptionSelfClose","InvestorID",pInputOptionSelfClose->InvestorID,dwTime);
      printString("pInputOptionSelfClose","InstrumentID",pInputOptionSelfClose->InstrumentID,dwTime);
      printString("pInputOptionSelfClose","OptionSelfCloseRef",pInputOptionSelfClose->OptionSelfCloseRef,dwTime);
      printString("pInputOptionSelfClose","UserID",pInputOptionSelfClose->UserID,dwTime);
      printNumber("pInputOptionSelfClose","Volume",pInputOptionSelfClose->Volume,dwTime);
      printNumber("pInputOptionSelfClose","RequestID",pInputOptionSelfClose->RequestID,dwTime);
      printString("pInputOptionSelfClose","BusinessUnit",pInputOptionSelfClose->BusinessUnit,dwTime);
      printNumber("pInputOptionSelfClose","HedgeFlag",pInputOptionSelfClose->HedgeFlag,dwTime);
      printNumber("pInputOptionSelfClose","OptSelfCloseFlag",pInputOptionSelfClose->OptSelfCloseFlag,dwTime);
      printString("pInputOptionSelfClose","ExchangeID",pInputOptionSelfClose->ExchangeID,dwTime);
      printString("pInputOptionSelfClose","InvestUnitID",pInputOptionSelfClose->InvestUnitID,dwTime);
      printString("pInputOptionSelfClose","AccountID",pInputOptionSelfClose->AccountID,dwTime);
      printString("pInputOptionSelfClose","CurrencyID",pInputOptionSelfClose->CurrencyID,dwTime);
      printString("pInputOptionSelfClose","ClientID",pInputOptionSelfClose->ClientID,dwTime);
      printString("pInputOptionSelfClose","IPAddress",pInputOptionSelfClose->IPAddress,dwTime);
      printString("pInputOptionSelfClose","MacAddress",pInputOptionSelfClose->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspOptionSelfCloseInsert", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspOptionSelfCloseInsert(self, pInputOptionSelfClose, pRspInfo, nRequestID, bIsLast);

  };

  ///期权自对冲操作请求响应
  virtual void  OnRspOptionSelfCloseAction(CThostFtdcInputOptionSelfCloseActionField *pInputOptionSelfCloseAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspOptionSelfCloseAction", "Enter", dwTime);

    if (NULL==pInputOptionSelfCloseAction)
    {
      printString("pInputOptionSelfCloseAction","CThostFtdcInputOptionSelfCloseActionField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInputOptionSelfCloseAction","BrokerID",pInputOptionSelfCloseAction->BrokerID,dwTime);
      printString("pInputOptionSelfCloseAction","InvestorID",pInputOptionSelfCloseAction->InvestorID,dwTime);
      printNumber("pInputOptionSelfCloseAction","OptionSelfCloseActionRef",pInputOptionSelfCloseAction->OptionSelfCloseActionRef,dwTime);
      printString("pInputOptionSelfCloseAction","OptionSelfCloseRef",pInputOptionSelfCloseAction->OptionSelfCloseRef,dwTime);
      printNumber("pInputOptionSelfCloseAction","RequestID",pInputOptionSelfCloseAction->RequestID,dwTime);
      printNumber("pInputOptionSelfCloseAction","FrontID",pInputOptionSelfCloseAction->FrontID,dwTime);
      printNumber("pInputOptionSelfCloseAction","SessionID",pInputOptionSelfCloseAction->SessionID,dwTime);
      printString("pInputOptionSelfCloseAction","ExchangeID",pInputOptionSelfCloseAction->ExchangeID,dwTime);
      printString("pInputOptionSelfCloseAction","OptionSelfCloseSysID",pInputOptionSelfCloseAction->OptionSelfCloseSysID,dwTime);
      printNumber("pInputOptionSelfCloseAction","ActionFlag",pInputOptionSelfCloseAction->ActionFlag,dwTime);
      printString("pInputOptionSelfCloseAction","UserID",pInputOptionSelfCloseAction->UserID,dwTime);
      printString("pInputOptionSelfCloseAction","InstrumentID",pInputOptionSelfCloseAction->InstrumentID,dwTime);
      printString("pInputOptionSelfCloseAction","InvestUnitID",pInputOptionSelfCloseAction->InvestUnitID,dwTime);
      printString("pInputOptionSelfCloseAction","IPAddress",pInputOptionSelfCloseAction->IPAddress,dwTime);
      printString("pInputOptionSelfCloseAction","MacAddress",pInputOptionSelfCloseAction->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspOptionSelfCloseAction", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspOptionSelfCloseAction(self, pInputOptionSelfCloseAction, pRspInfo, nRequestID, bIsLast);

  };

  ///申请组合录入请求响应
  virtual void  OnRspCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspCombActionInsert", "Enter", dwTime);

    if (NULL==pInputCombAction)
    {
      printString("pInputCombAction","CThostFtdcInputCombActionField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInputCombAction","BrokerID",pInputCombAction->BrokerID,dwTime);
      printString("pInputCombAction","InvestorID",pInputCombAction->InvestorID,dwTime);
      printString("pInputCombAction","InstrumentID",pInputCombAction->InstrumentID,dwTime);
      printString("pInputCombAction","CombActionRef",pInputCombAction->CombActionRef,dwTime);
      printString("pInputCombAction","UserID",pInputCombAction->UserID,dwTime);
      printNumber("pInputCombAction","Direction",pInputCombAction->Direction,dwTime);
      printNumber("pInputCombAction","Volume",pInputCombAction->Volume,dwTime);
      printNumber("pInputCombAction","CombDirection",pInputCombAction->CombDirection,dwTime);
      printNumber("pInputCombAction","HedgeFlag",pInputCombAction->HedgeFlag,dwTime);
      printString("pInputCombAction","ExchangeID",pInputCombAction->ExchangeID,dwTime);
      printString("pInputCombAction","IPAddress",pInputCombAction->IPAddress,dwTime);
      printString("pInputCombAction","MacAddress",pInputCombAction->MacAddress,dwTime);
      printString("pInputCombAction","InvestUnitID",pInputCombAction->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspCombActionInsert", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspCombActionInsert(self, pInputCombAction, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询报单响应
  virtual void  OnRspQryOrder(CThostFtdcOrderField *pOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryOrder", "Enter", dwTime);

    if (NULL==pOrder)
    {
      printString("pOrder","CThostFtdcOrderField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pOrder","BrokerID",pOrder->BrokerID,dwTime);
      printString("pOrder","InvestorID",pOrder->InvestorID,dwTime);
      printString("pOrder","InstrumentID",pOrder->InstrumentID,dwTime);
      printString("pOrder","OrderRef",pOrder->OrderRef,dwTime);
      printString("pOrder","UserID",pOrder->UserID,dwTime);
      printNumber("pOrder","OrderPriceType",pOrder->OrderPriceType,dwTime);
      printNumber("pOrder","Direction",pOrder->Direction,dwTime);
      printString("pOrder","CombOffsetFlag",pOrder->CombOffsetFlag,dwTime);
      printString("pOrder","CombHedgeFlag",pOrder->CombHedgeFlag,dwTime);
      printNumber("pOrder","LimitPrice",pOrder->LimitPrice,dwTime);
      printNumber("pOrder","VolumeTotalOriginal",pOrder->VolumeTotalOriginal,dwTime);
      printNumber("pOrder","TimeCondition",pOrder->TimeCondition,dwTime);
      printString("pOrder","GTDDate",pOrder->GTDDate,dwTime);
      printNumber("pOrder","VolumeCondition",pOrder->VolumeCondition,dwTime);
      printNumber("pOrder","MinVolume",pOrder->MinVolume,dwTime);
      printNumber("pOrder","ContingentCondition",pOrder->ContingentCondition,dwTime);
      printNumber("pOrder","StopPrice",pOrder->StopPrice,dwTime);
      printNumber("pOrder","ForceCloseReason",pOrder->ForceCloseReason,dwTime);
      printNumber("pOrder","IsAutoSuspend",pOrder->IsAutoSuspend,dwTime);
      printString("pOrder","BusinessUnit",pOrder->BusinessUnit,dwTime);
      printNumber("pOrder","RequestID",pOrder->RequestID,dwTime);
      printString("pOrder","OrderLocalID",pOrder->OrderLocalID,dwTime);
      printString("pOrder","ExchangeID",pOrder->ExchangeID,dwTime);
      printString("pOrder","ParticipantID",pOrder->ParticipantID,dwTime);
      printString("pOrder","ClientID",pOrder->ClientID,dwTime);
      printString("pOrder","ExchangeInstID",pOrder->ExchangeInstID,dwTime);
      printString("pOrder","TraderID",pOrder->TraderID,dwTime);
      printNumber("pOrder","InstallID",pOrder->InstallID,dwTime);
      printNumber("pOrder","OrderSubmitStatus",pOrder->OrderSubmitStatus,dwTime);
      printNumber("pOrder","NotifySequence",pOrder->NotifySequence,dwTime);
      printString("pOrder","TradingDay",pOrder->TradingDay,dwTime);
      printNumber("pOrder","SettlementID",pOrder->SettlementID,dwTime);
      printString("pOrder","OrderSysID",pOrder->OrderSysID,dwTime);
      printNumber("pOrder","OrderSource",pOrder->OrderSource,dwTime);
      printNumber("pOrder","OrderStatus",pOrder->OrderStatus,dwTime);
      printNumber("pOrder","OrderType",pOrder->OrderType,dwTime);
      printNumber("pOrder","VolumeTraded",pOrder->VolumeTraded,dwTime);
      printNumber("pOrder","VolumeTotal",pOrder->VolumeTotal,dwTime);
      printString("pOrder","InsertDate",pOrder->InsertDate,dwTime);
      printString("pOrder","InsertTime",pOrder->InsertTime,dwTime);
      printString("pOrder","ActiveTime",pOrder->ActiveTime,dwTime);
      printString("pOrder","SuspendTime",pOrder->SuspendTime,dwTime);
      printString("pOrder","UpdateTime",pOrder->UpdateTime,dwTime);
      printString("pOrder","CancelTime",pOrder->CancelTime,dwTime);
      printString("pOrder","ActiveTraderID",pOrder->ActiveTraderID,dwTime);
      printString("pOrder","ClearingPartID",pOrder->ClearingPartID,dwTime);
      printNumber("pOrder","SequenceNo",pOrder->SequenceNo,dwTime);
      printNumber("pOrder","FrontID",pOrder->FrontID,dwTime);
      printNumber("pOrder","SessionID",pOrder->SessionID,dwTime);
      printString("pOrder","UserProductInfo",pOrder->UserProductInfo,dwTime);
      printString("pOrder","StatusMsg",pOrder->StatusMsg,dwTime);
      printNumber("pOrder","UserForceClose",pOrder->UserForceClose,dwTime);
      printString("pOrder","ActiveUserID",pOrder->ActiveUserID,dwTime);
      printNumber("pOrder","BrokerOrderSeq",pOrder->BrokerOrderSeq,dwTime);
      printString("pOrder","RelativeOrderSysID",pOrder->RelativeOrderSysID,dwTime);
      printNumber("pOrder","ZCETotalTradedVolume",pOrder->ZCETotalTradedVolume,dwTime);
      printNumber("pOrder","IsSwapOrder",pOrder->IsSwapOrder,dwTime);
      printString("pOrder","BranchID",pOrder->BranchID,dwTime);
      printString("pOrder","InvestUnitID",pOrder->InvestUnitID,dwTime);
      printString("pOrder","AccountID",pOrder->AccountID,dwTime);
      printString("pOrder","CurrencyID",pOrder->CurrencyID,dwTime);
      printString("pOrder","IPAddress",pOrder->IPAddress,dwTime);
      printString("pOrder","MacAddress",pOrder->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryOrder", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryOrder(self, pOrder, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询成交响应
  virtual void  OnRspQryTrade(CThostFtdcTradeField *pTrade, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryTrade", "Enter", dwTime);

    if (NULL==pTrade)
    {
      printString("pTrade","CThostFtdcTradeField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pTrade","BrokerID",pTrade->BrokerID,dwTime);
      printString("pTrade","InvestorID",pTrade->InvestorID,dwTime);
      printString("pTrade","InstrumentID",pTrade->InstrumentID,dwTime);
      printString("pTrade","OrderRef",pTrade->OrderRef,dwTime);
      printString("pTrade","UserID",pTrade->UserID,dwTime);
      printString("pTrade","ExchangeID",pTrade->ExchangeID,dwTime);
      printString("pTrade","TradeID",pTrade->TradeID,dwTime);
      printNumber("pTrade","Direction",pTrade->Direction,dwTime);
      printString("pTrade","OrderSysID",pTrade->OrderSysID,dwTime);
      printString("pTrade","ParticipantID",pTrade->ParticipantID,dwTime);
      printString("pTrade","ClientID",pTrade->ClientID,dwTime);
      printNumber("pTrade","TradingRole",pTrade->TradingRole,dwTime);
      printString("pTrade","ExchangeInstID",pTrade->ExchangeInstID,dwTime);
      printNumber("pTrade","OffsetFlag",pTrade->OffsetFlag,dwTime);
      printNumber("pTrade","HedgeFlag",pTrade->HedgeFlag,dwTime);
      printNumber("pTrade","Price",pTrade->Price,dwTime);
      printNumber("pTrade","Volume",pTrade->Volume,dwTime);
      printString("pTrade","TradeDate",pTrade->TradeDate,dwTime);
      printString("pTrade","TradeTime",pTrade->TradeTime,dwTime);
      printNumber("pTrade","TradeType",pTrade->TradeType,dwTime);
      printNumber("pTrade","PriceSource",pTrade->PriceSource,dwTime);
      printString("pTrade","TraderID",pTrade->TraderID,dwTime);
      printString("pTrade","OrderLocalID",pTrade->OrderLocalID,dwTime);
      printString("pTrade","ClearingPartID",pTrade->ClearingPartID,dwTime);
      printString("pTrade","BusinessUnit",pTrade->BusinessUnit,dwTime);
      printNumber("pTrade","SequenceNo",pTrade->SequenceNo,dwTime);
      printString("pTrade","TradingDay",pTrade->TradingDay,dwTime);
      printNumber("pTrade","SettlementID",pTrade->SettlementID,dwTime);
      printNumber("pTrade","BrokerOrderSeq",pTrade->BrokerOrderSeq,dwTime);
      printNumber("pTrade","TradeSource",pTrade->TradeSource,dwTime);
      printString("pTrade","InvestUnitID",pTrade->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryTrade", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryTrade(self, pTrade, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询投资者持仓响应
  virtual void  OnRspQryInvestorPosition(CThostFtdcInvestorPositionField *pInvestorPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryInvestorPosition", "Enter", dwTime);

    if (NULL==pInvestorPosition)
    {
      printString("pInvestorPosition","CThostFtdcInvestorPositionField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInvestorPosition","InstrumentID",pInvestorPosition->InstrumentID,dwTime);
      printString("pInvestorPosition","BrokerID",pInvestorPosition->BrokerID,dwTime);
      printString("pInvestorPosition","InvestorID",pInvestorPosition->InvestorID,dwTime);
      printNumber("pInvestorPosition","PosiDirection",pInvestorPosition->PosiDirection,dwTime);
      printNumber("pInvestorPosition","HedgeFlag",pInvestorPosition->HedgeFlag,dwTime);
      printNumber("pInvestorPosition","PositionDate",pInvestorPosition->PositionDate,dwTime);
      printNumber("pInvestorPosition","YdPosition",pInvestorPosition->YdPosition,dwTime);
      printNumber("pInvestorPosition","Position",pInvestorPosition->Position,dwTime);
      printNumber("pInvestorPosition","LongFrozen",pInvestorPosition->LongFrozen,dwTime);
      printNumber("pInvestorPosition","ShortFrozen",pInvestorPosition->ShortFrozen,dwTime);
      printNumber("pInvestorPosition","LongFrozenAmount",pInvestorPosition->LongFrozenAmount,dwTime);
      printNumber("pInvestorPosition","ShortFrozenAmount",pInvestorPosition->ShortFrozenAmount,dwTime);
      printNumber("pInvestorPosition","OpenVolume",pInvestorPosition->OpenVolume,dwTime);
      printNumber("pInvestorPosition","CloseVolume",pInvestorPosition->CloseVolume,dwTime);
      printNumber("pInvestorPosition","OpenAmount",pInvestorPosition->OpenAmount,dwTime);
      printNumber("pInvestorPosition","CloseAmount",pInvestorPosition->CloseAmount,dwTime);
      printNumber("pInvestorPosition","PositionCost",pInvestorPosition->PositionCost,dwTime);
      printNumber("pInvestorPosition","PreMargin",pInvestorPosition->PreMargin,dwTime);
      printNumber("pInvestorPosition","UseMargin",pInvestorPosition->UseMargin,dwTime);
      printNumber("pInvestorPosition","FrozenMargin",pInvestorPosition->FrozenMargin,dwTime);
      printNumber("pInvestorPosition","FrozenCash",pInvestorPosition->FrozenCash,dwTime);
      printNumber("pInvestorPosition","FrozenCommission",pInvestorPosition->FrozenCommission,dwTime);
      printNumber("pInvestorPosition","CashIn",pInvestorPosition->CashIn,dwTime);
      printNumber("pInvestorPosition","Commission",pInvestorPosition->Commission,dwTime);
      printNumber("pInvestorPosition","CloseProfit",pInvestorPosition->CloseProfit,dwTime);
      printNumber("pInvestorPosition","PositionProfit",pInvestorPosition->PositionProfit,dwTime);
      printNumber("pInvestorPosition","PreSettlementPrice",pInvestorPosition->PreSettlementPrice,dwTime);
      printNumber("pInvestorPosition","SettlementPrice",pInvestorPosition->SettlementPrice,dwTime);
      printString("pInvestorPosition","TradingDay",pInvestorPosition->TradingDay,dwTime);
      printNumber("pInvestorPosition","SettlementID",pInvestorPosition->SettlementID,dwTime);
      printNumber("pInvestorPosition","OpenCost",pInvestorPosition->OpenCost,dwTime);
      printNumber("pInvestorPosition","ExchangeMargin",pInvestorPosition->ExchangeMargin,dwTime);
      printNumber("pInvestorPosition","CombPosition",pInvestorPosition->CombPosition,dwTime);
      printNumber("pInvestorPosition","CombLongFrozen",pInvestorPosition->CombLongFrozen,dwTime);
      printNumber("pInvestorPosition","CombShortFrozen",pInvestorPosition->CombShortFrozen,dwTime);
      printNumber("pInvestorPosition","CloseProfitByDate",pInvestorPosition->CloseProfitByDate,dwTime);
      printNumber("pInvestorPosition","CloseProfitByTrade",pInvestorPosition->CloseProfitByTrade,dwTime);
      printNumber("pInvestorPosition","TodayPosition",pInvestorPosition->TodayPosition,dwTime);
      printNumber("pInvestorPosition","MarginRateByMoney",pInvestorPosition->MarginRateByMoney,dwTime);
      printNumber("pInvestorPosition","MarginRateByVolume",pInvestorPosition->MarginRateByVolume,dwTime);
      printNumber("pInvestorPosition","StrikeFrozen",pInvestorPosition->StrikeFrozen,dwTime);
      printNumber("pInvestorPosition","StrikeFrozenAmount",pInvestorPosition->StrikeFrozenAmount,dwTime);
      printNumber("pInvestorPosition","AbandonFrozen",pInvestorPosition->AbandonFrozen,dwTime);
      printString("pInvestorPosition","ExchangeID",pInvestorPosition->ExchangeID,dwTime);
      printNumber("pInvestorPosition","YdStrikeFrozen",pInvestorPosition->YdStrikeFrozen,dwTime);
      printString("pInvestorPosition","InvestUnitID",pInvestorPosition->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryInvestorPosition", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryInvestorPosition(self, pInvestorPosition, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询资金账户响应
  virtual void  OnRspQryTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryTradingAccount", "Enter", dwTime);

    if (NULL==pTradingAccount)
    {
      printString("pTradingAccount","CThostFtdcTradingAccountField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pTradingAccount","BrokerID",pTradingAccount->BrokerID,dwTime);
      printString("pTradingAccount","AccountID",pTradingAccount->AccountID,dwTime);
      printNumber("pTradingAccount","PreMortgage",pTradingAccount->PreMortgage,dwTime);
      printNumber("pTradingAccount","PreCredit",pTradingAccount->PreCredit,dwTime);
      printNumber("pTradingAccount","PreDeposit",pTradingAccount->PreDeposit,dwTime);
      printNumber("pTradingAccount","PreBalance",pTradingAccount->PreBalance,dwTime);
      printNumber("pTradingAccount","PreMargin",pTradingAccount->PreMargin,dwTime);
      printNumber("pTradingAccount","InterestBase",pTradingAccount->InterestBase,dwTime);
      printNumber("pTradingAccount","Interest",pTradingAccount->Interest,dwTime);
      printNumber("pTradingAccount","Deposit",pTradingAccount->Deposit,dwTime);
      printNumber("pTradingAccount","Withdraw",pTradingAccount->Withdraw,dwTime);
      printNumber("pTradingAccount","FrozenMargin",pTradingAccount->FrozenMargin,dwTime);
      printNumber("pTradingAccount","FrozenCash",pTradingAccount->FrozenCash,dwTime);
      printNumber("pTradingAccount","FrozenCommission",pTradingAccount->FrozenCommission,dwTime);
      printNumber("pTradingAccount","CurrMargin",pTradingAccount->CurrMargin,dwTime);
      printNumber("pTradingAccount","CashIn",pTradingAccount->CashIn,dwTime);
      printNumber("pTradingAccount","Commission",pTradingAccount->Commission,dwTime);
      printNumber("pTradingAccount","CloseProfit",pTradingAccount->CloseProfit,dwTime);
      printNumber("pTradingAccount","PositionProfit",pTradingAccount->PositionProfit,dwTime);
      printNumber("pTradingAccount","Balance",pTradingAccount->Balance,dwTime);
      printNumber("pTradingAccount","Available",pTradingAccount->Available,dwTime);
      printNumber("pTradingAccount","WithdrawQuota",pTradingAccount->WithdrawQuota,dwTime);
      printNumber("pTradingAccount","Reserve",pTradingAccount->Reserve,dwTime);
      printString("pTradingAccount","TradingDay",pTradingAccount->TradingDay,dwTime);
      printNumber("pTradingAccount","SettlementID",pTradingAccount->SettlementID,dwTime);
      printNumber("pTradingAccount","Credit",pTradingAccount->Credit,dwTime);
      printNumber("pTradingAccount","Mortgage",pTradingAccount->Mortgage,dwTime);
      printNumber("pTradingAccount","ExchangeMargin",pTradingAccount->ExchangeMargin,dwTime);
      printNumber("pTradingAccount","DeliveryMargin",pTradingAccount->DeliveryMargin,dwTime);
      printNumber("pTradingAccount","ExchangeDeliveryMargin",pTradingAccount->ExchangeDeliveryMargin,dwTime);
      printNumber("pTradingAccount","ReserveBalance",pTradingAccount->ReserveBalance,dwTime);
      printString("pTradingAccount","CurrencyID",pTradingAccount->CurrencyID,dwTime);
      printNumber("pTradingAccount","PreFundMortgageIn",pTradingAccount->PreFundMortgageIn,dwTime);
      printNumber("pTradingAccount","PreFundMortgageOut",pTradingAccount->PreFundMortgageOut,dwTime);
      printNumber("pTradingAccount","FundMortgageIn",pTradingAccount->FundMortgageIn,dwTime);
      printNumber("pTradingAccount","FundMortgageOut",pTradingAccount->FundMortgageOut,dwTime);
      printNumber("pTradingAccount","FundMortgageAvailable",pTradingAccount->FundMortgageAvailable,dwTime);
      printNumber("pTradingAccount","MortgageableFund",pTradingAccount->MortgageableFund,dwTime);
      printNumber("pTradingAccount","SpecProductMargin",pTradingAccount->SpecProductMargin,dwTime);
      printNumber("pTradingAccount","SpecProductFrozenMargin",pTradingAccount->SpecProductFrozenMargin,dwTime);
      printNumber("pTradingAccount","SpecProductCommission",pTradingAccount->SpecProductCommission,dwTime);
      printNumber("pTradingAccount","SpecProductFrozenCommission",pTradingAccount->SpecProductFrozenCommission,dwTime);
      printNumber("pTradingAccount","SpecProductPositionProfit",pTradingAccount->SpecProductPositionProfit,dwTime);
      printNumber("pTradingAccount","SpecProductCloseProfit",pTradingAccount->SpecProductCloseProfit,dwTime);
      printNumber("pTradingAccount","SpecProductPositionProfitByAlg",pTradingAccount->SpecProductPositionProfitByAlg,dwTime);
      printNumber("pTradingAccount","SpecProductExchangeMargin",pTradingAccount->SpecProductExchangeMargin,dwTime);
      printNumber("pTradingAccount","BizType",pTradingAccount->BizType,dwTime);
      printNumber("pTradingAccount","FrozenSwap",pTradingAccount->FrozenSwap,dwTime);
      printNumber("pTradingAccount","RemainSwap",pTradingAccount->RemainSwap,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryTradingAccount", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryTradingAccount(self, pTradingAccount, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询投资者响应
  virtual void  OnRspQryInvestor(CThostFtdcInvestorField *pInvestor, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryInvestor", "Enter", dwTime);

    if (NULL==pInvestor)
    {
      printString("pInvestor","CThostFtdcInvestorField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInvestor","InvestorID",pInvestor->InvestorID,dwTime);
      printString("pInvestor","BrokerID",pInvestor->BrokerID,dwTime);
      printString("pInvestor","InvestorGroupID",pInvestor->InvestorGroupID,dwTime);
      printString("pInvestor","InvestorName",pInvestor->InvestorName,dwTime);
      printNumber("pInvestor","IdentifiedCardType",pInvestor->IdentifiedCardType,dwTime);
      printString("pInvestor","IdentifiedCardNo",pInvestor->IdentifiedCardNo,dwTime);
      printNumber("pInvestor","IsActive",pInvestor->IsActive,dwTime);
      printString("pInvestor","Telephone",pInvestor->Telephone,dwTime);
      printString("pInvestor","Address",pInvestor->Address,dwTime);
      printString("pInvestor","OpenDate",pInvestor->OpenDate,dwTime);
      printString("pInvestor","Mobile",pInvestor->Mobile,dwTime);
      printString("pInvestor","CommModelID",pInvestor->CommModelID,dwTime);
      printString("pInvestor","MarginModelID",pInvestor->MarginModelID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryInvestor", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryInvestor(self, pInvestor, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询交易编码响应
  virtual void  OnRspQryTradingCode(CThostFtdcTradingCodeField *pTradingCode, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryTradingCode", "Enter", dwTime);

    if (NULL==pTradingCode)
    {
      printString("pTradingCode","CThostFtdcTradingCodeField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pTradingCode","InvestorID",pTradingCode->InvestorID,dwTime);
      printString("pTradingCode","BrokerID",pTradingCode->BrokerID,dwTime);
      printString("pTradingCode","ExchangeID",pTradingCode->ExchangeID,dwTime);
      printString("pTradingCode","ClientID",pTradingCode->ClientID,dwTime);
      printNumber("pTradingCode","IsActive",pTradingCode->IsActive,dwTime);
      printNumber("pTradingCode","ClientIDType",pTradingCode->ClientIDType,dwTime);
      printString("pTradingCode","BranchID",pTradingCode->BranchID,dwTime);
      printNumber("pTradingCode","BizType",pTradingCode->BizType,dwTime);
      printString("pTradingCode","InvestUnitID",pTradingCode->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryTradingCode", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryTradingCode(self, pTradingCode, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询合约保证金率响应
  virtual void  OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField *pInstrumentMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryInstrumentMarginRate", "Enter", dwTime);

    if (NULL==pInstrumentMarginRate)
    {
      printString("pInstrumentMarginRate","CThostFtdcInstrumentMarginRateField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInstrumentMarginRate","InstrumentID",pInstrumentMarginRate->InstrumentID,dwTime);
      printNumber("pInstrumentMarginRate","InvestorRange",pInstrumentMarginRate->InvestorRange,dwTime);
      printString("pInstrumentMarginRate","BrokerID",pInstrumentMarginRate->BrokerID,dwTime);
      printString("pInstrumentMarginRate","InvestorID",pInstrumentMarginRate->InvestorID,dwTime);
      printNumber("pInstrumentMarginRate","HedgeFlag",pInstrumentMarginRate->HedgeFlag,dwTime);
      printNumber("pInstrumentMarginRate","LongMarginRatioByMoney",pInstrumentMarginRate->LongMarginRatioByMoney,dwTime);
      printNumber("pInstrumentMarginRate","LongMarginRatioByVolume",pInstrumentMarginRate->LongMarginRatioByVolume,dwTime);
      printNumber("pInstrumentMarginRate","ShortMarginRatioByMoney",pInstrumentMarginRate->ShortMarginRatioByMoney,dwTime);
      printNumber("pInstrumentMarginRate","ShortMarginRatioByVolume",pInstrumentMarginRate->ShortMarginRatioByVolume,dwTime);
      printNumber("pInstrumentMarginRate","IsRelative",pInstrumentMarginRate->IsRelative,dwTime);
      printString("pInstrumentMarginRate","ExchangeID",pInstrumentMarginRate->ExchangeID,dwTime);
      printString("pInstrumentMarginRate","InvestUnitID",pInstrumentMarginRate->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryInstrumentMarginRate", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryInstrumentMarginRate(self, pInstrumentMarginRate, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询合约手续费率响应
  virtual void  OnRspQryInstrumentCommissionRate(CThostFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryInstrumentCommissionRate", "Enter", dwTime);

    if (NULL==pInstrumentCommissionRate)
    {
      printString("pInstrumentCommissionRate","CThostFtdcInstrumentCommissionRateField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInstrumentCommissionRate","InstrumentID",pInstrumentCommissionRate->InstrumentID,dwTime);
      printNumber("pInstrumentCommissionRate","InvestorRange",pInstrumentCommissionRate->InvestorRange,dwTime);
      printString("pInstrumentCommissionRate","BrokerID",pInstrumentCommissionRate->BrokerID,dwTime);
      printString("pInstrumentCommissionRate","InvestorID",pInstrumentCommissionRate->InvestorID,dwTime);
      printNumber("pInstrumentCommissionRate","OpenRatioByMoney",pInstrumentCommissionRate->OpenRatioByMoney,dwTime);
      printNumber("pInstrumentCommissionRate","OpenRatioByVolume",pInstrumentCommissionRate->OpenRatioByVolume,dwTime);
      printNumber("pInstrumentCommissionRate","CloseRatioByMoney",pInstrumentCommissionRate->CloseRatioByMoney,dwTime);
      printNumber("pInstrumentCommissionRate","CloseRatioByVolume",pInstrumentCommissionRate->CloseRatioByVolume,dwTime);
      printNumber("pInstrumentCommissionRate","CloseTodayRatioByMoney",pInstrumentCommissionRate->CloseTodayRatioByMoney,dwTime);
      printNumber("pInstrumentCommissionRate","CloseTodayRatioByVolume",pInstrumentCommissionRate->CloseTodayRatioByVolume,dwTime);
      printString("pInstrumentCommissionRate","ExchangeID",pInstrumentCommissionRate->ExchangeID,dwTime);
      printNumber("pInstrumentCommissionRate","BizType",pInstrumentCommissionRate->BizType,dwTime);
      printString("pInstrumentCommissionRate","InvestUnitID",pInstrumentCommissionRate->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryInstrumentCommissionRate", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryInstrumentCommissionRate(self, pInstrumentCommissionRate, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询交易所响应
  virtual void  OnRspQryExchange(CThostFtdcExchangeField *pExchange, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryExchange", "Enter", dwTime);

    if (NULL==pExchange)
    {
      printString("pExchange","CThostFtdcExchangeField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pExchange","ExchangeID",pExchange->ExchangeID,dwTime);
      printString("pExchange","ExchangeName",pExchange->ExchangeName,dwTime);
      printNumber("pExchange","ExchangeProperty",pExchange->ExchangeProperty,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryExchange", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryExchange(self, pExchange, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询产品响应
  virtual void  OnRspQryProduct(CThostFtdcProductField *pProduct, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryProduct", "Enter", dwTime);

    if (NULL==pProduct)
    {
      printString("pProduct","CThostFtdcProductField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pProduct","ProductID",pProduct->ProductID,dwTime);
      printString("pProduct","ProductName",pProduct->ProductName,dwTime);
      printString("pProduct","ExchangeID",pProduct->ExchangeID,dwTime);
      printNumber("pProduct","ProductClass",pProduct->ProductClass,dwTime);
      printNumber("pProduct","VolumeMultiple",pProduct->VolumeMultiple,dwTime);
      printNumber("pProduct","PriceTick",pProduct->PriceTick,dwTime);
      printNumber("pProduct","MaxMarketOrderVolume",pProduct->MaxMarketOrderVolume,dwTime);
      printNumber("pProduct","MinMarketOrderVolume",pProduct->MinMarketOrderVolume,dwTime);
      printNumber("pProduct","MaxLimitOrderVolume",pProduct->MaxLimitOrderVolume,dwTime);
      printNumber("pProduct","MinLimitOrderVolume",pProduct->MinLimitOrderVolume,dwTime);
      printNumber("pProduct","PositionType",pProduct->PositionType,dwTime);
      printNumber("pProduct","PositionDateType",pProduct->PositionDateType,dwTime);
      printNumber("pProduct","CloseDealType",pProduct->CloseDealType,dwTime);
      printString("pProduct","TradeCurrencyID",pProduct->TradeCurrencyID,dwTime);
      printNumber("pProduct","MortgageFundUseRange",pProduct->MortgageFundUseRange,dwTime);
      printString("pProduct","ExchangeProductID",pProduct->ExchangeProductID,dwTime);
      printNumber("pProduct","UnderlyingMultiple",pProduct->UnderlyingMultiple,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryProduct", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryProduct(self, pProduct, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询合约响应
  virtual void  OnRspQryInstrument(CThostFtdcInstrumentField *pInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryInstrument", "Enter", dwTime);

    if (NULL==pInstrument)
    {
      printString("pInstrument","CThostFtdcInstrumentField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInstrument","InstrumentID",pInstrument->InstrumentID,dwTime);
      printString("pInstrument","ExchangeID",pInstrument->ExchangeID,dwTime);
      printString("pInstrument","InstrumentName",pInstrument->InstrumentName,dwTime);
      printString("pInstrument","ExchangeInstID",pInstrument->ExchangeInstID,dwTime);
      printString("pInstrument","ProductID",pInstrument->ProductID,dwTime);
      printNumber("pInstrument","ProductClass",pInstrument->ProductClass,dwTime);
      printNumber("pInstrument","DeliveryYear",pInstrument->DeliveryYear,dwTime);
      printNumber("pInstrument","DeliveryMonth",pInstrument->DeliveryMonth,dwTime);
      printNumber("pInstrument","MaxMarketOrderVolume",pInstrument->MaxMarketOrderVolume,dwTime);
      printNumber("pInstrument","MinMarketOrderVolume",pInstrument->MinMarketOrderVolume,dwTime);
      printNumber("pInstrument","MaxLimitOrderVolume",pInstrument->MaxLimitOrderVolume,dwTime);
      printNumber("pInstrument","MinLimitOrderVolume",pInstrument->MinLimitOrderVolume,dwTime);
      printNumber("pInstrument","VolumeMultiple",pInstrument->VolumeMultiple,dwTime);
      printNumber("pInstrument","PriceTick",pInstrument->PriceTick,dwTime);
      printString("pInstrument","CreateDate",pInstrument->CreateDate,dwTime);
      printString("pInstrument","OpenDate",pInstrument->OpenDate,dwTime);
      printString("pInstrument","ExpireDate",pInstrument->ExpireDate,dwTime);
      printString("pInstrument","StartDelivDate",pInstrument->StartDelivDate,dwTime);
      printString("pInstrument","EndDelivDate",pInstrument->EndDelivDate,dwTime);
      printNumber("pInstrument","InstLifePhase",pInstrument->InstLifePhase,dwTime);
      printNumber("pInstrument","IsTrading",pInstrument->IsTrading,dwTime);
      printNumber("pInstrument","PositionType",pInstrument->PositionType,dwTime);
      printNumber("pInstrument","PositionDateType",pInstrument->PositionDateType,dwTime);
      printNumber("pInstrument","LongMarginRatio",pInstrument->LongMarginRatio,dwTime);
      printNumber("pInstrument","ShortMarginRatio",pInstrument->ShortMarginRatio,dwTime);
      printNumber("pInstrument","MaxMarginSideAlgorithm",pInstrument->MaxMarginSideAlgorithm,dwTime);
      printString("pInstrument","UnderlyingInstrID",pInstrument->UnderlyingInstrID,dwTime);
      printNumber("pInstrument","StrikePrice",pInstrument->StrikePrice,dwTime);
      printNumber("pInstrument","OptionsType",pInstrument->OptionsType,dwTime);
      printNumber("pInstrument","UnderlyingMultiple",pInstrument->UnderlyingMultiple,dwTime);
      printNumber("pInstrument","CombinationType",pInstrument->CombinationType,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryInstrument", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryInstrument(self, pInstrument, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询行情响应
  virtual void  OnRspQryDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryDepthMarketData", "Enter", dwTime);

    if (NULL==pDepthMarketData)
    {
      printString("pDepthMarketData","CThostFtdcDepthMarketDataField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pDepthMarketData","TradingDay",pDepthMarketData->TradingDay,dwTime);
      printString("pDepthMarketData","InstrumentID",pDepthMarketData->InstrumentID,dwTime);
      printString("pDepthMarketData","ExchangeID",pDepthMarketData->ExchangeID,dwTime);
      printString("pDepthMarketData","ExchangeInstID",pDepthMarketData->ExchangeInstID,dwTime);
      printNumber("pDepthMarketData","LastPrice",pDepthMarketData->LastPrice,dwTime);
      printNumber("pDepthMarketData","PreSettlementPrice",pDepthMarketData->PreSettlementPrice,dwTime);
      printNumber("pDepthMarketData","PreClosePrice",pDepthMarketData->PreClosePrice,dwTime);
      printNumber("pDepthMarketData","PreOpenInterest",pDepthMarketData->PreOpenInterest,dwTime);
      printNumber("pDepthMarketData","OpenPrice",pDepthMarketData->OpenPrice,dwTime);
      printNumber("pDepthMarketData","HighestPrice",pDepthMarketData->HighestPrice,dwTime);
      printNumber("pDepthMarketData","LowestPrice",pDepthMarketData->LowestPrice,dwTime);
      printNumber("pDepthMarketData","Volume",pDepthMarketData->Volume,dwTime);
      printNumber("pDepthMarketData","Turnover",pDepthMarketData->Turnover,dwTime);
      printNumber("pDepthMarketData","OpenInterest",pDepthMarketData->OpenInterest,dwTime);
      printNumber("pDepthMarketData","ClosePrice",pDepthMarketData->ClosePrice,dwTime);
      printNumber("pDepthMarketData","SettlementPrice",pDepthMarketData->SettlementPrice,dwTime);
      printNumber("pDepthMarketData","UpperLimitPrice",pDepthMarketData->UpperLimitPrice,dwTime);
      printNumber("pDepthMarketData","LowerLimitPrice",pDepthMarketData->LowerLimitPrice,dwTime);
      printNumber("pDepthMarketData","PreDelta",pDepthMarketData->PreDelta,dwTime);
      printNumber("pDepthMarketData","CurrDelta",pDepthMarketData->CurrDelta,dwTime);
      printString("pDepthMarketData","UpdateTime",pDepthMarketData->UpdateTime,dwTime);
      printNumber("pDepthMarketData","UpdateMillisec",pDepthMarketData->UpdateMillisec,dwTime);
      printNumber("pDepthMarketData","BidPrice1",pDepthMarketData->BidPrice1,dwTime);
      printNumber("pDepthMarketData","BidVolume1",pDepthMarketData->BidVolume1,dwTime);
      printNumber("pDepthMarketData","AskPrice1",pDepthMarketData->AskPrice1,dwTime);
      printNumber("pDepthMarketData","AskVolume1",pDepthMarketData->AskVolume1,dwTime);
      printNumber("pDepthMarketData","BidPrice2",pDepthMarketData->BidPrice2,dwTime);
      printNumber("pDepthMarketData","BidVolume2",pDepthMarketData->BidVolume2,dwTime);
      printNumber("pDepthMarketData","AskPrice2",pDepthMarketData->AskPrice2,dwTime);
      printNumber("pDepthMarketData","AskVolume2",pDepthMarketData->AskVolume2,dwTime);
      printNumber("pDepthMarketData","BidPrice3",pDepthMarketData->BidPrice3,dwTime);
      printNumber("pDepthMarketData","BidVolume3",pDepthMarketData->BidVolume3,dwTime);
      printNumber("pDepthMarketData","AskPrice3",pDepthMarketData->AskPrice3,dwTime);
      printNumber("pDepthMarketData","AskVolume3",pDepthMarketData->AskVolume3,dwTime);
      printNumber("pDepthMarketData","BidPrice4",pDepthMarketData->BidPrice4,dwTime);
      printNumber("pDepthMarketData","BidVolume4",pDepthMarketData->BidVolume4,dwTime);
      printNumber("pDepthMarketData","AskPrice4",pDepthMarketData->AskPrice4,dwTime);
      printNumber("pDepthMarketData","AskVolume4",pDepthMarketData->AskVolume4,dwTime);
      printNumber("pDepthMarketData","BidPrice5",pDepthMarketData->BidPrice5,dwTime);
      printNumber("pDepthMarketData","BidVolume5",pDepthMarketData->BidVolume5,dwTime);
      printNumber("pDepthMarketData","AskPrice5",pDepthMarketData->AskPrice5,dwTime);
      printNumber("pDepthMarketData","AskVolume5",pDepthMarketData->AskVolume5,dwTime);
      printNumber("pDepthMarketData","AveragePrice",pDepthMarketData->AveragePrice,dwTime);
      printString("pDepthMarketData","ActionDay",pDepthMarketData->ActionDay,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryDepthMarketData", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryDepthMarketData(self, pDepthMarketData, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询投资者结算结果响应
  virtual void  OnRspQrySettlementInfo(CThostFtdcSettlementInfoField *pSettlementInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQrySettlementInfo", "Enter", dwTime);

    if (NULL==pSettlementInfo)
    {
      printString("pSettlementInfo","CThostFtdcSettlementInfoField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pSettlementInfo","TradingDay",pSettlementInfo->TradingDay,dwTime);
      printNumber("pSettlementInfo","SettlementID",pSettlementInfo->SettlementID,dwTime);
      printString("pSettlementInfo","BrokerID",pSettlementInfo->BrokerID,dwTime);
      printString("pSettlementInfo","InvestorID",pSettlementInfo->InvestorID,dwTime);
      printNumber("pSettlementInfo","SequenceNo",pSettlementInfo->SequenceNo,dwTime);
      printString("pSettlementInfo","Content",pSettlementInfo->Content,dwTime);
      printString("pSettlementInfo","AccountID",pSettlementInfo->AccountID,dwTime);
      printString("pSettlementInfo","CurrencyID",pSettlementInfo->CurrencyID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQrySettlementInfo", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQrySettlementInfo(self, pSettlementInfo, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询转帐银行响应
  virtual void  OnRspQryTransferBank(CThostFtdcTransferBankField *pTransferBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryTransferBank", "Enter", dwTime);

    if (NULL==pTransferBank)
    {
      printString("pTransferBank","CThostFtdcTransferBankField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pTransferBank","BankID",pTransferBank->BankID,dwTime);
      printString("pTransferBank","BankBrchID",pTransferBank->BankBrchID,dwTime);
      printString("pTransferBank","BankName",pTransferBank->BankName,dwTime);
      printNumber("pTransferBank","IsActive",pTransferBank->IsActive,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryTransferBank", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryTransferBank(self, pTransferBank, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询投资者持仓明细响应
  virtual void  OnRspQryInvestorPositionDetail(CThostFtdcInvestorPositionDetailField *pInvestorPositionDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryInvestorPositionDetail", "Enter", dwTime);

    if (NULL==pInvestorPositionDetail)
    {
      printString("pInvestorPositionDetail","CThostFtdcInvestorPositionDetailField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInvestorPositionDetail","InstrumentID",pInvestorPositionDetail->InstrumentID,dwTime);
      printString("pInvestorPositionDetail","BrokerID",pInvestorPositionDetail->BrokerID,dwTime);
      printString("pInvestorPositionDetail","InvestorID",pInvestorPositionDetail->InvestorID,dwTime);
      printNumber("pInvestorPositionDetail","HedgeFlag",pInvestorPositionDetail->HedgeFlag,dwTime);
      printNumber("pInvestorPositionDetail","Direction",pInvestorPositionDetail->Direction,dwTime);
      printString("pInvestorPositionDetail","OpenDate",pInvestorPositionDetail->OpenDate,dwTime);
      printString("pInvestorPositionDetail","TradeID",pInvestorPositionDetail->TradeID,dwTime);
      printNumber("pInvestorPositionDetail","Volume",pInvestorPositionDetail->Volume,dwTime);
      printNumber("pInvestorPositionDetail","OpenPrice",pInvestorPositionDetail->OpenPrice,dwTime);
      printString("pInvestorPositionDetail","TradingDay",pInvestorPositionDetail->TradingDay,dwTime);
      printNumber("pInvestorPositionDetail","SettlementID",pInvestorPositionDetail->SettlementID,dwTime);
      printNumber("pInvestorPositionDetail","TradeType",pInvestorPositionDetail->TradeType,dwTime);
      printString("pInvestorPositionDetail","CombInstrumentID",pInvestorPositionDetail->CombInstrumentID,dwTime);
      printString("pInvestorPositionDetail","ExchangeID",pInvestorPositionDetail->ExchangeID,dwTime);
      printNumber("pInvestorPositionDetail","CloseProfitByDate",pInvestorPositionDetail->CloseProfitByDate,dwTime);
      printNumber("pInvestorPositionDetail","CloseProfitByTrade",pInvestorPositionDetail->CloseProfitByTrade,dwTime);
      printNumber("pInvestorPositionDetail","PositionProfitByDate",pInvestorPositionDetail->PositionProfitByDate,dwTime);
      printNumber("pInvestorPositionDetail","PositionProfitByTrade",pInvestorPositionDetail->PositionProfitByTrade,dwTime);
      printNumber("pInvestorPositionDetail","Margin",pInvestorPositionDetail->Margin,dwTime);
      printNumber("pInvestorPositionDetail","ExchMargin",pInvestorPositionDetail->ExchMargin,dwTime);
      printNumber("pInvestorPositionDetail","MarginRateByMoney",pInvestorPositionDetail->MarginRateByMoney,dwTime);
      printNumber("pInvestorPositionDetail","MarginRateByVolume",pInvestorPositionDetail->MarginRateByVolume,dwTime);
      printNumber("pInvestorPositionDetail","LastSettlementPrice",pInvestorPositionDetail->LastSettlementPrice,dwTime);
      printNumber("pInvestorPositionDetail","SettlementPrice",pInvestorPositionDetail->SettlementPrice,dwTime);
      printNumber("pInvestorPositionDetail","CloseVolume",pInvestorPositionDetail->CloseVolume,dwTime);
      printNumber("pInvestorPositionDetail","CloseAmount",pInvestorPositionDetail->CloseAmount,dwTime);
      printString("pInvestorPositionDetail","InvestUnitID",pInvestorPositionDetail->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryInvestorPositionDetail", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryInvestorPositionDetail(self, pInvestorPositionDetail, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询客户通知响应
  virtual void  OnRspQryNotice(CThostFtdcNoticeField *pNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryNotice", "Enter", dwTime);

    if (NULL==pNotice)
    {
      printString("pNotice","CThostFtdcNoticeField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pNotice","BrokerID",pNotice->BrokerID,dwTime);
      printString("pNotice","Content",pNotice->Content,dwTime);
      printString("pNotice","SequenceLabel",pNotice->SequenceLabel,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryNotice", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryNotice(self, pNotice, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询结算信息确认响应
  virtual void  OnRspQrySettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQrySettlementInfoConfirm", "Enter", dwTime);

    if (NULL==pSettlementInfoConfirm)
    {
      printString("pSettlementInfoConfirm","CThostFtdcSettlementInfoConfirmField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pSettlementInfoConfirm","BrokerID",pSettlementInfoConfirm->BrokerID,dwTime);
      printString("pSettlementInfoConfirm","InvestorID",pSettlementInfoConfirm->InvestorID,dwTime);
      printString("pSettlementInfoConfirm","ConfirmDate",pSettlementInfoConfirm->ConfirmDate,dwTime);
      printString("pSettlementInfoConfirm","ConfirmTime",pSettlementInfoConfirm->ConfirmTime,dwTime);
      printNumber("pSettlementInfoConfirm","SettlementID",pSettlementInfoConfirm->SettlementID,dwTime);
      printString("pSettlementInfoConfirm","AccountID",pSettlementInfoConfirm->AccountID,dwTime);
      printString("pSettlementInfoConfirm","CurrencyID",pSettlementInfoConfirm->CurrencyID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQrySettlementInfoConfirm", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQrySettlementInfoConfirm(self, pSettlementInfoConfirm, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询投资者持仓明细响应
  virtual void  OnRspQryInvestorPositionCombineDetail(CThostFtdcInvestorPositionCombineDetailField *pInvestorPositionCombineDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryInvestorPositionCombineDetail", "Enter", dwTime);

    if (NULL==pInvestorPositionCombineDetail)
    {
      printString("pInvestorPositionCombineDetail","CThostFtdcInvestorPositionCombineDetailField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInvestorPositionCombineDetail","TradingDay",pInvestorPositionCombineDetail->TradingDay,dwTime);
      printString("pInvestorPositionCombineDetail","OpenDate",pInvestorPositionCombineDetail->OpenDate,dwTime);
      printString("pInvestorPositionCombineDetail","ExchangeID",pInvestorPositionCombineDetail->ExchangeID,dwTime);
      printNumber("pInvestorPositionCombineDetail","SettlementID",pInvestorPositionCombineDetail->SettlementID,dwTime);
      printString("pInvestorPositionCombineDetail","BrokerID",pInvestorPositionCombineDetail->BrokerID,dwTime);
      printString("pInvestorPositionCombineDetail","InvestorID",pInvestorPositionCombineDetail->InvestorID,dwTime);
      printString("pInvestorPositionCombineDetail","ComTradeID",pInvestorPositionCombineDetail->ComTradeID,dwTime);
      printString("pInvestorPositionCombineDetail","TradeID",pInvestorPositionCombineDetail->TradeID,dwTime);
      printString("pInvestorPositionCombineDetail","InstrumentID",pInvestorPositionCombineDetail->InstrumentID,dwTime);
      printNumber("pInvestorPositionCombineDetail","HedgeFlag",pInvestorPositionCombineDetail->HedgeFlag,dwTime);
      printNumber("pInvestorPositionCombineDetail","Direction",pInvestorPositionCombineDetail->Direction,dwTime);
      printNumber("pInvestorPositionCombineDetail","TotalAmt",pInvestorPositionCombineDetail->TotalAmt,dwTime);
      printNumber("pInvestorPositionCombineDetail","Margin",pInvestorPositionCombineDetail->Margin,dwTime);
      printNumber("pInvestorPositionCombineDetail","ExchMargin",pInvestorPositionCombineDetail->ExchMargin,dwTime);
      printNumber("pInvestorPositionCombineDetail","MarginRateByMoney",pInvestorPositionCombineDetail->MarginRateByMoney,dwTime);
      printNumber("pInvestorPositionCombineDetail","MarginRateByVolume",pInvestorPositionCombineDetail->MarginRateByVolume,dwTime);
      printNumber("pInvestorPositionCombineDetail","LegID",pInvestorPositionCombineDetail->LegID,dwTime);
      printNumber("pInvestorPositionCombineDetail","LegMultiple",pInvestorPositionCombineDetail->LegMultiple,dwTime);
      printString("pInvestorPositionCombineDetail","CombInstrumentID",pInvestorPositionCombineDetail->CombInstrumentID,dwTime);
      printNumber("pInvestorPositionCombineDetail","TradeGroupID",pInvestorPositionCombineDetail->TradeGroupID,dwTime);
      printString("pInvestorPositionCombineDetail","InvestUnitID",pInvestorPositionCombineDetail->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryInvestorPositionCombineDetail", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryInvestorPositionCombineDetail(self, pInvestorPositionCombineDetail, pRspInfo, nRequestID, bIsLast);

  };

  ///查询保证金监管系统经纪公司资金账户密钥响应
  virtual void  OnRspQryCFMMCTradingAccountKey(CThostFtdcCFMMCTradingAccountKeyField *pCFMMCTradingAccountKey, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryCFMMCTradingAccountKey", "Enter", dwTime);

    if (NULL==pCFMMCTradingAccountKey)
    {
      printString("pCFMMCTradingAccountKey","CThostFtdcCFMMCTradingAccountKeyField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pCFMMCTradingAccountKey","BrokerID",pCFMMCTradingAccountKey->BrokerID,dwTime);
      printString("pCFMMCTradingAccountKey","ParticipantID",pCFMMCTradingAccountKey->ParticipantID,dwTime);
      printString("pCFMMCTradingAccountKey","AccountID",pCFMMCTradingAccountKey->AccountID,dwTime);
      printNumber("pCFMMCTradingAccountKey","KeyID",pCFMMCTradingAccountKey->KeyID,dwTime);
      printString("pCFMMCTradingAccountKey","CurrentKey",pCFMMCTradingAccountKey->CurrentKey,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryCFMMCTradingAccountKey", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryCFMMCTradingAccountKey(self, pCFMMCTradingAccountKey, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询仓单折抵信息响应
  virtual void  OnRspQryEWarrantOffset(CThostFtdcEWarrantOffsetField *pEWarrantOffset, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryEWarrantOffset", "Enter", dwTime);

    if (NULL==pEWarrantOffset)
    {
      printString("pEWarrantOffset","CThostFtdcEWarrantOffsetField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pEWarrantOffset","TradingDay",pEWarrantOffset->TradingDay,dwTime);
      printString("pEWarrantOffset","BrokerID",pEWarrantOffset->BrokerID,dwTime);
      printString("pEWarrantOffset","InvestorID",pEWarrantOffset->InvestorID,dwTime);
      printString("pEWarrantOffset","ExchangeID",pEWarrantOffset->ExchangeID,dwTime);
      printString("pEWarrantOffset","InstrumentID",pEWarrantOffset->InstrumentID,dwTime);
      printNumber("pEWarrantOffset","Direction",pEWarrantOffset->Direction,dwTime);
      printNumber("pEWarrantOffset","HedgeFlag",pEWarrantOffset->HedgeFlag,dwTime);
      printNumber("pEWarrantOffset","Volume",pEWarrantOffset->Volume,dwTime);
      printString("pEWarrantOffset","InvestUnitID",pEWarrantOffset->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryEWarrantOffset", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryEWarrantOffset(self, pEWarrantOffset, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询投资者品种/跨品种保证金响应
  virtual void  OnRspQryInvestorProductGroupMargin(CThostFtdcInvestorProductGroupMarginField *pInvestorProductGroupMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryInvestorProductGroupMargin", "Enter", dwTime);

    if (NULL==pInvestorProductGroupMargin)
    {
      printString("pInvestorProductGroupMargin","CThostFtdcInvestorProductGroupMarginField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInvestorProductGroupMargin","ProductGroupID",pInvestorProductGroupMargin->ProductGroupID,dwTime);
      printString("pInvestorProductGroupMargin","BrokerID",pInvestorProductGroupMargin->BrokerID,dwTime);
      printString("pInvestorProductGroupMargin","InvestorID",pInvestorProductGroupMargin->InvestorID,dwTime);
      printString("pInvestorProductGroupMargin","TradingDay",pInvestorProductGroupMargin->TradingDay,dwTime);
      printNumber("pInvestorProductGroupMargin","SettlementID",pInvestorProductGroupMargin->SettlementID,dwTime);
      printNumber("pInvestorProductGroupMargin","FrozenMargin",pInvestorProductGroupMargin->FrozenMargin,dwTime);
      printNumber("pInvestorProductGroupMargin","LongFrozenMargin",pInvestorProductGroupMargin->LongFrozenMargin,dwTime);
      printNumber("pInvestorProductGroupMargin","ShortFrozenMargin",pInvestorProductGroupMargin->ShortFrozenMargin,dwTime);
      printNumber("pInvestorProductGroupMargin","UseMargin",pInvestorProductGroupMargin->UseMargin,dwTime);
      printNumber("pInvestorProductGroupMargin","LongUseMargin",pInvestorProductGroupMargin->LongUseMargin,dwTime);
      printNumber("pInvestorProductGroupMargin","ShortUseMargin",pInvestorProductGroupMargin->ShortUseMargin,dwTime);
      printNumber("pInvestorProductGroupMargin","ExchMargin",pInvestorProductGroupMargin->ExchMargin,dwTime);
      printNumber("pInvestorProductGroupMargin","LongExchMargin",pInvestorProductGroupMargin->LongExchMargin,dwTime);
      printNumber("pInvestorProductGroupMargin","ShortExchMargin",pInvestorProductGroupMargin->ShortExchMargin,dwTime);
      printNumber("pInvestorProductGroupMargin","CloseProfit",pInvestorProductGroupMargin->CloseProfit,dwTime);
      printNumber("pInvestorProductGroupMargin","FrozenCommission",pInvestorProductGroupMargin->FrozenCommission,dwTime);
      printNumber("pInvestorProductGroupMargin","Commission",pInvestorProductGroupMargin->Commission,dwTime);
      printNumber("pInvestorProductGroupMargin","FrozenCash",pInvestorProductGroupMargin->FrozenCash,dwTime);
      printNumber("pInvestorProductGroupMargin","CashIn",pInvestorProductGroupMargin->CashIn,dwTime);
      printNumber("pInvestorProductGroupMargin","PositionProfit",pInvestorProductGroupMargin->PositionProfit,dwTime);
      printNumber("pInvestorProductGroupMargin","OffsetAmount",pInvestorProductGroupMargin->OffsetAmount,dwTime);
      printNumber("pInvestorProductGroupMargin","LongOffsetAmount",pInvestorProductGroupMargin->LongOffsetAmount,dwTime);
      printNumber("pInvestorProductGroupMargin","ShortOffsetAmount",pInvestorProductGroupMargin->ShortOffsetAmount,dwTime);
      printNumber("pInvestorProductGroupMargin","ExchOffsetAmount",pInvestorProductGroupMargin->ExchOffsetAmount,dwTime);
      printNumber("pInvestorProductGroupMargin","LongExchOffsetAmount",pInvestorProductGroupMargin->LongExchOffsetAmount,dwTime);
      printNumber("pInvestorProductGroupMargin","ShortExchOffsetAmount",pInvestorProductGroupMargin->ShortExchOffsetAmount,dwTime);
      printNumber("pInvestorProductGroupMargin","HedgeFlag",pInvestorProductGroupMargin->HedgeFlag,dwTime);
      printString("pInvestorProductGroupMargin","ExchangeID",pInvestorProductGroupMargin->ExchangeID,dwTime);
      printString("pInvestorProductGroupMargin","InvestUnitID",pInvestorProductGroupMargin->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryInvestorProductGroupMargin", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryInvestorProductGroupMargin(self, pInvestorProductGroupMargin, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询交易所保证金率响应
  virtual void  OnRspQryExchangeMarginRate(CThostFtdcExchangeMarginRateField *pExchangeMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryExchangeMarginRate", "Enter", dwTime);

    if (NULL==pExchangeMarginRate)
    {
      printString("pExchangeMarginRate","CThostFtdcExchangeMarginRateField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pExchangeMarginRate","BrokerID",pExchangeMarginRate->BrokerID,dwTime);
      printString("pExchangeMarginRate","InstrumentID",pExchangeMarginRate->InstrumentID,dwTime);
      printNumber("pExchangeMarginRate","HedgeFlag",pExchangeMarginRate->HedgeFlag,dwTime);
      printNumber("pExchangeMarginRate","LongMarginRatioByMoney",pExchangeMarginRate->LongMarginRatioByMoney,dwTime);
      printNumber("pExchangeMarginRate","LongMarginRatioByVolume",pExchangeMarginRate->LongMarginRatioByVolume,dwTime);
      printNumber("pExchangeMarginRate","ShortMarginRatioByMoney",pExchangeMarginRate->ShortMarginRatioByMoney,dwTime);
      printNumber("pExchangeMarginRate","ShortMarginRatioByVolume",pExchangeMarginRate->ShortMarginRatioByVolume,dwTime);
      printString("pExchangeMarginRate","ExchangeID",pExchangeMarginRate->ExchangeID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryExchangeMarginRate", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryExchangeMarginRate(self, pExchangeMarginRate, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询交易所调整保证金率响应
  virtual void  OnRspQryExchangeMarginRateAdjust(CThostFtdcExchangeMarginRateAdjustField *pExchangeMarginRateAdjust, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryExchangeMarginRateAdjust", "Enter", dwTime);

    if (NULL==pExchangeMarginRateAdjust)
    {
      printString("pExchangeMarginRateAdjust","CThostFtdcExchangeMarginRateAdjustField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pExchangeMarginRateAdjust","BrokerID",pExchangeMarginRateAdjust->BrokerID,dwTime);
      printString("pExchangeMarginRateAdjust","InstrumentID",pExchangeMarginRateAdjust->InstrumentID,dwTime);
      printNumber("pExchangeMarginRateAdjust","HedgeFlag",pExchangeMarginRateAdjust->HedgeFlag,dwTime);
      printNumber("pExchangeMarginRateAdjust","LongMarginRatioByMoney",pExchangeMarginRateAdjust->LongMarginRatioByMoney,dwTime);
      printNumber("pExchangeMarginRateAdjust","LongMarginRatioByVolume",pExchangeMarginRateAdjust->LongMarginRatioByVolume,dwTime);
      printNumber("pExchangeMarginRateAdjust","ShortMarginRatioByMoney",pExchangeMarginRateAdjust->ShortMarginRatioByMoney,dwTime);
      printNumber("pExchangeMarginRateAdjust","ShortMarginRatioByVolume",pExchangeMarginRateAdjust->ShortMarginRatioByVolume,dwTime);
      printNumber("pExchangeMarginRateAdjust","ExchLongMarginRatioByMoney",pExchangeMarginRateAdjust->ExchLongMarginRatioByMoney,dwTime);
      printNumber("pExchangeMarginRateAdjust","ExchLongMarginRatioByVolume",pExchangeMarginRateAdjust->ExchLongMarginRatioByVolume,dwTime);
      printNumber("pExchangeMarginRateAdjust","ExchShortMarginRatioByMoney",pExchangeMarginRateAdjust->ExchShortMarginRatioByMoney,dwTime);
      printNumber("pExchangeMarginRateAdjust","ExchShortMarginRatioByVolume",pExchangeMarginRateAdjust->ExchShortMarginRatioByVolume,dwTime);
      printNumber("pExchangeMarginRateAdjust","NoLongMarginRatioByMoney",pExchangeMarginRateAdjust->NoLongMarginRatioByMoney,dwTime);
      printNumber("pExchangeMarginRateAdjust","NoLongMarginRatioByVolume",pExchangeMarginRateAdjust->NoLongMarginRatioByVolume,dwTime);
      printNumber("pExchangeMarginRateAdjust","NoShortMarginRatioByMoney",pExchangeMarginRateAdjust->NoShortMarginRatioByMoney,dwTime);
      printNumber("pExchangeMarginRateAdjust","NoShortMarginRatioByVolume",pExchangeMarginRateAdjust->NoShortMarginRatioByVolume,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryExchangeMarginRateAdjust", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryExchangeMarginRateAdjust(self, pExchangeMarginRateAdjust, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询汇率响应
  virtual void  OnRspQryExchangeRate(CThostFtdcExchangeRateField *pExchangeRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryExchangeRate", "Enter", dwTime);

    if (NULL==pExchangeRate)
    {
      printString("pExchangeRate","CThostFtdcExchangeRateField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pExchangeRate","BrokerID",pExchangeRate->BrokerID,dwTime);
      printString("pExchangeRate","FromCurrencyID",pExchangeRate->FromCurrencyID,dwTime);
      printNumber("pExchangeRate","FromCurrencyUnit",pExchangeRate->FromCurrencyUnit,dwTime);
      printString("pExchangeRate","ToCurrencyID",pExchangeRate->ToCurrencyID,dwTime);
      printNumber("pExchangeRate","ExchangeRate",pExchangeRate->ExchangeRate,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryExchangeRate", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryExchangeRate(self, pExchangeRate, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询二级代理操作员银期权限响应
  virtual void  OnRspQrySecAgentACIDMap(CThostFtdcSecAgentACIDMapField *pSecAgentACIDMap, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQrySecAgentACIDMap", "Enter", dwTime);

    if (NULL==pSecAgentACIDMap)
    {
      printString("pSecAgentACIDMap","CThostFtdcSecAgentACIDMapField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pSecAgentACIDMap","BrokerID",pSecAgentACIDMap->BrokerID,dwTime);
      printString("pSecAgentACIDMap","UserID",pSecAgentACIDMap->UserID,dwTime);
      printString("pSecAgentACIDMap","AccountID",pSecAgentACIDMap->AccountID,dwTime);
      printString("pSecAgentACIDMap","CurrencyID",pSecAgentACIDMap->CurrencyID,dwTime);
      printString("pSecAgentACIDMap","BrokerSecAgentID",pSecAgentACIDMap->BrokerSecAgentID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQrySecAgentACIDMap", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQrySecAgentACIDMap(self, pSecAgentACIDMap, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询产品报价汇率
  virtual void  OnRspQryProductExchRate(CThostFtdcProductExchRateField *pProductExchRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryProductExchRate", "Enter", dwTime);

    if (NULL==pProductExchRate)
    {
      printString("pProductExchRate","CThostFtdcProductExchRateField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pProductExchRate","ProductID",pProductExchRate->ProductID,dwTime);
      printString("pProductExchRate","QuoteCurrencyID",pProductExchRate->QuoteCurrencyID,dwTime);
      printNumber("pProductExchRate","ExchangeRate",pProductExchRate->ExchangeRate,dwTime);
      printString("pProductExchRate","ExchangeID",pProductExchRate->ExchangeID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryProductExchRate", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryProductExchRate(self, pProductExchRate, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询产品组
  virtual void  OnRspQryProductGroup(CThostFtdcProductGroupField *pProductGroup, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryProductGroup", "Enter", dwTime);

    if (NULL==pProductGroup)
    {
      printString("pProductGroup","CThostFtdcProductGroupField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pProductGroup","ProductID",pProductGroup->ProductID,dwTime);
      printString("pProductGroup","ExchangeID",pProductGroup->ExchangeID,dwTime);
      printString("pProductGroup","ProductGroupID",pProductGroup->ProductGroupID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryProductGroup", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryProductGroup(self, pProductGroup, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询做市商合约手续费率响应
  virtual void  OnRspQryMMInstrumentCommissionRate(CThostFtdcMMInstrumentCommissionRateField *pMMInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryMMInstrumentCommissionRate", "Enter", dwTime);

    if (NULL==pMMInstrumentCommissionRate)
    {
      printString("pMMInstrumentCommissionRate","CThostFtdcMMInstrumentCommissionRateField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pMMInstrumentCommissionRate","InstrumentID",pMMInstrumentCommissionRate->InstrumentID,dwTime);
      printNumber("pMMInstrumentCommissionRate","InvestorRange",pMMInstrumentCommissionRate->InvestorRange,dwTime);
      printString("pMMInstrumentCommissionRate","BrokerID",pMMInstrumentCommissionRate->BrokerID,dwTime);
      printString("pMMInstrumentCommissionRate","InvestorID",pMMInstrumentCommissionRate->InvestorID,dwTime);
      printNumber("pMMInstrumentCommissionRate","OpenRatioByMoney",pMMInstrumentCommissionRate->OpenRatioByMoney,dwTime);
      printNumber("pMMInstrumentCommissionRate","OpenRatioByVolume",pMMInstrumentCommissionRate->OpenRatioByVolume,dwTime);
      printNumber("pMMInstrumentCommissionRate","CloseRatioByMoney",pMMInstrumentCommissionRate->CloseRatioByMoney,dwTime);
      printNumber("pMMInstrumentCommissionRate","CloseRatioByVolume",pMMInstrumentCommissionRate->CloseRatioByVolume,dwTime);
      printNumber("pMMInstrumentCommissionRate","CloseTodayRatioByMoney",pMMInstrumentCommissionRate->CloseTodayRatioByMoney,dwTime);
      printNumber("pMMInstrumentCommissionRate","CloseTodayRatioByVolume",pMMInstrumentCommissionRate->CloseTodayRatioByVolume,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryMMInstrumentCommissionRate", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryMMInstrumentCommissionRate(self, pMMInstrumentCommissionRate, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询做市商期权合约手续费响应
  virtual void  OnRspQryMMOptionInstrCommRate(CThostFtdcMMOptionInstrCommRateField *pMMOptionInstrCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryMMOptionInstrCommRate", "Enter", dwTime);

    if (NULL==pMMOptionInstrCommRate)
    {
      printString("pMMOptionInstrCommRate","CThostFtdcMMOptionInstrCommRateField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pMMOptionInstrCommRate","InstrumentID",pMMOptionInstrCommRate->InstrumentID,dwTime);
      printNumber("pMMOptionInstrCommRate","InvestorRange",pMMOptionInstrCommRate->InvestorRange,dwTime);
      printString("pMMOptionInstrCommRate","BrokerID",pMMOptionInstrCommRate->BrokerID,dwTime);
      printString("pMMOptionInstrCommRate","InvestorID",pMMOptionInstrCommRate->InvestorID,dwTime);
      printNumber("pMMOptionInstrCommRate","OpenRatioByMoney",pMMOptionInstrCommRate->OpenRatioByMoney,dwTime);
      printNumber("pMMOptionInstrCommRate","OpenRatioByVolume",pMMOptionInstrCommRate->OpenRatioByVolume,dwTime);
      printNumber("pMMOptionInstrCommRate","CloseRatioByMoney",pMMOptionInstrCommRate->CloseRatioByMoney,dwTime);
      printNumber("pMMOptionInstrCommRate","CloseRatioByVolume",pMMOptionInstrCommRate->CloseRatioByVolume,dwTime);
      printNumber("pMMOptionInstrCommRate","CloseTodayRatioByMoney",pMMOptionInstrCommRate->CloseTodayRatioByMoney,dwTime);
      printNumber("pMMOptionInstrCommRate","CloseTodayRatioByVolume",pMMOptionInstrCommRate->CloseTodayRatioByVolume,dwTime);
      printNumber("pMMOptionInstrCommRate","StrikeRatioByMoney",pMMOptionInstrCommRate->StrikeRatioByMoney,dwTime);
      printNumber("pMMOptionInstrCommRate","StrikeRatioByVolume",pMMOptionInstrCommRate->StrikeRatioByVolume,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryMMOptionInstrCommRate", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryMMOptionInstrCommRate(self, pMMOptionInstrCommRate, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询报单手续费响应
  virtual void  OnRspQryInstrumentOrderCommRate(CThostFtdcInstrumentOrderCommRateField *pInstrumentOrderCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryInstrumentOrderCommRate", "Enter", dwTime);

    if (NULL==pInstrumentOrderCommRate)
    {
      printString("pInstrumentOrderCommRate","CThostFtdcInstrumentOrderCommRateField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInstrumentOrderCommRate","InstrumentID",pInstrumentOrderCommRate->InstrumentID,dwTime);
      printNumber("pInstrumentOrderCommRate","InvestorRange",pInstrumentOrderCommRate->InvestorRange,dwTime);
      printString("pInstrumentOrderCommRate","BrokerID",pInstrumentOrderCommRate->BrokerID,dwTime);
      printString("pInstrumentOrderCommRate","InvestorID",pInstrumentOrderCommRate->InvestorID,dwTime);
      printNumber("pInstrumentOrderCommRate","HedgeFlag",pInstrumentOrderCommRate->HedgeFlag,dwTime);
      printNumber("pInstrumentOrderCommRate","OrderCommByVolume",pInstrumentOrderCommRate->OrderCommByVolume,dwTime);
      printNumber("pInstrumentOrderCommRate","OrderActionCommByVolume",pInstrumentOrderCommRate->OrderActionCommByVolume,dwTime);
      printString("pInstrumentOrderCommRate","ExchangeID",pInstrumentOrderCommRate->ExchangeID,dwTime);
      printString("pInstrumentOrderCommRate","InvestUnitID",pInstrumentOrderCommRate->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryInstrumentOrderCommRate", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryInstrumentOrderCommRate(self, pInstrumentOrderCommRate, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询资金账户响应
  virtual void  OnRspQrySecAgentTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQrySecAgentTradingAccount", "Enter", dwTime);

    if (NULL==pTradingAccount)
    {
      printString("pTradingAccount","CThostFtdcTradingAccountField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pTradingAccount","BrokerID",pTradingAccount->BrokerID,dwTime);
      printString("pTradingAccount","AccountID",pTradingAccount->AccountID,dwTime);
      printNumber("pTradingAccount","PreMortgage",pTradingAccount->PreMortgage,dwTime);
      printNumber("pTradingAccount","PreCredit",pTradingAccount->PreCredit,dwTime);
      printNumber("pTradingAccount","PreDeposit",pTradingAccount->PreDeposit,dwTime);
      printNumber("pTradingAccount","PreBalance",pTradingAccount->PreBalance,dwTime);
      printNumber("pTradingAccount","PreMargin",pTradingAccount->PreMargin,dwTime);
      printNumber("pTradingAccount","InterestBase",pTradingAccount->InterestBase,dwTime);
      printNumber("pTradingAccount","Interest",pTradingAccount->Interest,dwTime);
      printNumber("pTradingAccount","Deposit",pTradingAccount->Deposit,dwTime);
      printNumber("pTradingAccount","Withdraw",pTradingAccount->Withdraw,dwTime);
      printNumber("pTradingAccount","FrozenMargin",pTradingAccount->FrozenMargin,dwTime);
      printNumber("pTradingAccount","FrozenCash",pTradingAccount->FrozenCash,dwTime);
      printNumber("pTradingAccount","FrozenCommission",pTradingAccount->FrozenCommission,dwTime);
      printNumber("pTradingAccount","CurrMargin",pTradingAccount->CurrMargin,dwTime);
      printNumber("pTradingAccount","CashIn",pTradingAccount->CashIn,dwTime);
      printNumber("pTradingAccount","Commission",pTradingAccount->Commission,dwTime);
      printNumber("pTradingAccount","CloseProfit",pTradingAccount->CloseProfit,dwTime);
      printNumber("pTradingAccount","PositionProfit",pTradingAccount->PositionProfit,dwTime);
      printNumber("pTradingAccount","Balance",pTradingAccount->Balance,dwTime);
      printNumber("pTradingAccount","Available",pTradingAccount->Available,dwTime);
      printNumber("pTradingAccount","WithdrawQuota",pTradingAccount->WithdrawQuota,dwTime);
      printNumber("pTradingAccount","Reserve",pTradingAccount->Reserve,dwTime);
      printString("pTradingAccount","TradingDay",pTradingAccount->TradingDay,dwTime);
      printNumber("pTradingAccount","SettlementID",pTradingAccount->SettlementID,dwTime);
      printNumber("pTradingAccount","Credit",pTradingAccount->Credit,dwTime);
      printNumber("pTradingAccount","Mortgage",pTradingAccount->Mortgage,dwTime);
      printNumber("pTradingAccount","ExchangeMargin",pTradingAccount->ExchangeMargin,dwTime);
      printNumber("pTradingAccount","DeliveryMargin",pTradingAccount->DeliveryMargin,dwTime);
      printNumber("pTradingAccount","ExchangeDeliveryMargin",pTradingAccount->ExchangeDeliveryMargin,dwTime);
      printNumber("pTradingAccount","ReserveBalance",pTradingAccount->ReserveBalance,dwTime);
      printString("pTradingAccount","CurrencyID",pTradingAccount->CurrencyID,dwTime);
      printNumber("pTradingAccount","PreFundMortgageIn",pTradingAccount->PreFundMortgageIn,dwTime);
      printNumber("pTradingAccount","PreFundMortgageOut",pTradingAccount->PreFundMortgageOut,dwTime);
      printNumber("pTradingAccount","FundMortgageIn",pTradingAccount->FundMortgageIn,dwTime);
      printNumber("pTradingAccount","FundMortgageOut",pTradingAccount->FundMortgageOut,dwTime);
      printNumber("pTradingAccount","FundMortgageAvailable",pTradingAccount->FundMortgageAvailable,dwTime);
      printNumber("pTradingAccount","MortgageableFund",pTradingAccount->MortgageableFund,dwTime);
      printNumber("pTradingAccount","SpecProductMargin",pTradingAccount->SpecProductMargin,dwTime);
      printNumber("pTradingAccount","SpecProductFrozenMargin",pTradingAccount->SpecProductFrozenMargin,dwTime);
      printNumber("pTradingAccount","SpecProductCommission",pTradingAccount->SpecProductCommission,dwTime);
      printNumber("pTradingAccount","SpecProductFrozenCommission",pTradingAccount->SpecProductFrozenCommission,dwTime);
      printNumber("pTradingAccount","SpecProductPositionProfit",pTradingAccount->SpecProductPositionProfit,dwTime);
      printNumber("pTradingAccount","SpecProductCloseProfit",pTradingAccount->SpecProductCloseProfit,dwTime);
      printNumber("pTradingAccount","SpecProductPositionProfitByAlg",pTradingAccount->SpecProductPositionProfitByAlg,dwTime);
      printNumber("pTradingAccount","SpecProductExchangeMargin",pTradingAccount->SpecProductExchangeMargin,dwTime);
      printNumber("pTradingAccount","BizType",pTradingAccount->BizType,dwTime);
      printNumber("pTradingAccount","FrozenSwap",pTradingAccount->FrozenSwap,dwTime);
      printNumber("pTradingAccount","RemainSwap",pTradingAccount->RemainSwap,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQrySecAgentTradingAccount", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQrySecAgentTradingAccount(self, pTradingAccount, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询二级代理商资金校验模式响应
  virtual void  OnRspQrySecAgentCheckMode(CThostFtdcSecAgentCheckModeField *pSecAgentCheckMode, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQrySecAgentCheckMode", "Enter", dwTime);

    if (NULL==pSecAgentCheckMode)
    {
      printString("pSecAgentCheckMode","CThostFtdcSecAgentCheckModeField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pSecAgentCheckMode","InvestorID",pSecAgentCheckMode->InvestorID,dwTime);
      printString("pSecAgentCheckMode","BrokerID",pSecAgentCheckMode->BrokerID,dwTime);
      printString("pSecAgentCheckMode","CurrencyID",pSecAgentCheckMode->CurrencyID,dwTime);
      printString("pSecAgentCheckMode","BrokerSecAgentID",pSecAgentCheckMode->BrokerSecAgentID,dwTime);
      printNumber("pSecAgentCheckMode","CheckSelfAccount",pSecAgentCheckMode->CheckSelfAccount,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQrySecAgentCheckMode", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQrySecAgentCheckMode(self, pSecAgentCheckMode, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询期权交易成本响应
  virtual void  OnRspQryOptionInstrTradeCost(CThostFtdcOptionInstrTradeCostField *pOptionInstrTradeCost, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryOptionInstrTradeCost", "Enter", dwTime);

    if (NULL==pOptionInstrTradeCost)
    {
      printString("pOptionInstrTradeCost","CThostFtdcOptionInstrTradeCostField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pOptionInstrTradeCost","BrokerID",pOptionInstrTradeCost->BrokerID,dwTime);
      printString("pOptionInstrTradeCost","InvestorID",pOptionInstrTradeCost->InvestorID,dwTime);
      printString("pOptionInstrTradeCost","InstrumentID",pOptionInstrTradeCost->InstrumentID,dwTime);
      printNumber("pOptionInstrTradeCost","HedgeFlag",pOptionInstrTradeCost->HedgeFlag,dwTime);
      printNumber("pOptionInstrTradeCost","FixedMargin",pOptionInstrTradeCost->FixedMargin,dwTime);
      printNumber("pOptionInstrTradeCost","MiniMargin",pOptionInstrTradeCost->MiniMargin,dwTime);
      printNumber("pOptionInstrTradeCost","Royalty",pOptionInstrTradeCost->Royalty,dwTime);
      printNumber("pOptionInstrTradeCost","ExchFixedMargin",pOptionInstrTradeCost->ExchFixedMargin,dwTime);
      printNumber("pOptionInstrTradeCost","ExchMiniMargin",pOptionInstrTradeCost->ExchMiniMargin,dwTime);
      printString("pOptionInstrTradeCost","ExchangeID",pOptionInstrTradeCost->ExchangeID,dwTime);
      printString("pOptionInstrTradeCost","InvestUnitID",pOptionInstrTradeCost->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryOptionInstrTradeCost", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryOptionInstrTradeCost(self, pOptionInstrTradeCost, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询期权合约手续费响应
  virtual void  OnRspQryOptionInstrCommRate(CThostFtdcOptionInstrCommRateField *pOptionInstrCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryOptionInstrCommRate", "Enter", dwTime);

    if (NULL==pOptionInstrCommRate)
    {
      printString("pOptionInstrCommRate","CThostFtdcOptionInstrCommRateField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pOptionInstrCommRate","InstrumentID",pOptionInstrCommRate->InstrumentID,dwTime);
      printNumber("pOptionInstrCommRate","InvestorRange",pOptionInstrCommRate->InvestorRange,dwTime);
      printString("pOptionInstrCommRate","BrokerID",pOptionInstrCommRate->BrokerID,dwTime);
      printString("pOptionInstrCommRate","InvestorID",pOptionInstrCommRate->InvestorID,dwTime);
      printNumber("pOptionInstrCommRate","OpenRatioByMoney",pOptionInstrCommRate->OpenRatioByMoney,dwTime);
      printNumber("pOptionInstrCommRate","OpenRatioByVolume",pOptionInstrCommRate->OpenRatioByVolume,dwTime);
      printNumber("pOptionInstrCommRate","CloseRatioByMoney",pOptionInstrCommRate->CloseRatioByMoney,dwTime);
      printNumber("pOptionInstrCommRate","CloseRatioByVolume",pOptionInstrCommRate->CloseRatioByVolume,dwTime);
      printNumber("pOptionInstrCommRate","CloseTodayRatioByMoney",pOptionInstrCommRate->CloseTodayRatioByMoney,dwTime);
      printNumber("pOptionInstrCommRate","CloseTodayRatioByVolume",pOptionInstrCommRate->CloseTodayRatioByVolume,dwTime);
      printNumber("pOptionInstrCommRate","StrikeRatioByMoney",pOptionInstrCommRate->StrikeRatioByMoney,dwTime);
      printNumber("pOptionInstrCommRate","StrikeRatioByVolume",pOptionInstrCommRate->StrikeRatioByVolume,dwTime);
      printString("pOptionInstrCommRate","ExchangeID",pOptionInstrCommRate->ExchangeID,dwTime);
      printString("pOptionInstrCommRate","InvestUnitID",pOptionInstrCommRate->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryOptionInstrCommRate", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryOptionInstrCommRate(self, pOptionInstrCommRate, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询执行宣告响应
  virtual void  OnRspQryExecOrder(CThostFtdcExecOrderField *pExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryExecOrder", "Enter", dwTime);

    if (NULL==pExecOrder)
    {
      printString("pExecOrder","CThostFtdcExecOrderField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pExecOrder","BrokerID",pExecOrder->BrokerID,dwTime);
      printString("pExecOrder","InvestorID",pExecOrder->InvestorID,dwTime);
      printString("pExecOrder","InstrumentID",pExecOrder->InstrumentID,dwTime);
      printString("pExecOrder","ExecOrderRef",pExecOrder->ExecOrderRef,dwTime);
      printString("pExecOrder","UserID",pExecOrder->UserID,dwTime);
      printNumber("pExecOrder","Volume",pExecOrder->Volume,dwTime);
      printNumber("pExecOrder","RequestID",pExecOrder->RequestID,dwTime);
      printString("pExecOrder","BusinessUnit",pExecOrder->BusinessUnit,dwTime);
      printNumber("pExecOrder","OffsetFlag",pExecOrder->OffsetFlag,dwTime);
      printNumber("pExecOrder","HedgeFlag",pExecOrder->HedgeFlag,dwTime);
      printNumber("pExecOrder","ActionType",pExecOrder->ActionType,dwTime);
      printNumber("pExecOrder","PosiDirection",pExecOrder->PosiDirection,dwTime);
      printNumber("pExecOrder","ReservePositionFlag",pExecOrder->ReservePositionFlag,dwTime);
      printNumber("pExecOrder","CloseFlag",pExecOrder->CloseFlag,dwTime);
      printString("pExecOrder","ExecOrderLocalID",pExecOrder->ExecOrderLocalID,dwTime);
      printString("pExecOrder","ExchangeID",pExecOrder->ExchangeID,dwTime);
      printString("pExecOrder","ParticipantID",pExecOrder->ParticipantID,dwTime);
      printString("pExecOrder","ClientID",pExecOrder->ClientID,dwTime);
      printString("pExecOrder","ExchangeInstID",pExecOrder->ExchangeInstID,dwTime);
      printString("pExecOrder","TraderID",pExecOrder->TraderID,dwTime);
      printNumber("pExecOrder","InstallID",pExecOrder->InstallID,dwTime);
      printNumber("pExecOrder","OrderSubmitStatus",pExecOrder->OrderSubmitStatus,dwTime);
      printNumber("pExecOrder","NotifySequence",pExecOrder->NotifySequence,dwTime);
      printString("pExecOrder","TradingDay",pExecOrder->TradingDay,dwTime);
      printNumber("pExecOrder","SettlementID",pExecOrder->SettlementID,dwTime);
      printString("pExecOrder","ExecOrderSysID",pExecOrder->ExecOrderSysID,dwTime);
      printString("pExecOrder","InsertDate",pExecOrder->InsertDate,dwTime);
      printString("pExecOrder","InsertTime",pExecOrder->InsertTime,dwTime);
      printString("pExecOrder","CancelTime",pExecOrder->CancelTime,dwTime);
      printNumber("pExecOrder","ExecResult",pExecOrder->ExecResult,dwTime);
      printString("pExecOrder","ClearingPartID",pExecOrder->ClearingPartID,dwTime);
      printNumber("pExecOrder","SequenceNo",pExecOrder->SequenceNo,dwTime);
      printNumber("pExecOrder","FrontID",pExecOrder->FrontID,dwTime);
      printNumber("pExecOrder","SessionID",pExecOrder->SessionID,dwTime);
      printString("pExecOrder","UserProductInfo",pExecOrder->UserProductInfo,dwTime);
      printString("pExecOrder","StatusMsg",pExecOrder->StatusMsg,dwTime);
      printString("pExecOrder","ActiveUserID",pExecOrder->ActiveUserID,dwTime);
      printNumber("pExecOrder","BrokerExecOrderSeq",pExecOrder->BrokerExecOrderSeq,dwTime);
      printString("pExecOrder","BranchID",pExecOrder->BranchID,dwTime);
      printString("pExecOrder","InvestUnitID",pExecOrder->InvestUnitID,dwTime);
      printString("pExecOrder","AccountID",pExecOrder->AccountID,dwTime);
      printString("pExecOrder","CurrencyID",pExecOrder->CurrencyID,dwTime);
      printString("pExecOrder","IPAddress",pExecOrder->IPAddress,dwTime);
      printString("pExecOrder","MacAddress",pExecOrder->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryExecOrder", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryExecOrder(self, pExecOrder, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询询价响应
  virtual void  OnRspQryForQuote(CThostFtdcForQuoteField *pForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryForQuote", "Enter", dwTime);

    if (NULL==pForQuote)
    {
      printString("pForQuote","CThostFtdcForQuoteField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pForQuote","BrokerID",pForQuote->BrokerID,dwTime);
      printString("pForQuote","InvestorID",pForQuote->InvestorID,dwTime);
      printString("pForQuote","InstrumentID",pForQuote->InstrumentID,dwTime);
      printString("pForQuote","ForQuoteRef",pForQuote->ForQuoteRef,dwTime);
      printString("pForQuote","UserID",pForQuote->UserID,dwTime);
      printString("pForQuote","ForQuoteLocalID",pForQuote->ForQuoteLocalID,dwTime);
      printString("pForQuote","ExchangeID",pForQuote->ExchangeID,dwTime);
      printString("pForQuote","ParticipantID",pForQuote->ParticipantID,dwTime);
      printString("pForQuote","ClientID",pForQuote->ClientID,dwTime);
      printString("pForQuote","ExchangeInstID",pForQuote->ExchangeInstID,dwTime);
      printString("pForQuote","TraderID",pForQuote->TraderID,dwTime);
      printNumber("pForQuote","InstallID",pForQuote->InstallID,dwTime);
      printString("pForQuote","InsertDate",pForQuote->InsertDate,dwTime);
      printString("pForQuote","InsertTime",pForQuote->InsertTime,dwTime);
      printNumber("pForQuote","ForQuoteStatus",pForQuote->ForQuoteStatus,dwTime);
      printNumber("pForQuote","FrontID",pForQuote->FrontID,dwTime);
      printNumber("pForQuote","SessionID",pForQuote->SessionID,dwTime);
      printString("pForQuote","StatusMsg",pForQuote->StatusMsg,dwTime);
      printString("pForQuote","ActiveUserID",pForQuote->ActiveUserID,dwTime);
      printNumber("pForQuote","BrokerForQutoSeq",pForQuote->BrokerForQutoSeq,dwTime);
      printString("pForQuote","InvestUnitID",pForQuote->InvestUnitID,dwTime);
      printString("pForQuote","IPAddress",pForQuote->IPAddress,dwTime);
      printString("pForQuote","MacAddress",pForQuote->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryForQuote", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryForQuote(self, pForQuote, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询报价响应
  virtual void  OnRspQryQuote(CThostFtdcQuoteField *pQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryQuote", "Enter", dwTime);

    if (NULL==pQuote)
    {
      printString("pQuote","CThostFtdcQuoteField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pQuote","BrokerID",pQuote->BrokerID,dwTime);
      printString("pQuote","InvestorID",pQuote->InvestorID,dwTime);
      printString("pQuote","InstrumentID",pQuote->InstrumentID,dwTime);
      printString("pQuote","QuoteRef",pQuote->QuoteRef,dwTime);
      printString("pQuote","UserID",pQuote->UserID,dwTime);
      printNumber("pQuote","AskPrice",pQuote->AskPrice,dwTime);
      printNumber("pQuote","BidPrice",pQuote->BidPrice,dwTime);
      printNumber("pQuote","AskVolume",pQuote->AskVolume,dwTime);
      printNumber("pQuote","BidVolume",pQuote->BidVolume,dwTime);
      printNumber("pQuote","RequestID",pQuote->RequestID,dwTime);
      printString("pQuote","BusinessUnit",pQuote->BusinessUnit,dwTime);
      printNumber("pQuote","AskOffsetFlag",pQuote->AskOffsetFlag,dwTime);
      printNumber("pQuote","BidOffsetFlag",pQuote->BidOffsetFlag,dwTime);
      printNumber("pQuote","AskHedgeFlag",pQuote->AskHedgeFlag,dwTime);
      printNumber("pQuote","BidHedgeFlag",pQuote->BidHedgeFlag,dwTime);
      printString("pQuote","QuoteLocalID",pQuote->QuoteLocalID,dwTime);
      printString("pQuote","ExchangeID",pQuote->ExchangeID,dwTime);
      printString("pQuote","ParticipantID",pQuote->ParticipantID,dwTime);
      printString("pQuote","ClientID",pQuote->ClientID,dwTime);
      printString("pQuote","ExchangeInstID",pQuote->ExchangeInstID,dwTime);
      printString("pQuote","TraderID",pQuote->TraderID,dwTime);
      printNumber("pQuote","InstallID",pQuote->InstallID,dwTime);
      printNumber("pQuote","NotifySequence",pQuote->NotifySequence,dwTime);
      printNumber("pQuote","OrderSubmitStatus",pQuote->OrderSubmitStatus,dwTime);
      printString("pQuote","TradingDay",pQuote->TradingDay,dwTime);
      printNumber("pQuote","SettlementID",pQuote->SettlementID,dwTime);
      printString("pQuote","QuoteSysID",pQuote->QuoteSysID,dwTime);
      printString("pQuote","InsertDate",pQuote->InsertDate,dwTime);
      printString("pQuote","InsertTime",pQuote->InsertTime,dwTime);
      printString("pQuote","CancelTime",pQuote->CancelTime,dwTime);
      printNumber("pQuote","QuoteStatus",pQuote->QuoteStatus,dwTime);
      printString("pQuote","ClearingPartID",pQuote->ClearingPartID,dwTime);
      printNumber("pQuote","SequenceNo",pQuote->SequenceNo,dwTime);
      printString("pQuote","AskOrderSysID",pQuote->AskOrderSysID,dwTime);
      printString("pQuote","BidOrderSysID",pQuote->BidOrderSysID,dwTime);
      printNumber("pQuote","FrontID",pQuote->FrontID,dwTime);
      printNumber("pQuote","SessionID",pQuote->SessionID,dwTime);
      printString("pQuote","UserProductInfo",pQuote->UserProductInfo,dwTime);
      printString("pQuote","StatusMsg",pQuote->StatusMsg,dwTime);
      printString("pQuote","ActiveUserID",pQuote->ActiveUserID,dwTime);
      printNumber("pQuote","BrokerQuoteSeq",pQuote->BrokerQuoteSeq,dwTime);
      printString("pQuote","AskOrderRef",pQuote->AskOrderRef,dwTime);
      printString("pQuote","BidOrderRef",pQuote->BidOrderRef,dwTime);
      printString("pQuote","ForQuoteSysID",pQuote->ForQuoteSysID,dwTime);
      printString("pQuote","BranchID",pQuote->BranchID,dwTime);
      printString("pQuote","InvestUnitID",pQuote->InvestUnitID,dwTime);
      printString("pQuote","AccountID",pQuote->AccountID,dwTime);
      printString("pQuote","CurrencyID",pQuote->CurrencyID,dwTime);
      printString("pQuote","IPAddress",pQuote->IPAddress,dwTime);
      printString("pQuote","MacAddress",pQuote->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryQuote", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryQuote(self, pQuote, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询期权自对冲响应
  virtual void  OnRspQryOptionSelfClose(CThostFtdcOptionSelfCloseField *pOptionSelfClose, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryOptionSelfClose", "Enter", dwTime);

    if (NULL==pOptionSelfClose)
    {
      printString("pOptionSelfClose","CThostFtdcOptionSelfCloseField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pOptionSelfClose","BrokerID",pOptionSelfClose->BrokerID,dwTime);
      printString("pOptionSelfClose","InvestorID",pOptionSelfClose->InvestorID,dwTime);
      printString("pOptionSelfClose","InstrumentID",pOptionSelfClose->InstrumentID,dwTime);
      printString("pOptionSelfClose","OptionSelfCloseRef",pOptionSelfClose->OptionSelfCloseRef,dwTime);
      printString("pOptionSelfClose","UserID",pOptionSelfClose->UserID,dwTime);
      printNumber("pOptionSelfClose","Volume",pOptionSelfClose->Volume,dwTime);
      printNumber("pOptionSelfClose","RequestID",pOptionSelfClose->RequestID,dwTime);
      printString("pOptionSelfClose","BusinessUnit",pOptionSelfClose->BusinessUnit,dwTime);
      printNumber("pOptionSelfClose","HedgeFlag",pOptionSelfClose->HedgeFlag,dwTime);
      printNumber("pOptionSelfClose","OptSelfCloseFlag",pOptionSelfClose->OptSelfCloseFlag,dwTime);
      printString("pOptionSelfClose","OptionSelfCloseLocalID",pOptionSelfClose->OptionSelfCloseLocalID,dwTime);
      printString("pOptionSelfClose","ExchangeID",pOptionSelfClose->ExchangeID,dwTime);
      printString("pOptionSelfClose","ParticipantID",pOptionSelfClose->ParticipantID,dwTime);
      printString("pOptionSelfClose","ClientID",pOptionSelfClose->ClientID,dwTime);
      printString("pOptionSelfClose","ExchangeInstID",pOptionSelfClose->ExchangeInstID,dwTime);
      printString("pOptionSelfClose","TraderID",pOptionSelfClose->TraderID,dwTime);
      printNumber("pOptionSelfClose","InstallID",pOptionSelfClose->InstallID,dwTime);
      printNumber("pOptionSelfClose","OrderSubmitStatus",pOptionSelfClose->OrderSubmitStatus,dwTime);
      printNumber("pOptionSelfClose","NotifySequence",pOptionSelfClose->NotifySequence,dwTime);
      printString("pOptionSelfClose","TradingDay",pOptionSelfClose->TradingDay,dwTime);
      printNumber("pOptionSelfClose","SettlementID",pOptionSelfClose->SettlementID,dwTime);
      printString("pOptionSelfClose","OptionSelfCloseSysID",pOptionSelfClose->OptionSelfCloseSysID,dwTime);
      printString("pOptionSelfClose","InsertDate",pOptionSelfClose->InsertDate,dwTime);
      printString("pOptionSelfClose","InsertTime",pOptionSelfClose->InsertTime,dwTime);
      printString("pOptionSelfClose","CancelTime",pOptionSelfClose->CancelTime,dwTime);
      printNumber("pOptionSelfClose","ExecResult",pOptionSelfClose->ExecResult,dwTime);
      printString("pOptionSelfClose","ClearingPartID",pOptionSelfClose->ClearingPartID,dwTime);
      printNumber("pOptionSelfClose","SequenceNo",pOptionSelfClose->SequenceNo,dwTime);
      printNumber("pOptionSelfClose","FrontID",pOptionSelfClose->FrontID,dwTime);
      printNumber("pOptionSelfClose","SessionID",pOptionSelfClose->SessionID,dwTime);
      printString("pOptionSelfClose","UserProductInfo",pOptionSelfClose->UserProductInfo,dwTime);
      printString("pOptionSelfClose","StatusMsg",pOptionSelfClose->StatusMsg,dwTime);
      printString("pOptionSelfClose","ActiveUserID",pOptionSelfClose->ActiveUserID,dwTime);
      printNumber("pOptionSelfClose","BrokerOptionSelfCloseSeq",pOptionSelfClose->BrokerOptionSelfCloseSeq,dwTime);
      printString("pOptionSelfClose","BranchID",pOptionSelfClose->BranchID,dwTime);
      printString("pOptionSelfClose","InvestUnitID",pOptionSelfClose->InvestUnitID,dwTime);
      printString("pOptionSelfClose","AccountID",pOptionSelfClose->AccountID,dwTime);
      printString("pOptionSelfClose","CurrencyID",pOptionSelfClose->CurrencyID,dwTime);
      printString("pOptionSelfClose","IPAddress",pOptionSelfClose->IPAddress,dwTime);
      printString("pOptionSelfClose","MacAddress",pOptionSelfClose->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryOptionSelfClose", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryOptionSelfClose(self, pOptionSelfClose, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询投资单元响应
  virtual void  OnRspQryInvestUnit(CThostFtdcInvestUnitField *pInvestUnit, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryInvestUnit", "Enter", dwTime);

    if (NULL==pInvestUnit)
    {
      printString("pInvestUnit","CThostFtdcInvestUnitField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInvestUnit","BrokerID",pInvestUnit->BrokerID,dwTime);
      printString("pInvestUnit","InvestorID",pInvestUnit->InvestorID,dwTime);
      printString("pInvestUnit","InvestUnitID",pInvestUnit->InvestUnitID,dwTime);
      printString("pInvestUnit","InvestorUnitName",pInvestUnit->InvestorUnitName,dwTime);
      printString("pInvestUnit","InvestorGroupID",pInvestUnit->InvestorGroupID,dwTime);
      printString("pInvestUnit","CommModelID",pInvestUnit->CommModelID,dwTime);
      printString("pInvestUnit","MarginModelID",pInvestUnit->MarginModelID,dwTime);
      printString("pInvestUnit","AccountID",pInvestUnit->AccountID,dwTime);
      printString("pInvestUnit","CurrencyID",pInvestUnit->CurrencyID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryInvestUnit", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryInvestUnit(self, pInvestUnit, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询组合合约安全系数响应
  virtual void  OnRspQryCombInstrumentGuard(CThostFtdcCombInstrumentGuardField *pCombInstrumentGuard, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryCombInstrumentGuard", "Enter", dwTime);

    if (NULL==pCombInstrumentGuard)
    {
      printString("pCombInstrumentGuard","CThostFtdcCombInstrumentGuardField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pCombInstrumentGuard","BrokerID",pCombInstrumentGuard->BrokerID,dwTime);
      printString("pCombInstrumentGuard","InstrumentID",pCombInstrumentGuard->InstrumentID,dwTime);
      printNumber("pCombInstrumentGuard","GuarantRatio",pCombInstrumentGuard->GuarantRatio,dwTime);
      printString("pCombInstrumentGuard","ExchangeID",pCombInstrumentGuard->ExchangeID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryCombInstrumentGuard", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryCombInstrumentGuard(self, pCombInstrumentGuard, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询申请组合响应
  virtual void  OnRspQryCombAction(CThostFtdcCombActionField *pCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryCombAction", "Enter", dwTime);

    if (NULL==pCombAction)
    {
      printString("pCombAction","CThostFtdcCombActionField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pCombAction","BrokerID",pCombAction->BrokerID,dwTime);
      printString("pCombAction","InvestorID",pCombAction->InvestorID,dwTime);
      printString("pCombAction","InstrumentID",pCombAction->InstrumentID,dwTime);
      printString("pCombAction","CombActionRef",pCombAction->CombActionRef,dwTime);
      printString("pCombAction","UserID",pCombAction->UserID,dwTime);
      printNumber("pCombAction","Direction",pCombAction->Direction,dwTime);
      printNumber("pCombAction","Volume",pCombAction->Volume,dwTime);
      printNumber("pCombAction","CombDirection",pCombAction->CombDirection,dwTime);
      printNumber("pCombAction","HedgeFlag",pCombAction->HedgeFlag,dwTime);
      printString("pCombAction","ActionLocalID",pCombAction->ActionLocalID,dwTime);
      printString("pCombAction","ExchangeID",pCombAction->ExchangeID,dwTime);
      printString("pCombAction","ParticipantID",pCombAction->ParticipantID,dwTime);
      printString("pCombAction","ClientID",pCombAction->ClientID,dwTime);
      printString("pCombAction","ExchangeInstID",pCombAction->ExchangeInstID,dwTime);
      printString("pCombAction","TraderID",pCombAction->TraderID,dwTime);
      printNumber("pCombAction","InstallID",pCombAction->InstallID,dwTime);
      printNumber("pCombAction","ActionStatus",pCombAction->ActionStatus,dwTime);
      printNumber("pCombAction","NotifySequence",pCombAction->NotifySequence,dwTime);
      printString("pCombAction","TradingDay",pCombAction->TradingDay,dwTime);
      printNumber("pCombAction","SettlementID",pCombAction->SettlementID,dwTime);
      printNumber("pCombAction","SequenceNo",pCombAction->SequenceNo,dwTime);
      printNumber("pCombAction","FrontID",pCombAction->FrontID,dwTime);
      printNumber("pCombAction","SessionID",pCombAction->SessionID,dwTime);
      printString("pCombAction","UserProductInfo",pCombAction->UserProductInfo,dwTime);
      printString("pCombAction","StatusMsg",pCombAction->StatusMsg,dwTime);
      printString("pCombAction","IPAddress",pCombAction->IPAddress,dwTime);
      printString("pCombAction","MacAddress",pCombAction->MacAddress,dwTime);
      printString("pCombAction","ComTradeID",pCombAction->ComTradeID,dwTime);
      printString("pCombAction","BranchID",pCombAction->BranchID,dwTime);
      printString("pCombAction","InvestUnitID",pCombAction->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryCombAction", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryCombAction(self, pCombAction, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询转帐流水响应
  virtual void  OnRspQryTransferSerial(CThostFtdcTransferSerialField *pTransferSerial, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryTransferSerial", "Enter", dwTime);

    if (NULL==pTransferSerial)
    {
      printString("pTransferSerial","CThostFtdcTransferSerialField","NULL",dwTime);
      return;
    }
    else
    {
      printNumber("pTransferSerial","PlateSerial",pTransferSerial->PlateSerial,dwTime);
      printString("pTransferSerial","TradeDate",pTransferSerial->TradeDate,dwTime);
      printString("pTransferSerial","TradingDay",pTransferSerial->TradingDay,dwTime);
      printString("pTransferSerial","TradeTime",pTransferSerial->TradeTime,dwTime);
      printString("pTransferSerial","TradeCode",pTransferSerial->TradeCode,dwTime);
      printNumber("pTransferSerial","SessionID",pTransferSerial->SessionID,dwTime);
      printString("pTransferSerial","BankID",pTransferSerial->BankID,dwTime);
      printString("pTransferSerial","BankBranchID",pTransferSerial->BankBranchID,dwTime);
      printNumber("pTransferSerial","BankAccType",pTransferSerial->BankAccType,dwTime);
      printString("pTransferSerial","BankAccount",pTransferSerial->BankAccount,dwTime);
      printString("pTransferSerial","BankSerial",pTransferSerial->BankSerial,dwTime);
      printString("pTransferSerial","BrokerID",pTransferSerial->BrokerID,dwTime);
      printString("pTransferSerial","BrokerBranchID",pTransferSerial->BrokerBranchID,dwTime);
      printNumber("pTransferSerial","FutureAccType",pTransferSerial->FutureAccType,dwTime);
      printString("pTransferSerial","AccountID",pTransferSerial->AccountID,dwTime);
      printString("pTransferSerial","InvestorID",pTransferSerial->InvestorID,dwTime);
      printNumber("pTransferSerial","FutureSerial",pTransferSerial->FutureSerial,dwTime);
      printNumber("pTransferSerial","IdCardType",pTransferSerial->IdCardType,dwTime);
      printString("pTransferSerial","IdentifiedCardNo",pTransferSerial->IdentifiedCardNo,dwTime);
      printString("pTransferSerial","CurrencyID",pTransferSerial->CurrencyID,dwTime);
      printNumber("pTransferSerial","TradeAmount",pTransferSerial->TradeAmount,dwTime);
      printNumber("pTransferSerial","CustFee",pTransferSerial->CustFee,dwTime);
      printNumber("pTransferSerial","BrokerFee",pTransferSerial->BrokerFee,dwTime);
      printNumber("pTransferSerial","AvailabilityFlag",pTransferSerial->AvailabilityFlag,dwTime);
      printString("pTransferSerial","OperatorCode",pTransferSerial->OperatorCode,dwTime);
      printString("pTransferSerial","BankNewAccount",pTransferSerial->BankNewAccount,dwTime);
      printNumber("pTransferSerial","ErrorID",pTransferSerial->ErrorID,dwTime);
      printString("pTransferSerial","ErrorMsg",pTransferSerial->ErrorMsg,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryTransferSerial", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryTransferSerial(self, pTransferSerial, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询银期签约关系响应
  virtual void  OnRspQryAccountregister(CThostFtdcAccountregisterField *pAccountregister, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryAccountregister", "Enter", dwTime);

    if (NULL==pAccountregister)
    {
      printString("pAccountregister","CThostFtdcAccountregisterField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pAccountregister","TradeDay",pAccountregister->TradeDay,dwTime);
      printString("pAccountregister","BankID",pAccountregister->BankID,dwTime);
      printString("pAccountregister","BankBranchID",pAccountregister->BankBranchID,dwTime);
      printString("pAccountregister","BankAccount",pAccountregister->BankAccount,dwTime);
      printString("pAccountregister","BrokerID",pAccountregister->BrokerID,dwTime);
      printString("pAccountregister","BrokerBranchID",pAccountregister->BrokerBranchID,dwTime);
      printString("pAccountregister","AccountID",pAccountregister->AccountID,dwTime);
      printNumber("pAccountregister","IdCardType",pAccountregister->IdCardType,dwTime);
      printString("pAccountregister","IdentifiedCardNo",pAccountregister->IdentifiedCardNo,dwTime);
      printString("pAccountregister","CustomerName",pAccountregister->CustomerName,dwTime);
      printString("pAccountregister","CurrencyID",pAccountregister->CurrencyID,dwTime);
      printNumber("pAccountregister","OpenOrDestroy",pAccountregister->OpenOrDestroy,dwTime);
      printString("pAccountregister","RegDate",pAccountregister->RegDate,dwTime);
      printString("pAccountregister","OutDate",pAccountregister->OutDate,dwTime);
      printNumber("pAccountregister","TID",pAccountregister->TID,dwTime);
      printNumber("pAccountregister","CustType",pAccountregister->CustType,dwTime);
      printNumber("pAccountregister","BankAccType",pAccountregister->BankAccType,dwTime);
      printString("pAccountregister","LongCustomerName",pAccountregister->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryAccountregister", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryAccountregister(self, pAccountregister, pRspInfo, nRequestID, bIsLast);

  };

  ///错误应答
  virtual void  OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspError", "Enter", dwTime);

    if (NULL==pRspInfo)
    {
      printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
      return;
    }
    else
    {
      printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
      printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspError", "Leave", dwTime);

    TraderSpi_OnRspError(self, pRspInfo, nRequestID, bIsLast);

  };

  ///报单通知
  virtual void  OnRtnOrder(CThostFtdcOrderField *pOrder) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnOrder", "Enter", dwTime);

    if (NULL==pOrder)
    {
      printString("pOrder","CThostFtdcOrderField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pOrder","BrokerID",pOrder->BrokerID,dwTime);
      printString("pOrder","InvestorID",pOrder->InvestorID,dwTime);
      printString("pOrder","InstrumentID",pOrder->InstrumentID,dwTime);
      printString("pOrder","OrderRef",pOrder->OrderRef,dwTime);
      printString("pOrder","UserID",pOrder->UserID,dwTime);
      printNumber("pOrder","OrderPriceType",pOrder->OrderPriceType,dwTime);
      printNumber("pOrder","Direction",pOrder->Direction,dwTime);
      printString("pOrder","CombOffsetFlag",pOrder->CombOffsetFlag,dwTime);
      printString("pOrder","CombHedgeFlag",pOrder->CombHedgeFlag,dwTime);
      printNumber("pOrder","LimitPrice",pOrder->LimitPrice,dwTime);
      printNumber("pOrder","VolumeTotalOriginal",pOrder->VolumeTotalOriginal,dwTime);
      printNumber("pOrder","TimeCondition",pOrder->TimeCondition,dwTime);
      printString("pOrder","GTDDate",pOrder->GTDDate,dwTime);
      printNumber("pOrder","VolumeCondition",pOrder->VolumeCondition,dwTime);
      printNumber("pOrder","MinVolume",pOrder->MinVolume,dwTime);
      printNumber("pOrder","ContingentCondition",pOrder->ContingentCondition,dwTime);
      printNumber("pOrder","StopPrice",pOrder->StopPrice,dwTime);
      printNumber("pOrder","ForceCloseReason",pOrder->ForceCloseReason,dwTime);
      printNumber("pOrder","IsAutoSuspend",pOrder->IsAutoSuspend,dwTime);
      printString("pOrder","BusinessUnit",pOrder->BusinessUnit,dwTime);
      printNumber("pOrder","RequestID",pOrder->RequestID,dwTime);
      printString("pOrder","OrderLocalID",pOrder->OrderLocalID,dwTime);
      printString("pOrder","ExchangeID",pOrder->ExchangeID,dwTime);
      printString("pOrder","ParticipantID",pOrder->ParticipantID,dwTime);
      printString("pOrder","ClientID",pOrder->ClientID,dwTime);
      printString("pOrder","ExchangeInstID",pOrder->ExchangeInstID,dwTime);
      printString("pOrder","TraderID",pOrder->TraderID,dwTime);
      printNumber("pOrder","InstallID",pOrder->InstallID,dwTime);
      printNumber("pOrder","OrderSubmitStatus",pOrder->OrderSubmitStatus,dwTime);
      printNumber("pOrder","NotifySequence",pOrder->NotifySequence,dwTime);
      printString("pOrder","TradingDay",pOrder->TradingDay,dwTime);
      printNumber("pOrder","SettlementID",pOrder->SettlementID,dwTime);
      printString("pOrder","OrderSysID",pOrder->OrderSysID,dwTime);
      printNumber("pOrder","OrderSource",pOrder->OrderSource,dwTime);
      printNumber("pOrder","OrderStatus",pOrder->OrderStatus,dwTime);
      printNumber("pOrder","OrderType",pOrder->OrderType,dwTime);
      printNumber("pOrder","VolumeTraded",pOrder->VolumeTraded,dwTime);
      printNumber("pOrder","VolumeTotal",pOrder->VolumeTotal,dwTime);
      printString("pOrder","InsertDate",pOrder->InsertDate,dwTime);
      printString("pOrder","InsertTime",pOrder->InsertTime,dwTime);
      printString("pOrder","ActiveTime",pOrder->ActiveTime,dwTime);
      printString("pOrder","SuspendTime",pOrder->SuspendTime,dwTime);
      printString("pOrder","UpdateTime",pOrder->UpdateTime,dwTime);
      printString("pOrder","CancelTime",pOrder->CancelTime,dwTime);
      printString("pOrder","ActiveTraderID",pOrder->ActiveTraderID,dwTime);
      printString("pOrder","ClearingPartID",pOrder->ClearingPartID,dwTime);
      printNumber("pOrder","SequenceNo",pOrder->SequenceNo,dwTime);
      printNumber("pOrder","FrontID",pOrder->FrontID,dwTime);
      printNumber("pOrder","SessionID",pOrder->SessionID,dwTime);
      printString("pOrder","UserProductInfo",pOrder->UserProductInfo,dwTime);
      printString("pOrder","StatusMsg",pOrder->StatusMsg,dwTime);
      printNumber("pOrder","UserForceClose",pOrder->UserForceClose,dwTime);
      printString("pOrder","ActiveUserID",pOrder->ActiveUserID,dwTime);
      printNumber("pOrder","BrokerOrderSeq",pOrder->BrokerOrderSeq,dwTime);
      printString("pOrder","RelativeOrderSysID",pOrder->RelativeOrderSysID,dwTime);
      printNumber("pOrder","ZCETotalTradedVolume",pOrder->ZCETotalTradedVolume,dwTime);
      printNumber("pOrder","IsSwapOrder",pOrder->IsSwapOrder,dwTime);
      printString("pOrder","BranchID",pOrder->BranchID,dwTime);
      printString("pOrder","InvestUnitID",pOrder->InvestUnitID,dwTime);
      printString("pOrder","AccountID",pOrder->AccountID,dwTime);
      printString("pOrder","CurrencyID",pOrder->CurrencyID,dwTime);
      printString("pOrder","IPAddress",pOrder->IPAddress,dwTime);
      printString("pOrder","MacAddress",pOrder->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnOrder", "Leave", dwTime);

    TraderSpi_OnRtnOrder(self, pOrder);

  };

  ///成交通知
  virtual void  OnRtnTrade(CThostFtdcTradeField *pTrade) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnTrade", "Enter", dwTime);

    if (NULL==pTrade)
    {
      printString("pTrade","CThostFtdcTradeField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pTrade","BrokerID",pTrade->BrokerID,dwTime);
      printString("pTrade","InvestorID",pTrade->InvestorID,dwTime);
      printString("pTrade","InstrumentID",pTrade->InstrumentID,dwTime);
      printString("pTrade","OrderRef",pTrade->OrderRef,dwTime);
      printString("pTrade","UserID",pTrade->UserID,dwTime);
      printString("pTrade","ExchangeID",pTrade->ExchangeID,dwTime);
      printString("pTrade","TradeID",pTrade->TradeID,dwTime);
      printNumber("pTrade","Direction",pTrade->Direction,dwTime);
      printString("pTrade","OrderSysID",pTrade->OrderSysID,dwTime);
      printString("pTrade","ParticipantID",pTrade->ParticipantID,dwTime);
      printString("pTrade","ClientID",pTrade->ClientID,dwTime);
      printNumber("pTrade","TradingRole",pTrade->TradingRole,dwTime);
      printString("pTrade","ExchangeInstID",pTrade->ExchangeInstID,dwTime);
      printNumber("pTrade","OffsetFlag",pTrade->OffsetFlag,dwTime);
      printNumber("pTrade","HedgeFlag",pTrade->HedgeFlag,dwTime);
      printNumber("pTrade","Price",pTrade->Price,dwTime);
      printNumber("pTrade","Volume",pTrade->Volume,dwTime);
      printString("pTrade","TradeDate",pTrade->TradeDate,dwTime);
      printString("pTrade","TradeTime",pTrade->TradeTime,dwTime);
      printNumber("pTrade","TradeType",pTrade->TradeType,dwTime);
      printNumber("pTrade","PriceSource",pTrade->PriceSource,dwTime);
      printString("pTrade","TraderID",pTrade->TraderID,dwTime);
      printString("pTrade","OrderLocalID",pTrade->OrderLocalID,dwTime);
      printString("pTrade","ClearingPartID",pTrade->ClearingPartID,dwTime);
      printString("pTrade","BusinessUnit",pTrade->BusinessUnit,dwTime);
      printNumber("pTrade","SequenceNo",pTrade->SequenceNo,dwTime);
      printString("pTrade","TradingDay",pTrade->TradingDay,dwTime);
      printNumber("pTrade","SettlementID",pTrade->SettlementID,dwTime);
      printNumber("pTrade","BrokerOrderSeq",pTrade->BrokerOrderSeq,dwTime);
      printNumber("pTrade","TradeSource",pTrade->TradeSource,dwTime);
      printString("pTrade","InvestUnitID",pTrade->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnTrade", "Leave", dwTime);

    TraderSpi_OnRtnTrade(self, pTrade);

  };

  ///报单录入错误回报
  virtual void  OnErrRtnOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnErrRtnOrderInsert", "Enter", dwTime);

    if (NULL==pInputOrder)
    {
      printString("pInputOrder","CThostFtdcInputOrderField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInputOrder","BrokerID",pInputOrder->BrokerID,dwTime);
      printString("pInputOrder","InvestorID",pInputOrder->InvestorID,dwTime);
      printString("pInputOrder","InstrumentID",pInputOrder->InstrumentID,dwTime);
      printString("pInputOrder","OrderRef",pInputOrder->OrderRef,dwTime);
      printString("pInputOrder","UserID",pInputOrder->UserID,dwTime);
      printNumber("pInputOrder","OrderPriceType",pInputOrder->OrderPriceType,dwTime);
      printNumber("pInputOrder","Direction",pInputOrder->Direction,dwTime);
      printString("pInputOrder","CombOffsetFlag",pInputOrder->CombOffsetFlag,dwTime);
      printString("pInputOrder","CombHedgeFlag",pInputOrder->CombHedgeFlag,dwTime);
      printNumber("pInputOrder","LimitPrice",pInputOrder->LimitPrice,dwTime);
      printNumber("pInputOrder","VolumeTotalOriginal",pInputOrder->VolumeTotalOriginal,dwTime);
      printNumber("pInputOrder","TimeCondition",pInputOrder->TimeCondition,dwTime);
      printString("pInputOrder","GTDDate",pInputOrder->GTDDate,dwTime);
      printNumber("pInputOrder","VolumeCondition",pInputOrder->VolumeCondition,dwTime);
      printNumber("pInputOrder","MinVolume",pInputOrder->MinVolume,dwTime);
      printNumber("pInputOrder","ContingentCondition",pInputOrder->ContingentCondition,dwTime);
      printNumber("pInputOrder","StopPrice",pInputOrder->StopPrice,dwTime);
      printNumber("pInputOrder","ForceCloseReason",pInputOrder->ForceCloseReason,dwTime);
      printNumber("pInputOrder","IsAutoSuspend",pInputOrder->IsAutoSuspend,dwTime);
      printString("pInputOrder","BusinessUnit",pInputOrder->BusinessUnit,dwTime);
      printNumber("pInputOrder","RequestID",pInputOrder->RequestID,dwTime);
      printNumber("pInputOrder","UserForceClose",pInputOrder->UserForceClose,dwTime);
      printNumber("pInputOrder","IsSwapOrder",pInputOrder->IsSwapOrder,dwTime);
      printString("pInputOrder","ExchangeID",pInputOrder->ExchangeID,dwTime);
      printString("pInputOrder","InvestUnitID",pInputOrder->InvestUnitID,dwTime);
      printString("pInputOrder","AccountID",pInputOrder->AccountID,dwTime);
      printString("pInputOrder","CurrencyID",pInputOrder->CurrencyID,dwTime);
      printString("pInputOrder","ClientID",pInputOrder->ClientID,dwTime);
      printString("pInputOrder","IPAddress",pInputOrder->IPAddress,dwTime);
      printString("pInputOrder","MacAddress",pInputOrder->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnErrRtnOrderInsert", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnErrRtnOrderInsert(self, pInputOrder, pRspInfo);

  };

  ///报单操作错误回报
  virtual void  OnErrRtnOrderAction(CThostFtdcOrderActionField *pOrderAction, CThostFtdcRspInfoField *pRspInfo) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnErrRtnOrderAction", "Enter", dwTime);

    if (NULL==pOrderAction)
    {
      printString("pOrderAction","CThostFtdcOrderActionField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pOrderAction","BrokerID",pOrderAction->BrokerID,dwTime);
      printString("pOrderAction","InvestorID",pOrderAction->InvestorID,dwTime);
      printNumber("pOrderAction","OrderActionRef",pOrderAction->OrderActionRef,dwTime);
      printString("pOrderAction","OrderRef",pOrderAction->OrderRef,dwTime);
      printNumber("pOrderAction","RequestID",pOrderAction->RequestID,dwTime);
      printNumber("pOrderAction","FrontID",pOrderAction->FrontID,dwTime);
      printNumber("pOrderAction","SessionID",pOrderAction->SessionID,dwTime);
      printString("pOrderAction","ExchangeID",pOrderAction->ExchangeID,dwTime);
      printString("pOrderAction","OrderSysID",pOrderAction->OrderSysID,dwTime);
      printNumber("pOrderAction","ActionFlag",pOrderAction->ActionFlag,dwTime);
      printNumber("pOrderAction","LimitPrice",pOrderAction->LimitPrice,dwTime);
      printNumber("pOrderAction","VolumeChange",pOrderAction->VolumeChange,dwTime);
      printString("pOrderAction","ActionDate",pOrderAction->ActionDate,dwTime);
      printString("pOrderAction","ActionTime",pOrderAction->ActionTime,dwTime);
      printString("pOrderAction","TraderID",pOrderAction->TraderID,dwTime);
      printNumber("pOrderAction","InstallID",pOrderAction->InstallID,dwTime);
      printString("pOrderAction","OrderLocalID",pOrderAction->OrderLocalID,dwTime);
      printString("pOrderAction","ActionLocalID",pOrderAction->ActionLocalID,dwTime);
      printString("pOrderAction","ParticipantID",pOrderAction->ParticipantID,dwTime);
      printString("pOrderAction","ClientID",pOrderAction->ClientID,dwTime);
      printString("pOrderAction","BusinessUnit",pOrderAction->BusinessUnit,dwTime);
      printNumber("pOrderAction","OrderActionStatus",pOrderAction->OrderActionStatus,dwTime);
      printString("pOrderAction","UserID",pOrderAction->UserID,dwTime);
      printString("pOrderAction","StatusMsg",pOrderAction->StatusMsg,dwTime);
      printString("pOrderAction","InstrumentID",pOrderAction->InstrumentID,dwTime);
      printString("pOrderAction","BranchID",pOrderAction->BranchID,dwTime);
      printString("pOrderAction","InvestUnitID",pOrderAction->InvestUnitID,dwTime);
      printString("pOrderAction","IPAddress",pOrderAction->IPAddress,dwTime);
      printString("pOrderAction","MacAddress",pOrderAction->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnErrRtnOrderAction", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnErrRtnOrderAction(self, pOrderAction, pRspInfo);

  };

  ///合约交易状态通知
  virtual void  OnRtnInstrumentStatus(CThostFtdcInstrumentStatusField *pInstrumentStatus) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnInstrumentStatus", "Enter", dwTime);

    if (NULL==pInstrumentStatus)
    {
      printString("pInstrumentStatus","CThostFtdcInstrumentStatusField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInstrumentStatus","ExchangeID",pInstrumentStatus->ExchangeID,dwTime);
      printString("pInstrumentStatus","ExchangeInstID",pInstrumentStatus->ExchangeInstID,dwTime);
      printString("pInstrumentStatus","SettlementGroupID",pInstrumentStatus->SettlementGroupID,dwTime);
      printString("pInstrumentStatus","InstrumentID",pInstrumentStatus->InstrumentID,dwTime);
      printNumber("pInstrumentStatus","InstrumentStatus",pInstrumentStatus->InstrumentStatus,dwTime);
      printNumber("pInstrumentStatus","TradingSegmentSN",pInstrumentStatus->TradingSegmentSN,dwTime);
      printString("pInstrumentStatus","EnterTime",pInstrumentStatus->EnterTime,dwTime);
      printNumber("pInstrumentStatus","EnterReason",pInstrumentStatus->EnterReason,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnInstrumentStatus", "Leave", dwTime);

    TraderSpi_OnRtnInstrumentStatus(self, pInstrumentStatus);

  };

  ///交易所公告通知
  virtual void  OnRtnBulletin(CThostFtdcBulletinField *pBulletin) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnBulletin", "Enter", dwTime);

    if (NULL==pBulletin)
    {
      printString("pBulletin","CThostFtdcBulletinField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pBulletin","ExchangeID",pBulletin->ExchangeID,dwTime);
      printString("pBulletin","TradingDay",pBulletin->TradingDay,dwTime);
      printNumber("pBulletin","BulletinID",pBulletin->BulletinID,dwTime);
      printNumber("pBulletin","SequenceNo",pBulletin->SequenceNo,dwTime);
      printString("pBulletin","NewsType",pBulletin->NewsType,dwTime);
      printNumber("pBulletin","NewsUrgency",pBulletin->NewsUrgency,dwTime);
      printString("pBulletin","SendTime",pBulletin->SendTime,dwTime);
      printString("pBulletin","Abstract",pBulletin->Abstract,dwTime);
      printString("pBulletin","ComeFrom",pBulletin->ComeFrom,dwTime);
      printString("pBulletin","Content",pBulletin->Content,dwTime);
      printString("pBulletin","URLLink",pBulletin->URLLink,dwTime);
      printString("pBulletin","MarketID",pBulletin->MarketID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnBulletin", "Leave", dwTime);

    TraderSpi_OnRtnBulletin(self, pBulletin);

  };

  ///交易通知
  virtual void  OnRtnTradingNotice(CThostFtdcTradingNoticeInfoField *pTradingNoticeInfo) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnTradingNotice", "Enter", dwTime);

    if (NULL==pTradingNoticeInfo)
    {
      printString("pTradingNoticeInfo","CThostFtdcTradingNoticeInfoField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pTradingNoticeInfo","BrokerID",pTradingNoticeInfo->BrokerID,dwTime);
      printString("pTradingNoticeInfo","InvestorID",pTradingNoticeInfo->InvestorID,dwTime);
      printString("pTradingNoticeInfo","SendTime",pTradingNoticeInfo->SendTime,dwTime);
      printString("pTradingNoticeInfo","FieldContent",pTradingNoticeInfo->FieldContent,dwTime);
      printNumber("pTradingNoticeInfo","SequenceSeries",pTradingNoticeInfo->SequenceSeries,dwTime);
      printNumber("pTradingNoticeInfo","SequenceNo",pTradingNoticeInfo->SequenceNo,dwTime);
      printString("pTradingNoticeInfo","InvestUnitID",pTradingNoticeInfo->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnTradingNotice", "Leave", dwTime);

    TraderSpi_OnRtnTradingNotice(self, pTradingNoticeInfo);

  };

  ///提示条件单校验错误
  virtual void  OnRtnErrorConditionalOrder(CThostFtdcErrorConditionalOrderField *pErrorConditionalOrder) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnErrorConditionalOrder", "Enter", dwTime);

    if (NULL==pErrorConditionalOrder)
    {
      printString("pErrorConditionalOrder","CThostFtdcErrorConditionalOrderField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pErrorConditionalOrder","BrokerID",pErrorConditionalOrder->BrokerID,dwTime);
      printString("pErrorConditionalOrder","InvestorID",pErrorConditionalOrder->InvestorID,dwTime);
      printString("pErrorConditionalOrder","InstrumentID",pErrorConditionalOrder->InstrumentID,dwTime);
      printString("pErrorConditionalOrder","OrderRef",pErrorConditionalOrder->OrderRef,dwTime);
      printString("pErrorConditionalOrder","UserID",pErrorConditionalOrder->UserID,dwTime);
      printNumber("pErrorConditionalOrder","OrderPriceType",pErrorConditionalOrder->OrderPriceType,dwTime);
      printNumber("pErrorConditionalOrder","Direction",pErrorConditionalOrder->Direction,dwTime);
      printString("pErrorConditionalOrder","CombOffsetFlag",pErrorConditionalOrder->CombOffsetFlag,dwTime);
      printString("pErrorConditionalOrder","CombHedgeFlag",pErrorConditionalOrder->CombHedgeFlag,dwTime);
      printNumber("pErrorConditionalOrder","LimitPrice",pErrorConditionalOrder->LimitPrice,dwTime);
      printNumber("pErrorConditionalOrder","VolumeTotalOriginal",pErrorConditionalOrder->VolumeTotalOriginal,dwTime);
      printNumber("pErrorConditionalOrder","TimeCondition",pErrorConditionalOrder->TimeCondition,dwTime);
      printString("pErrorConditionalOrder","GTDDate",pErrorConditionalOrder->GTDDate,dwTime);
      printNumber("pErrorConditionalOrder","VolumeCondition",pErrorConditionalOrder->VolumeCondition,dwTime);
      printNumber("pErrorConditionalOrder","MinVolume",pErrorConditionalOrder->MinVolume,dwTime);
      printNumber("pErrorConditionalOrder","ContingentCondition",pErrorConditionalOrder->ContingentCondition,dwTime);
      printNumber("pErrorConditionalOrder","StopPrice",pErrorConditionalOrder->StopPrice,dwTime);
      printNumber("pErrorConditionalOrder","ForceCloseReason",pErrorConditionalOrder->ForceCloseReason,dwTime);
      printNumber("pErrorConditionalOrder","IsAutoSuspend",pErrorConditionalOrder->IsAutoSuspend,dwTime);
      printString("pErrorConditionalOrder","BusinessUnit",pErrorConditionalOrder->BusinessUnit,dwTime);
      printNumber("pErrorConditionalOrder","RequestID",pErrorConditionalOrder->RequestID,dwTime);
      printString("pErrorConditionalOrder","OrderLocalID",pErrorConditionalOrder->OrderLocalID,dwTime);
      printString("pErrorConditionalOrder","ExchangeID",pErrorConditionalOrder->ExchangeID,dwTime);
      printString("pErrorConditionalOrder","ParticipantID",pErrorConditionalOrder->ParticipantID,dwTime);
      printString("pErrorConditionalOrder","ClientID",pErrorConditionalOrder->ClientID,dwTime);
      printString("pErrorConditionalOrder","ExchangeInstID",pErrorConditionalOrder->ExchangeInstID,dwTime);
      printString("pErrorConditionalOrder","TraderID",pErrorConditionalOrder->TraderID,dwTime);
      printNumber("pErrorConditionalOrder","InstallID",pErrorConditionalOrder->InstallID,dwTime);
      printNumber("pErrorConditionalOrder","OrderSubmitStatus",pErrorConditionalOrder->OrderSubmitStatus,dwTime);
      printNumber("pErrorConditionalOrder","NotifySequence",pErrorConditionalOrder->NotifySequence,dwTime);
      printString("pErrorConditionalOrder","TradingDay",pErrorConditionalOrder->TradingDay,dwTime);
      printNumber("pErrorConditionalOrder","SettlementID",pErrorConditionalOrder->SettlementID,dwTime);
      printString("pErrorConditionalOrder","OrderSysID",pErrorConditionalOrder->OrderSysID,dwTime);
      printNumber("pErrorConditionalOrder","OrderSource",pErrorConditionalOrder->OrderSource,dwTime);
      printNumber("pErrorConditionalOrder","OrderStatus",pErrorConditionalOrder->OrderStatus,dwTime);
      printNumber("pErrorConditionalOrder","OrderType",pErrorConditionalOrder->OrderType,dwTime);
      printNumber("pErrorConditionalOrder","VolumeTraded",pErrorConditionalOrder->VolumeTraded,dwTime);
      printNumber("pErrorConditionalOrder","VolumeTotal",pErrorConditionalOrder->VolumeTotal,dwTime);
      printString("pErrorConditionalOrder","InsertDate",pErrorConditionalOrder->InsertDate,dwTime);
      printString("pErrorConditionalOrder","InsertTime",pErrorConditionalOrder->InsertTime,dwTime);
      printString("pErrorConditionalOrder","ActiveTime",pErrorConditionalOrder->ActiveTime,dwTime);
      printString("pErrorConditionalOrder","SuspendTime",pErrorConditionalOrder->SuspendTime,dwTime);
      printString("pErrorConditionalOrder","UpdateTime",pErrorConditionalOrder->UpdateTime,dwTime);
      printString("pErrorConditionalOrder","CancelTime",pErrorConditionalOrder->CancelTime,dwTime);
      printString("pErrorConditionalOrder","ActiveTraderID",pErrorConditionalOrder->ActiveTraderID,dwTime);
      printString("pErrorConditionalOrder","ClearingPartID",pErrorConditionalOrder->ClearingPartID,dwTime);

printNumber("pErrorConditionalOrder","SequenceNo",pErrorConditionalOrder->SequenceNo,dwTime);
      printNumber("pErrorConditionalOrder","FrontID",pErrorConditionalOrder->FrontID,dwTime);
      printNumber("pErrorConditionalOrder","SessionID",pErrorConditionalOrder->SessionID,dwTime);
      printString("pErrorConditionalOrder","UserProductInfo",pErrorConditionalOrder->UserProductInfo,dwTime);
      printString("pErrorConditionalOrder","StatusMsg",pErrorConditionalOrder->StatusMsg,dwTime);
      printNumber("pErrorConditionalOrder","UserForceClose",pErrorConditionalOrder->UserForceClose,dwTime);
      printString("pErrorConditionalOrder","ActiveUserID",pErrorConditionalOrder->ActiveUserID,dwTime);
      printNumber("pErrorConditionalOrder","BrokerOrderSeq",pErrorConditionalOrder->BrokerOrderSeq,dwTime);
      printString("pErrorConditionalOrder","RelativeOrderSysID",pErrorConditionalOrder->RelativeOrderSysID,dwTime);
      printNumber("pErrorConditionalOrder","ZCETotalTradedVolume",pErrorConditionalOrder->ZCETotalTradedVolume,dwTime);
      printNumber("pErrorConditionalOrder","ErrorID",pErrorConditionalOrder->ErrorID,dwTime);
      printString("pErrorConditionalOrder","ErrorMsg",pErrorConditionalOrder->ErrorMsg,dwTime);
      printNumber("pErrorConditionalOrder","IsSwapOrder",pErrorConditionalOrder->IsSwapOrder,dwTime);
      printString("pErrorConditionalOrder","BranchID",pErrorConditionalOrder->BranchID,dwTime);
      printString("pErrorConditionalOrder","InvestUnitID",pErrorConditionalOrder->InvestUnitID,dwTime);
      printString("pErrorConditionalOrder","AccountID",pErrorConditionalOrder->AccountID,dwTime);
      printString("pErrorConditionalOrder","CurrencyID",pErrorConditionalOrder->CurrencyID,dwTime);
      printString("pErrorConditionalOrder","IPAddress",pErrorConditionalOrder->IPAddress,dwTime);
      printString("pErrorConditionalOrder","MacAddress",pErrorConditionalOrder->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnErrorConditionalOrder", "Leave", dwTime);

    TraderSpi_OnRtnErrorConditionalOrder(self, pErrorConditionalOrder);

  };

  ///执行宣告通知
  virtual void  OnRtnExecOrder(CThostFtdcExecOrderField *pExecOrder) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnExecOrder", "Enter", dwTime);

    if (NULL==pExecOrder)
    {
      printString("pExecOrder","CThostFtdcExecOrderField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pExecOrder","BrokerID",pExecOrder->BrokerID,dwTime);
      printString("pExecOrder","InvestorID",pExecOrder->InvestorID,dwTime);
      printString("pExecOrder","InstrumentID",pExecOrder->InstrumentID,dwTime);
      printString("pExecOrder","ExecOrderRef",pExecOrder->ExecOrderRef,dwTime);
      printString("pExecOrder","UserID",pExecOrder->UserID,dwTime);
      printNumber("pExecOrder","Volume",pExecOrder->Volume,dwTime);
      printNumber("pExecOrder","RequestID",pExecOrder->RequestID,dwTime);
      printString("pExecOrder","BusinessUnit",pExecOrder->BusinessUnit,dwTime);
      printNumber("pExecOrder","OffsetFlag",pExecOrder->OffsetFlag,dwTime);
      printNumber("pExecOrder","HedgeFlag",pExecOrder->HedgeFlag,dwTime);
      printNumber("pExecOrder","ActionType",pExecOrder->ActionType,dwTime);
      printNumber("pExecOrder","PosiDirection",pExecOrder->PosiDirection,dwTime);
      printNumber("pExecOrder","ReservePositionFlag",pExecOrder->ReservePositionFlag,dwTime);
      printNumber("pExecOrder","CloseFlag",pExecOrder->CloseFlag,dwTime);
      printString("pExecOrder","ExecOrderLocalID",pExecOrder->ExecOrderLocalID,dwTime);
      printString("pExecOrder","ExchangeID",pExecOrder->ExchangeID,dwTime);
      printString("pExecOrder","ParticipantID",pExecOrder->ParticipantID,dwTime);
      printString("pExecOrder","ClientID",pExecOrder->ClientID,dwTime);
      printString("pExecOrder","ExchangeInstID",pExecOrder->ExchangeInstID,dwTime);
      printString("pExecOrder","TraderID",pExecOrder->TraderID,dwTime);
      printNumber("pExecOrder","InstallID",pExecOrder->InstallID,dwTime);
      printNumber("pExecOrder","OrderSubmitStatus",pExecOrder->OrderSubmitStatus,dwTime);
      printNumber("pExecOrder","NotifySequence",pExecOrder->NotifySequence,dwTime);
      printString("pExecOrder","TradingDay",pExecOrder->TradingDay,dwTime);
      printNumber("pExecOrder","SettlementID",pExecOrder->SettlementID,dwTime);
      printString("pExecOrder","ExecOrderSysID",pExecOrder->ExecOrderSysID,dwTime);
      printString("pExecOrder","InsertDate",pExecOrder->InsertDate,dwTime);
      printString("pExecOrder","InsertTime",pExecOrder->InsertTime,dwTime);
      printString("pExecOrder","CancelTime",pExecOrder->CancelTime,dwTime);
      printNumber("pExecOrder","ExecResult",pExecOrder->ExecResult,dwTime);
      printString("pExecOrder","ClearingPartID",pExecOrder->ClearingPartID,dwTime);
      printNumber("pExecOrder","SequenceNo",pExecOrder->SequenceNo,dwTime);
      printNumber("pExecOrder","FrontID",pExecOrder->FrontID,dwTime);
      printNumber("pExecOrder","SessionID",pExecOrder->SessionID,dwTime);
      printString("pExecOrder","UserProductInfo",pExecOrder->UserProductInfo,dwTime);
      printString("pExecOrder","StatusMsg",pExecOrder->StatusMsg,dwTime);
      printString("pExecOrder","ActiveUserID",pExecOrder->ActiveUserID,dwTime);
      printNumber("pExecOrder","BrokerExecOrderSeq",pExecOrder->BrokerExecOrderSeq,dwTime);
      printString("pExecOrder","BranchID",pExecOrder->BranchID,dwTime);
      printString("pExecOrder","InvestUnitID",pExecOrder->InvestUnitID,dwTime);
      printString("pExecOrder","AccountID",pExecOrder->AccountID,dwTime);
      printString("pExecOrder","CurrencyID",pExecOrder->CurrencyID,dwTime);
      printString("pExecOrder","IPAddress",pExecOrder->IPAddress,dwTime);
      printString("pExecOrder","MacAddress",pExecOrder->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnExecOrder", "Leave", dwTime);

    TraderSpi_OnRtnExecOrder(self, pExecOrder);

  };

  ///执行宣告录入错误回报
  virtual void  OnErrRtnExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnErrRtnExecOrderInsert", "Enter", dwTime);

    if (NULL==pInputExecOrder)
    {
      printString("pInputExecOrder","CThostFtdcInputExecOrderField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInputExecOrder","BrokerID",pInputExecOrder->BrokerID,dwTime);
      printString("pInputExecOrder","InvestorID",pInputExecOrder->InvestorID,dwTime);
      printString("pInputExecOrder","InstrumentID",pInputExecOrder->InstrumentID,dwTime);
      printString("pInputExecOrder","ExecOrderRef",pInputExecOrder->ExecOrderRef,dwTime);
      printString("pInputExecOrder","UserID",pInputExecOrder->UserID,dwTime);
      printNumber("pInputExecOrder","Volume",pInputExecOrder->Volume,dwTime);
      printNumber("pInputExecOrder","RequestID",pInputExecOrder->RequestID,dwTime);
      printString("pInputExecOrder","BusinessUnit",pInputExecOrder->BusinessUnit,dwTime);
      printNumber("pInputExecOrder","OffsetFlag",pInputExecOrder->OffsetFlag,dwTime);
      printNumber("pInputExecOrder","HedgeFlag",pInputExecOrder->HedgeFlag,dwTime);
      printNumber("pInputExecOrder","ActionType",pInputExecOrder->ActionType,dwTime);
      printNumber("pInputExecOrder","PosiDirection",pInputExecOrder->PosiDirection,dwTime);
      printNumber("pInputExecOrder","ReservePositionFlag",pInputExecOrder->ReservePositionFlag,dwTime);
      printNumber("pInputExecOrder","CloseFlag",pInputExecOrder->CloseFlag,dwTime);
      printString("pInputExecOrder","ExchangeID",pInputExecOrder->ExchangeID,dwTime);
      printString("pInputExecOrder","InvestUnitID",pInputExecOrder->InvestUnitID,dwTime);
      printString("pInputExecOrder","AccountID",pInputExecOrder->AccountID,dwTime);
      printString("pInputExecOrder","CurrencyID",pInputExecOrder->CurrencyID,dwTime);
      printString("pInputExecOrder","ClientID",pInputExecOrder->ClientID,dwTime);
      printString("pInputExecOrder","IPAddress",pInputExecOrder->IPAddress,dwTime);
      printString("pInputExecOrder","MacAddress",pInputExecOrder->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnErrRtnExecOrderInsert", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnErrRtnExecOrderInsert(self, pInputExecOrder, pRspInfo);

  };

  ///执行宣告操作错误回报
  virtual void  OnErrRtnExecOrderAction(CThostFtdcExecOrderActionField *pExecOrderAction, CThostFtdcRspInfoField *pRspInfo) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnErrRtnExecOrderAction", "Enter", dwTime);

    if (NULL==pExecOrderAction)
    {
      printString("pExecOrderAction","CThostFtdcExecOrderActionField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pExecOrderAction","BrokerID",pExecOrderAction->BrokerID,dwTime);
      printString("pExecOrderAction","InvestorID",pExecOrderAction->InvestorID,dwTime);
      printNumber("pExecOrderAction","ExecOrderActionRef",pExecOrderAction->ExecOrderActionRef,dwTime);
      printString("pExecOrderAction","ExecOrderRef",pExecOrderAction->ExecOrderRef,dwTime);
      printNumber("pExecOrderAction","RequestID",pExecOrderAction->RequestID,dwTime);
      printNumber("pExecOrderAction","FrontID",pExecOrderAction->FrontID,dwTime);
      printNumber("pExecOrderAction","SessionID",pExecOrderAction->SessionID,dwTime);
      printString("pExecOrderAction","ExchangeID",pExecOrderAction->ExchangeID,dwTime);
      printString("pExecOrderAction","ExecOrderSysID",pExecOrderAction->ExecOrderSysID,dwTime);
      printNumber("pExecOrderAction","ActionFlag",pExecOrderAction->ActionFlag,dwTime);
      printString("pExecOrderAction","ActionDate",pExecOrderAction->ActionDate,dwTime);
      printString("pExecOrderAction","ActionTime",pExecOrderAction->ActionTime,dwTime);
      printString("pExecOrderAction","TraderID",pExecOrderAction->TraderID,dwTime);
      printNumber("pExecOrderAction","InstallID",pExecOrderAction->InstallID,dwTime);
      printString("pExecOrderAction","ExecOrderLocalID",pExecOrderAction->ExecOrderLocalID,dwTime);
      printString("pExecOrderAction","ActionLocalID",pExecOrderAction->ActionLocalID,dwTime);
      printString("pExecOrderAction","ParticipantID",pExecOrderAction->ParticipantID,dwTime);
      printString("pExecOrderAction","ClientID",pExecOrderAction->ClientID,dwTime);
      printString("pExecOrderAction","BusinessUnit",pExecOrderAction->BusinessUnit,dwTime);
      printNumber("pExecOrderAction","OrderActionStatus",pExecOrderAction->OrderActionStatus,dwTime);
      printString("pExecOrderAction","UserID",pExecOrderAction->UserID,dwTime);
      printNumber("pExecOrderAction","ActionType",pExecOrderAction->ActionType,dwTime);
      printString("pExecOrderAction","StatusMsg",pExecOrderAction->StatusMsg,dwTime);
      printString("pExecOrderAction","InstrumentID",pExecOrderAction->InstrumentID,dwTime);
      printString("pExecOrderAction","BranchID",pExecOrderAction->BranchID,dwTime);
      printString("pExecOrderAction","InvestUnitID",pExecOrderAction->InvestUnitID,dwTime);
      printString("pExecOrderAction","IPAddress",pExecOrderAction->IPAddress,dwTime);
      printString("pExecOrderAction","MacAddress",pExecOrderAction->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnErrRtnExecOrderAction", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnErrRtnExecOrderAction(self, pExecOrderAction, pRspInfo);

  };

  ///询价录入错误回报
  virtual void  OnErrRtnForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnErrRtnForQuoteInsert", "Enter", dwTime);

    if (NULL==pInputForQuote)
    {
      printString("pInputForQuote","CThostFtdcInputForQuoteField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInputForQuote","BrokerID",pInputForQuote->BrokerID,dwTime);
      printString("pInputForQuote","InvestorID",pInputForQuote->InvestorID,dwTime);
      printString("pInputForQuote","InstrumentID",pInputForQuote->InstrumentID,dwTime);
      printString("pInputForQuote","ForQuoteRef",pInputForQuote->ForQuoteRef,dwTime);
      printString("pInputForQuote","UserID",pInputForQuote->UserID,dwTime);
      printString("pInputForQuote","ExchangeID",pInputForQuote->ExchangeID,dwTime);
      printString("pInputForQuote","InvestUnitID",pInputForQuote->InvestUnitID,dwTime);
      printString("pInputForQuote","IPAddress",pInputForQuote->IPAddress,dwTime);
      printString("pInputForQuote","MacAddress",pInputForQuote->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnErrRtnForQuoteInsert", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnErrRtnForQuoteInsert(self, pInputForQuote, pRspInfo);

  };

  ///报价通知
  virtual void  OnRtnQuote(CThostFtdcQuoteField *pQuote) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnQuote", "Enter", dwTime);

    if (NULL==pQuote)
    {
      printString("pQuote","CThostFtdcQuoteField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pQuote","BrokerID",pQuote->BrokerID,dwTime);
      printString("pQuote","InvestorID",pQuote->InvestorID,dwTime);
      printString("pQuote","InstrumentID",pQuote->InstrumentID,dwTime);
      printString("pQuote","QuoteRef",pQuote->QuoteRef,dwTime);
      printString("pQuote","UserID",pQuote->UserID,dwTime);
      printNumber("pQuote","AskPrice",pQuote->AskPrice,dwTime);
      printNumber("pQuote","BidPrice",pQuote->BidPrice,dwTime);
      printNumber("pQuote","AskVolume",pQuote->AskVolume,dwTime);
      printNumber("pQuote","BidVolume",pQuote->BidVolume,dwTime);
      printNumber("pQuote","RequestID",pQuote->RequestID,dwTime);
      printString("pQuote","BusinessUnit",pQuote->BusinessUnit,dwTime);
      printNumber("pQuote","AskOffsetFlag",pQuote->AskOffsetFlag,dwTime);
      printNumber("pQuote","BidOffsetFlag",pQuote->BidOffsetFlag,dwTime);
      printNumber("pQuote","AskHedgeFlag",pQuote->AskHedgeFlag,dwTime);
      printNumber("pQuote","BidHedgeFlag",pQuote->BidHedgeFlag,dwTime);
      printString("pQuote","QuoteLocalID",pQuote->QuoteLocalID,dwTime);
      printString("pQuote","ExchangeID",pQuote->ExchangeID,dwTime);
      printString("pQuote","ParticipantID",pQuote->ParticipantID,dwTime);
      printString("pQuote","ClientID",pQuote->ClientID,dwTime);
      printString("pQuote","ExchangeInstID",pQuote->ExchangeInstID,dwTime);
      printString("pQuote","TraderID",pQuote->TraderID,dwTime);
      printNumber("pQuote","InstallID",pQuote->InstallID,dwTime);
      printNumber("pQuote","NotifySequence",pQuote->NotifySequence,dwTime);
      printNumber("pQuote","OrderSubmitStatus",pQuote->OrderSubmitStatus,dwTime);
      printString("pQuote","TradingDay",pQuote->TradingDay,dwTime);
      printNumber("pQuote","SettlementID",pQuote->SettlementID,dwTime);
      printString("pQuote","QuoteSysID",pQuote->QuoteSysID,dwTime);
      printString("pQuote","InsertDate",pQuote->InsertDate,dwTime);
      printString("pQuote","InsertTime",pQuote->InsertTime,dwTime);
      printString("pQuote","CancelTime",pQuote->CancelTime,dwTime);
      printNumber("pQuote","QuoteStatus",pQuote->QuoteStatus,dwTime);
      printString("pQuote","ClearingPartID",pQuote->ClearingPartID,dwTime);
      printNumber("pQuote","SequenceNo",pQuote->SequenceNo,dwTime);
      printString("pQuote","AskOrderSysID",pQuote->AskOrderSysID,dwTime);
      printString("pQuote","BidOrderSysID",pQuote->BidOrderSysID,dwTime);
      printNumber("pQuote","FrontID",pQuote->FrontID,dwTime);
      printNumber("pQuote","SessionID",pQuote->SessionID,dwTime);
      printString("pQuote","UserProductInfo",pQuote->UserProductInfo,dwTime);
      printString("pQuote","StatusMsg",pQuote->StatusMsg,dwTime);
      printString("pQuote","ActiveUserID",pQuote->ActiveUserID,dwTime);
      printNumber("pQuote","BrokerQuoteSeq",pQuote->BrokerQuoteSeq,dwTime);
      printString("pQuote","AskOrderRef",pQuote->AskOrderRef,dwTime);
      printString("pQuote","BidOrderRef",pQuote->BidOrderRef,dwTime);
      printString("pQuote","ForQuoteSysID",pQuote->ForQuoteSysID,dwTime);
      printString("pQuote","BranchID",pQuote->BranchID,dwTime);
      printString("pQuote","InvestUnitID",pQuote->InvestUnitID,dwTime);
      printString("pQuote","AccountID",pQuote->AccountID,dwTime);
      printString("pQuote","CurrencyID",pQuote->CurrencyID,dwTime);
      printString("pQuote","IPAddress",pQuote->IPAddress,dwTime);
      printString("pQuote","MacAddress",pQuote->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnQuote", "Leave", dwTime);

    TraderSpi_OnRtnQuote(self, pQuote);

  };

  ///报价录入错误回报
  virtual void  OnErrRtnQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnErrRtnQuoteInsert", "Enter", dwTime);

    if (NULL==pInputQuote)
    {
      printString("pInputQuote","CThostFtdcInputQuoteField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInputQuote","BrokerID",pInputQuote->BrokerID,dwTime);
      printString("pInputQuote","InvestorID",pInputQuote->InvestorID,dwTime);
      printString("pInputQuote","InstrumentID",pInputQuote->InstrumentID,dwTime);
      printString("pInputQuote","QuoteRef",pInputQuote->QuoteRef,dwTime);
      printString("pInputQuote","UserID",pInputQuote->UserID,dwTime);
      printNumber("pInputQuote","AskPrice",pInputQuote->AskPrice,dwTime);
      printNumber("pInputQuote","BidPrice",pInputQuote->BidPrice,dwTime);
      printNumber("pInputQuote","AskVolume",pInputQuote->AskVolume,dwTime);
      printNumber("pInputQuote","BidVolume",pInputQuote->BidVolume,dwTime);
      printNumber("pInputQuote","RequestID",pInputQuote->RequestID,dwTime);
      printString("pInputQuote","BusinessUnit",pInputQuote->BusinessUnit,dwTime);
      printNumber("pInputQuote","AskOffsetFlag",pInputQuote->AskOffsetFlag,dwTime);
      printNumber("pInputQuote","BidOffsetFlag",pInputQuote->BidOffsetFlag,dwTime);
      printNumber("pInputQuote","AskHedgeFlag",pInputQuote->AskHedgeFlag,dwTime);
      printNumber("pInputQuote","BidHedgeFlag",pInputQuote->BidHedgeFlag,dwTime);
      printString("pInputQuote","AskOrderRef",pInputQuote->AskOrderRef,dwTime);
      printString("pInputQuote","BidOrderRef",pInputQuote->BidOrderRef,dwTime);
      printString("pInputQuote","ForQuoteSysID",pInputQuote->ForQuoteSysID,dwTime);
      printString("pInputQuote","ExchangeID",pInputQuote->ExchangeID,dwTime);
      printString("pInputQuote","InvestUnitID",pInputQuote->InvestUnitID,dwTime);
      printString("pInputQuote","ClientID",pInputQuote->ClientID,dwTime);
      printString("pInputQuote","IPAddress",pInputQuote->IPAddress,dwTime);
      printString("pInputQuote","MacAddress",pInputQuote->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnErrRtnQuoteInsert", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnErrRtnQuoteInsert(self, pInputQuote, pRspInfo);

  };

  ///报价操作错误回报
  virtual void  OnErrRtnQuoteAction(CThostFtdcQuoteActionField *pQuoteAction, CThostFtdcRspInfoField *pRspInfo) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnErrRtnQuoteAction", "Enter", dwTime);

    if (NULL==pQuoteAction)
    {
      printString("pQuoteAction","CThostFtdcQuoteActionField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pQuoteAction","BrokerID",pQuoteAction->BrokerID,dwTime);
      printString("pQuoteAction","InvestorID",pQuoteAction->InvestorID,dwTime);
      printNumber("pQuoteAction","QuoteActionRef",pQuoteAction->QuoteActionRef,dwTime);
      printString("pQuoteAction","QuoteRef",pQuoteAction->QuoteRef,dwTime);
      printNumber("pQuoteAction","RequestID",pQuoteAction->RequestID,dwTime);
      printNumber("pQuoteAction","FrontID",pQuoteAction->FrontID,dwTime);
      printNumber("pQuoteAction","SessionID",pQuoteAction->SessionID,dwTime);
      printString("pQuoteAction","ExchangeID",pQuoteAction->ExchangeID,dwTime);
      printString("pQuoteAction","QuoteSysID",pQuoteAction->QuoteSysID,dwTime);
      printNumber("pQuoteAction","ActionFlag",pQuoteAction->ActionFlag,dwTime);
      printString("pQuoteAction","ActionDate",pQuoteAction->ActionDate,dwTime);
      printString("pQuoteAction","ActionTime",pQuoteAction->ActionTime,dwTime);
      printString("pQuoteAction","TraderID",pQuoteAction->TraderID,dwTime);
      printNumber("pQuoteAction","InstallID",pQuoteAction->InstallID,dwTime);
      printString("pQuoteAction","QuoteLocalID",pQuoteAction->QuoteLocalID,dwTime);
      printString("pQuoteAction","ActionLocalID",pQuoteAction->ActionLocalID,dwTime);
      printString("pQuoteAction","ParticipantID",pQuoteAction->ParticipantID,dwTime);
      printString("pQuoteAction","ClientID",pQuoteAction->ClientID,dwTime);
      printString("pQuoteAction","BusinessUnit",pQuoteAction->BusinessUnit,dwTime);
      printNumber("pQuoteAction","OrderActionStatus",pQuoteAction->OrderActionStatus,dwTime);
      printString("pQuoteAction","UserID",pQuoteAction->UserID,dwTime);
      printString("pQuoteAction","StatusMsg",pQuoteAction->StatusMsg,dwTime);
      printString("pQuoteAction","InstrumentID",pQuoteAction->InstrumentID,dwTime);
      printString("pQuoteAction","BranchID",pQuoteAction->BranchID,dwTime);
      printString("pQuoteAction","InvestUnitID",pQuoteAction->InvestUnitID,dwTime);
      printString("pQuoteAction","IPAddress",pQuoteAction->IPAddress,dwTime);
      printString("pQuoteAction","MacAddress",pQuoteAction->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnErrRtnQuoteAction", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnErrRtnQuoteAction(self, pQuoteAction, pRspInfo);

  };

  ///询价通知
  virtual void  OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnForQuoteRsp", "Enter", dwTime);

    if (NULL==pForQuoteRsp)
    {
      printString("pForQuoteRsp","CThostFtdcForQuoteRspField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pForQuoteRsp","TradingDay",pForQuoteRsp->TradingDay,dwTime);
      printString("pForQuoteRsp","InstrumentID",pForQuoteRsp->InstrumentID,dwTime);
      printString("pForQuoteRsp","ForQuoteSysID",pForQuoteRsp->ForQuoteSysID,dwTime);
      printString("pForQuoteRsp","ForQuoteTime",pForQuoteRsp->ForQuoteTime,dwTime);
      printString("pForQuoteRsp","ActionDay",pForQuoteRsp->ActionDay,dwTime);
      printString("pForQuoteRsp","ExchangeID",pForQuoteRsp->ExchangeID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnForQuoteRsp", "Leave", dwTime);

    TraderSpi_OnRtnForQuoteRsp(self, pForQuoteRsp);

  };

  ///保证金监控中心用户令牌
  virtual void  OnRtnCFMMCTradingAccountToken(CThostFtdcCFMMCTradingAccountTokenField *pCFMMCTradingAccountToken) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnCFMMCTradingAccountToken", "Enter", dwTime);

    if (NULL==pCFMMCTradingAccountToken)
    {
      printString("pCFMMCTradingAccountToken","CThostFtdcCFMMCTradingAccountTokenField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pCFMMCTradingAccountToken","BrokerID",pCFMMCTradingAccountToken->BrokerID,dwTime);
      printString("pCFMMCTradingAccountToken","ParticipantID",pCFMMCTradingAccountToken->ParticipantID,dwTime);
      printString("pCFMMCTradingAccountToken","AccountID",pCFMMCTradingAccountToken->AccountID,dwTime);
      printNumber("pCFMMCTradingAccountToken","KeyID",pCFMMCTradingAccountToken->KeyID,dwTime);
      printString("pCFMMCTradingAccountToken","Token",pCFMMCTradingAccountToken->Token,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnCFMMCTradingAccountToken", "Leave", dwTime);

    TraderSpi_OnRtnCFMMCTradingAccountToken(self, pCFMMCTradingAccountToken);

  };

  ///批量报单操作错误回报
  virtual void  OnErrRtnBatchOrderAction(CThostFtdcBatchOrderActionField *pBatchOrderAction, CThostFtdcRspInfoField *pRspInfo) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnErrRtnBatchOrderAction", "Enter", dwTime);

    if (NULL==pBatchOrderAction)
    {
      printString("pBatchOrderAction","CThostFtdcBatchOrderActionField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pBatchOrderAction","BrokerID",pBatchOrderAction->BrokerID,dwTime);
      printString("pBatchOrderAction","InvestorID",pBatchOrderAction->InvestorID,dwTime);
      printNumber("pBatchOrderAction","OrderActionRef",pBatchOrderAction->OrderActionRef,dwTime);
      printNumber("pBatchOrderAction","RequestID",pBatchOrderAction->RequestID,dwTime);
      printNumber("pBatchOrderAction","FrontID",pBatchOrderAction->FrontID,dwTime);
      printNumber("pBatchOrderAction","SessionID",pBatchOrderAction->SessionID,dwTime);
      printString("pBatchOrderAction","ExchangeID",pBatchOrderAction->ExchangeID,dwTime);
      printString("pBatchOrderAction","ActionDate",pBatchOrderAction->ActionDate,dwTime);
      printString("pBatchOrderAction","ActionTime",pBatchOrderAction->ActionTime,dwTime);
      printString("pBatchOrderAction","TraderID",pBatchOrderAction->TraderID,dwTime);
      printNumber("pBatchOrderAction","InstallID",pBatchOrderAction->InstallID,dwTime);
      printString("pBatchOrderAction","ActionLocalID",pBatchOrderAction->ActionLocalID,dwTime);
      printString("pBatchOrderAction","ParticipantID",pBatchOrderAction->ParticipantID,dwTime);
      printString("pBatchOrderAction","ClientID",pBatchOrderAction->ClientID,dwTime);
      printString("pBatchOrderAction","BusinessUnit",pBatchOrderAction->BusinessUnit,dwTime);
      printNumber("pBatchOrderAction","OrderActionStatus",pBatchOrderAction->OrderActionStatus,dwTime);
      printString("pBatchOrderAction","UserID",pBatchOrderAction->UserID,dwTime);
      printString("pBatchOrderAction","StatusMsg",pBatchOrderAction->StatusMsg,dwTime);
      printString("pBatchOrderAction","InvestUnitID",pBatchOrderAction->InvestUnitID,dwTime);
      printString("pBatchOrderAction","IPAddress",pBatchOrderAction->IPAddress,dwTime);
      printString("pBatchOrderAction","MacAddress",pBatchOrderAction->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnErrRtnBatchOrderAction", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnErrRtnBatchOrderAction(self, pBatchOrderAction, pRspInfo);

  };

  ///期权自对冲通知
  virtual void  OnRtnOptionSelfClose(CThostFtdcOptionSelfCloseField *pOptionSelfClose) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnOptionSelfClose", "Enter", dwTime);

    if (NULL==pOptionSelfClose)
    {
      printString("pOptionSelfClose","CThostFtdcOptionSelfCloseField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pOptionSelfClose","BrokerID",pOptionSelfClose->BrokerID,dwTime);
      printString("pOptionSelfClose","InvestorID",pOptionSelfClose->InvestorID,dwTime);
      printString("pOptionSelfClose","InstrumentID",pOptionSelfClose->InstrumentID,dwTime);
      printString("pOptionSelfClose","OptionSelfCloseRef",pOptionSelfClose->OptionSelfCloseRef,dwTime);
      printString("pOptionSelfClose","UserID",pOptionSelfClose->UserID,dwTime);
      printNumber("pOptionSelfClose","Volume",pOptionSelfClose->Volume,dwTime);
      printNumber("pOptionSelfClose","RequestID",pOptionSelfClose->RequestID,dwTime);
      printString("pOptionSelfClose","BusinessUnit",pOptionSelfClose->BusinessUnit,dwTime);
      printNumber("pOptionSelfClose","HedgeFlag",pOptionSelfClose->HedgeFlag,dwTime);
      printNumber("pOptionSelfClose","OptSelfCloseFlag",pOptionSelfClose->OptSelfCloseFlag,dwTime);
      printString("pOptionSelfClose","OptionSelfCloseLocalID",pOptionSelfClose->OptionSelfCloseLocalID,dwTime);
      printString("pOptionSelfClose","ExchangeID",pOptionSelfClose->ExchangeID,dwTime);
      printString("pOptionSelfClose","ParticipantID",pOptionSelfClose->ParticipantID,dwTime);
      printString("pOptionSelfClose","ClientID",pOptionSelfClose->ClientID,dwTime);
      printString("pOptionSelfClose","ExchangeInstID",pOptionSelfClose->ExchangeInstID,dwTime);
      printString("pOptionSelfClose","TraderID",pOptionSelfClose->TraderID,dwTime);
      printNumber("pOptionSelfClose","InstallID",pOptionSelfClose->InstallID,dwTime);
      printNumber("pOptionSelfClose","OrderSubmitStatus",pOptionSelfClose->OrderSubmitStatus,dwTime);
      printNumber("pOptionSelfClose","NotifySequence",pOptionSelfClose->NotifySequence,dwTime);
      printString("pOptionSelfClose","TradingDay",pOptionSelfClose->TradingDay,dwTime);
      printNumber("pOptionSelfClose","SettlementID",pOptionSelfClose->SettlementID,dwTime);
      printString("pOptionSelfClose","OptionSelfCloseSysID",pOptionSelfClose->OptionSelfCloseSysID,dwTime);
      printString("pOptionSelfClose","InsertDate",pOptionSelfClose->InsertDate,dwTime);
      printString("pOptionSelfClose","InsertTime",pOptionSelfClose->InsertTime,dwTime);
      printString("pOptionSelfClose","CancelTime",pOptionSelfClose->CancelTime,dwTime);
      printNumber("pOptionSelfClose","ExecResult",pOptionSelfClose->ExecResult,dwTime);
      printString("pOptionSelfClose","ClearingPartID",pOptionSelfClose->ClearingPartID,dwTime);
      printNumber("pOptionSelfClose","SequenceNo",pOptionSelfClose->SequenceNo,dwTime);
      printNumber("pOptionSelfClose","FrontID",pOptionSelfClose->FrontID,dwTime);
      printNumber("pOptionSelfClose","SessionID",pOptionSelfClose->SessionID,dwTime);
      printString("pOptionSelfClose","UserProductInfo",pOptionSelfClose->UserProductInfo,dwTime);
      printString("pOptionSelfClose","StatusMsg",pOptionSelfClose->StatusMsg,dwTime);
      printString("pOptionSelfClose","ActiveUserID",pOptionSelfClose->ActiveUserID,dwTime);
      printNumber("pOptionSelfClose","BrokerOptionSelfCloseSeq",pOptionSelfClose->BrokerOptionSelfCloseSeq,dwTime);
      printString("pOptionSelfClose","BranchID",pOptionSelfClose->BranchID,dwTime);
      printString("pOptionSelfClose","InvestUnitID",pOptionSelfClose->InvestUnitID,dwTime);
      printString("pOptionSelfClose","AccountID",pOptionSelfClose->AccountID,dwTime);
      printString("pOptionSelfClose","CurrencyID",pOptionSelfClose->CurrencyID,dwTime);
      printString("pOptionSelfClose","IPAddress",pOptionSelfClose->IPAddress,dwTime);
      printString("pOptionSelfClose","MacAddress",pOptionSelfClose->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnOptionSelfClose", "Leave", dwTime);

    TraderSpi_OnRtnOptionSelfClose(self, pOptionSelfClose);

  };

  ///期权自对冲录入错误回报
  virtual void  OnErrRtnOptionSelfCloseInsert(CThostFtdcInputOptionSelfCloseField *pInputOptionSelfClose, CThostFtdcRspInfoField *pRspInfo) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnErrRtnOptionSelfCloseInsert", "Enter", dwTime);

    if (NULL==pInputOptionSelfClose)
    {
      printString("pInputOptionSelfClose","CThostFtdcInputOptionSelfCloseField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInputOptionSelfClose","BrokerID",pInputOptionSelfClose->BrokerID,dwTime);
      printString("pInputOptionSelfClose","InvestorID",pInputOptionSelfClose->InvestorID,dwTime);
      printString("pInputOptionSelfClose","InstrumentID",pInputOptionSelfClose->InstrumentID,dwTime);
      printString("pInputOptionSelfClose","OptionSelfCloseRef",pInputOptionSelfClose->OptionSelfCloseRef,dwTime);
      printString("pInputOptionSelfClose","UserID",pInputOptionSelfClose->UserID,dwTime);
      printNumber("pInputOptionSelfClose","Volume",pInputOptionSelfClose->Volume,dwTime);
      printNumber("pInputOptionSelfClose","RequestID",pInputOptionSelfClose->RequestID,dwTime);
      printString("pInputOptionSelfClose","BusinessUnit",pInputOptionSelfClose->BusinessUnit,dwTime);
      printNumber("pInputOptionSelfClose","HedgeFlag",pInputOptionSelfClose->HedgeFlag,dwTime);
      printNumber("pInputOptionSelfClose","OptSelfCloseFlag",pInputOptionSelfClose->OptSelfCloseFlag,dwTime);
      printString("pInputOptionSelfClose","ExchangeID",pInputOptionSelfClose->ExchangeID,dwTime);
      printString("pInputOptionSelfClose","InvestUnitID",pInputOptionSelfClose->InvestUnitID,dwTime);
      printString("pInputOptionSelfClose","AccountID",pInputOptionSelfClose->AccountID,dwTime);
      printString("pInputOptionSelfClose","CurrencyID",pInputOptionSelfClose->CurrencyID,dwTime);
      printString("pInputOptionSelfClose","ClientID",pInputOptionSelfClose->ClientID,dwTime);
      printString("pInputOptionSelfClose","IPAddress",pInputOptionSelfClose->IPAddress,dwTime);
      printString("pInputOptionSelfClose","MacAddress",pInputOptionSelfClose->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnErrRtnOptionSelfCloseInsert", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnErrRtnOptionSelfCloseInsert(self, pInputOptionSelfClose, pRspInfo);

  };

  ///期权自对冲操作错误回报
  virtual void  OnErrRtnOptionSelfCloseAction(CThostFtdcOptionSelfCloseActionField *pOptionSelfCloseAction, CThostFtdcRspInfoField *pRspInfo) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnErrRtnOptionSelfCloseAction", "Enter", dwTime);

    if (NULL==pOptionSelfCloseAction)
    {
      printString("pOptionSelfCloseAction","CThostFtdcOptionSelfCloseActionField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pOptionSelfCloseAction","BrokerID",pOptionSelfCloseAction->BrokerID,dwTime);
      printString("pOptionSelfCloseAction","InvestorID",pOptionSelfCloseAction->InvestorID,dwTime);
      printNumber("pOptionSelfCloseAction","OptionSelfCloseActionRef",pOptionSelfCloseAction->OptionSelfCloseActionRef,dwTime);
      printString("pOptionSelfCloseAction","OptionSelfCloseRef",pOptionSelfCloseAction->OptionSelfCloseRef,dwTime);
      printNumber("pOptionSelfCloseAction","RequestID",pOptionSelfCloseAction->RequestID,dwTime);
      printNumber("pOptionSelfCloseAction","FrontID",pOptionSelfCloseAction->FrontID,dwTime);
      printNumber("pOptionSelfCloseAction","SessionID",pOptionSelfCloseAction->SessionID,dwTime);
      printString("pOptionSelfCloseAction","ExchangeID",pOptionSelfCloseAction->ExchangeID,dwTime);
      printString("pOptionSelfCloseAction","OptionSelfCloseSysID",pOptionSelfCloseAction->OptionSelfCloseSysID,dwTime);
      printNumber("pOptionSelfCloseAction","ActionFlag",pOptionSelfCloseAction->ActionFlag,dwTime);
      printString("pOptionSelfCloseAction","ActionDate",pOptionSelfCloseAction->ActionDate,dwTime);
      printString("pOptionSelfCloseAction","ActionTime",pOptionSelfCloseAction->ActionTime,dwTime);
      printString("pOptionSelfCloseAction","TraderID",pOptionSelfCloseAction->TraderID,dwTime);
      printNumber("pOptionSelfCloseAction","InstallID",pOptionSelfCloseAction->InstallID,dwTime);
      printString("pOptionSelfCloseAction","OptionSelfCloseLocalID",pOptionSelfCloseAction->OptionSelfCloseLocalID,dwTime);
      printString("pOptionSelfCloseAction","ActionLocalID",pOptionSelfCloseAction->ActionLocalID,dwTime);
      printString("pOptionSelfCloseAction","ParticipantID",pOptionSelfCloseAction->ParticipantID,dwTime);
      printString("pOptionSelfCloseAction","ClientID",pOptionSelfCloseAction->ClientID,dwTime);
      printString("pOptionSelfCloseAction","BusinessUnit",pOptionSelfCloseAction->BusinessUnit,dwTime);
      printNumber("pOptionSelfCloseAction","OrderActionStatus",pOptionSelfCloseAction->OrderActionStatus,dwTime);
      printString("pOptionSelfCloseAction","UserID",pOptionSelfCloseAction->UserID,dwTime);
      printString("pOptionSelfCloseAction","StatusMsg",pOptionSelfCloseAction->StatusMsg,dwTime);
      printString("pOptionSelfCloseAction","InstrumentID",pOptionSelfCloseAction->InstrumentID,dwTime);
      printString("pOptionSelfCloseAction","BranchID",pOptionSelfCloseAction->BranchID,dwTime);
      printString("pOptionSelfCloseAction","InvestUnitID",pOptionSelfCloseAction->InvestUnitID,dwTime);
      printString("pOptionSelfCloseAction","IPAddress",pOptionSelfCloseAction->IPAddress,dwTime);
      printString("pOptionSelfCloseAction","MacAddress",pOptionSelfCloseAction->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnErrRtnOptionSelfCloseAction", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnErrRtnOptionSelfCloseAction(self, pOptionSelfCloseAction, pRspInfo);

  };

  ///申请组合通知
  virtual void  OnRtnCombAction(CThostFtdcCombActionField *pCombAction) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnCombAction", "Enter", dwTime);

    if (NULL==pCombAction)
    {
      printString("pCombAction","CThostFtdcCombActionField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pCombAction","BrokerID",pCombAction->BrokerID,dwTime);
      printString("pCombAction","InvestorID",pCombAction->InvestorID,dwTime);
      printString("pCombAction","InstrumentID",pCombAction->InstrumentID,dwTime);
      printString("pCombAction","CombActionRef",pCombAction->CombActionRef,dwTime);
      printString("pCombAction","UserID",pCombAction->UserID,dwTime);
      printNumber("pCombAction","Direction",pCombAction->Direction,dwTime);
      printNumber("pCombAction","Volume",pCombAction->Volume,dwTime);
      printNumber("pCombAction","CombDirection",pCombAction->CombDirection,dwTime);
      printNumber("pCombAction","HedgeFlag",pCombAction->HedgeFlag,dwTime);
      printString("pCombAction","ActionLocalID",pCombAction->ActionLocalID,dwTime);
      printString("pCombAction","ExchangeID",pCombAction->ExchangeID,dwTime);
      printString("pCombAction","ParticipantID",pCombAction->ParticipantID,dwTime);
      printString("pCombAction","ClientID",pCombAction->ClientID,dwTime);
      printString("pCombAction","ExchangeInstID",pCombAction->ExchangeInstID,dwTime);
      printString("pCombAction","TraderID",pCombAction->TraderID,dwTime);
      printNumber("pCombAction","InstallID",pCombAction->InstallID,dwTime);
      printNumber("pCombAction","ActionStatus",pCombAction->ActionStatus,dwTime);
      printNumber("pCombAction","NotifySequence",pCombAction->NotifySequence,dwTime);
      printString("pCombAction","TradingDay",pCombAction->TradingDay,dwTime);
      printNumber("pCombAction","SettlementID",pCombAction->SettlementID,dwTime);
      printNumber("pCombAction","SequenceNo",pCombAction->SequenceNo,dwTime);
      printNumber("pCombAction","FrontID",pCombAction->FrontID,dwTime);
      printNumber("pCombAction","SessionID",pCombAction->SessionID,dwTime);
      printString("pCombAction","UserProductInfo",pCombAction->UserProductInfo,dwTime);
      printString("pCombAction","StatusMsg",pCombAction->StatusMsg,dwTime);
      printString("pCombAction","IPAddress",pCombAction->IPAddress,dwTime);
      printString("pCombAction","MacAddress",pCombAction->MacAddress,dwTime);
      printString("pCombAction","ComTradeID",pCombAction->ComTradeID,dwTime);
      printString("pCombAction","BranchID",pCombAction->BranchID,dwTime);
      printString("pCombAction","InvestUnitID",pCombAction->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnCombAction", "Leave", dwTime);

    TraderSpi_OnRtnCombAction(self, pCombAction);

  };

  ///申请组合录入错误回报
  virtual void  OnErrRtnCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnErrRtnCombActionInsert", "Enter", dwTime);

    if (NULL==pInputCombAction)
    {
      printString("pInputCombAction","CThostFtdcInputCombActionField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pInputCombAction","BrokerID",pInputCombAction->BrokerID,dwTime);
      printString("pInputCombAction","InvestorID",pInputCombAction->InvestorID,dwTime);
      printString("pInputCombAction","InstrumentID",pInputCombAction->InstrumentID,dwTime);
      printString("pInputCombAction","CombActionRef",pInputCombAction->CombActionRef,dwTime);
      printString("pInputCombAction","UserID",pInputCombAction->UserID,dwTime);
      printNumber("pInputCombAction","Direction",pInputCombAction->Direction,dwTime);
      printNumber("pInputCombAction","Volume",pInputCombAction->Volume,dwTime);
      printNumber("pInputCombAction","CombDirection",pInputCombAction->CombDirection,dwTime);
      printNumber("pInputCombAction","HedgeFlag",pInputCombAction->HedgeFlag,dwTime);
      printString("pInputCombAction","ExchangeID",pInputCombAction->ExchangeID,dwTime);
      printString("pInputCombAction","IPAddress",pInputCombAction->IPAddress,dwTime);
      printString("pInputCombAction","MacAddress",pInputCombAction->MacAddress,dwTime);
      printString("pInputCombAction","InvestUnitID",pInputCombAction->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnErrRtnCombActionInsert", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnErrRtnCombActionInsert(self, pInputCombAction, pRspInfo);

  };

  ///请求查询签约银行响应
  virtual void  OnRspQryContractBank(CThostFtdcContractBankField *pContractBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryContractBank", "Enter", dwTime);

    if (NULL==pContractBank)
    {
      printString("pContractBank","CThostFtdcContractBankField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pContractBank","BrokerID",pContractBank->BrokerID,dwTime);
      printString("pContractBank","BankID",pContractBank->BankID,dwTime);
      printString("pContractBank","BankBrchID",pContractBank->BankBrchID,dwTime);
      printString("pContractBank","BankName",pContractBank->BankName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryContractBank", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryContractBank(self, pContractBank, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询预埋单响应
  virtual void  OnRspQryParkedOrder(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryParkedOrder", "Enter", dwTime);

    if (NULL==pParkedOrder)
    {
      printString("pParkedOrder","CThostFtdcParkedOrderField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pParkedOrder","BrokerID",pParkedOrder->BrokerID,dwTime);
      printString("pParkedOrder","InvestorID",pParkedOrder->InvestorID,dwTime);
      printString("pParkedOrder","InstrumentID",pParkedOrder->InstrumentID,dwTime);
      printString("pParkedOrder","OrderRef",pParkedOrder->OrderRef,dwTime);
      printString("pParkedOrder","UserID",pParkedOrder->UserID,dwTime);
      printNumber("pParkedOrder","OrderPriceType",pParkedOrder->OrderPriceType,dwTime);
      printNumber("pParkedOrder","Direction",pParkedOrder->Direction,dwTime);
      printString("pParkedOrder","CombOffsetFlag",pParkedOrder->CombOffsetFlag,dwTime);
      printString("pParkedOrder","CombHedgeFlag",pParkedOrder->CombHedgeFlag,dwTime);
      printNumber("pParkedOrder","LimitPrice",pParkedOrder->LimitPrice,dwTime);
      printNumber("pParkedOrder","VolumeTotalOriginal",pParkedOrder->VolumeTotalOriginal,dwTime);
      printNumber("pParkedOrder","TimeCondition",pParkedOrder->TimeCondition,dwTime);
      printString("pParkedOrder","GTDDate",pParkedOrder->GTDDate,dwTime);
      printNumber("pParkedOrder","VolumeCondition",pParkedOrder->VolumeCondition,dwTime);
      printNumber("pParkedOrder","MinVolume",pParkedOrder->MinVolume,dwTime);
      printNumber("pParkedOrder","ContingentCondition",pParkedOrder->ContingentCondition,dwTime);
      printNumber("pParkedOrder","StopPrice",pParkedOrder->StopPrice,dwTime);
      printNumber("pParkedOrder","ForceCloseReason",pParkedOrder->ForceCloseReason,dwTime);
      printNumber("pParkedOrder","IsAutoSuspend",pParkedOrder->IsAutoSuspend,dwTime);
      printString("pParkedOrder","BusinessUnit",pParkedOrder->BusinessUnit,dwTime);
      printNumber("pParkedOrder","RequestID",pParkedOrder->RequestID,dwTime);
      printNumber("pParkedOrder","UserForceClose",pParkedOrder->UserForceClose,dwTime);
      printString("pParkedOrder","ExchangeID",pParkedOrder->ExchangeID,dwTime);
      printString("pParkedOrder","ParkedOrderID",pParkedOrder->ParkedOrderID,dwTime);
      printNumber("pParkedOrder","UserType",pParkedOrder->UserType,dwTime);
      printNumber("pParkedOrder","Status",pParkedOrder->Status,dwTime);
      printNumber("pParkedOrder","ErrorID",pParkedOrder->ErrorID,dwTime);
      printString("pParkedOrder","ErrorMsg",pParkedOrder->ErrorMsg,dwTime);
      printNumber("pParkedOrder","IsSwapOrder",pParkedOrder->IsSwapOrder,dwTime);
      printString("pParkedOrder","AccountID",pParkedOrder->AccountID,dwTime);
      printString("pParkedOrder","CurrencyID",pParkedOrder->CurrencyID,dwTime);
      printString("pParkedOrder","ClientID",pParkedOrder->ClientID,dwTime);
      printString("pParkedOrder","InvestUnitID",pParkedOrder->InvestUnitID,dwTime);
      printString("pParkedOrder","IPAddress",pParkedOrder->IPAddress,dwTime);
      printString("pParkedOrder","MacAddress",pParkedOrder->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryParkedOrder", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryParkedOrder(self, pParkedOrder, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询预埋撤单响应
  virtual void  OnRspQryParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryParkedOrderAction", "Enter", dwTime);

    if (NULL==pParkedOrderAction)
    {
      printString("pParkedOrderAction","CThostFtdcParkedOrderActionField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pParkedOrderAction","BrokerID",pParkedOrderAction->BrokerID,dwTime);
      printString("pParkedOrderAction","InvestorID",pParkedOrderAction->InvestorID,dwTime);
      printNumber("pParkedOrderAction","OrderActionRef",pParkedOrderAction->OrderActionRef,dwTime);
      printString("pParkedOrderAction","OrderRef",pParkedOrderAction->OrderRef,dwTime);
      printNumber("pParkedOrderAction","RequestID",pParkedOrderAction->RequestID,dwTime);
      printNumber("pParkedOrderAction","FrontID",pParkedOrderAction->FrontID,dwTime);
      printNumber("pParkedOrderAction","SessionID",pParkedOrderAction->SessionID,dwTime);
      printString("pParkedOrderAction","ExchangeID",pParkedOrderAction->ExchangeID,dwTime);
      printString("pParkedOrderAction","OrderSysID",pParkedOrderAction->OrderSysID,dwTime);
      printNumber("pParkedOrderAction","ActionFlag",pParkedOrderAction->ActionFlag,dwTime);
      printNumber("pParkedOrderAction","LimitPrice",pParkedOrderAction->LimitPrice,dwTime);
      printNumber("pParkedOrderAction","VolumeChange",pParkedOrderAction->VolumeChange,dwTime);
      printString("pParkedOrderAction","UserID",pParkedOrderAction->UserID,dwTime);
      printString("pParkedOrderAction","InstrumentID",pParkedOrderAction->InstrumentID,dwTime);
      printString("pParkedOrderAction","ParkedOrderActionID",pParkedOrderAction->ParkedOrderActionID,dwTime);
      printNumber("pParkedOrderAction","UserType",pParkedOrderAction->UserType,dwTime);
      printNumber("pParkedOrderAction","Status",pParkedOrderAction->Status,dwTime);
      printNumber("pParkedOrderAction","ErrorID",pParkedOrderAction->ErrorID,dwTime);
      printString("pParkedOrderAction","ErrorMsg",pParkedOrderAction->ErrorMsg,dwTime);
      printString("pParkedOrderAction","InvestUnitID",pParkedOrderAction->InvestUnitID,dwTime);
      printString("pParkedOrderAction","IPAddress",pParkedOrderAction->IPAddress,dwTime);
      printString("pParkedOrderAction","MacAddress",pParkedOrderAction->MacAddress,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryParkedOrderAction", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryParkedOrderAction(self, pParkedOrderAction, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询交易通知响应
  virtual void  OnRspQryTradingNotice(CThostFtdcTradingNoticeField *pTradingNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryTradingNotice", "Enter", dwTime);

    if (NULL==pTradingNotice)
    {
      printString("pTradingNotice","CThostFtdcTradingNoticeField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pTradingNotice","BrokerID",pTradingNotice->BrokerID,dwTime);
      printNumber("pTradingNotice","InvestorRange",pTradingNotice->InvestorRange,dwTime);
      printString("pTradingNotice","InvestorID",pTradingNotice->InvestorID,dwTime);
      printNumber("pTradingNotice","SequenceSeries",pTradingNotice->SequenceSeries,dwTime);
      printString("pTradingNotice","UserID",pTradingNotice->UserID,dwTime);
      printString("pTradingNotice","SendTime",pTradingNotice->SendTime,dwTime);
      printNumber("pTradingNotice","SequenceNo",pTradingNotice->SequenceNo,dwTime);
      printString("pTradingNotice","FieldContent",pTradingNotice->FieldContent,dwTime);
      printString("pTradingNotice","InvestUnitID",pTradingNotice->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryTradingNotice", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryTradingNotice(self, pTradingNotice, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询经纪公司交易参数响应
  virtual void  OnRspQryBrokerTradingParams(CThostFtdcBrokerTradingParamsField *pBrokerTradingParams, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryBrokerTradingParams", "Enter", dwTime);

    if (NULL==pBrokerTradingParams)
    {
      printString("pBrokerTradingParams","CThostFtdcBrokerTradingParamsField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pBrokerTradingParams","BrokerID",pBrokerTradingParams->BrokerID,dwTime);
      printString("pBrokerTradingParams","InvestorID",pBrokerTradingParams->InvestorID,dwTime);
      printNumber("pBrokerTradingParams","MarginPriceType",pBrokerTradingParams->MarginPriceType,dwTime);
      printNumber("pBrokerTradingParams","Algorithm",pBrokerTradingParams->Algorithm,dwTime);
      printNumber("pBrokerTradingParams","AvailIncludeCloseProfit",pBrokerTradingParams->AvailIncludeCloseProfit,dwTime);
      printString("pBrokerTradingParams","CurrencyID",pBrokerTradingParams->CurrencyID,dwTime);
      printNumber("pBrokerTradingParams","OptionRoyaltyPriceType",pBrokerTradingParams->OptionRoyaltyPriceType,dwTime);
      printString("pBrokerTradingParams","AccountID",pBrokerTradingParams->AccountID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryBrokerTradingParams", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryBrokerTradingParams(self, pBrokerTradingParams, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询经纪公司交易算法响应
  virtual void  OnRspQryBrokerTradingAlgos(CThostFtdcBrokerTradingAlgosField *pBrokerTradingAlgos, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQryBrokerTradingAlgos", "Enter", dwTime);

    if (NULL==pBrokerTradingAlgos)
    {
      printString("pBrokerTradingAlgos","CThostFtdcBrokerTradingAlgosField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pBrokerTradingAlgos","BrokerID",pBrokerTradingAlgos->BrokerID,dwTime);
      printString("pBrokerTradingAlgos","ExchangeID",pBrokerTradingAlgos->ExchangeID,dwTime);
      printString("pBrokerTradingAlgos","InstrumentID",pBrokerTradingAlgos->InstrumentID,dwTime);
      printNumber("pBrokerTradingAlgos","HandlePositionAlgoID",pBrokerTradingAlgos->HandlePositionAlgoID,dwTime);
      printNumber("pBrokerTradingAlgos","FindMarginRateAlgoID",pBrokerTradingAlgos->FindMarginRateAlgoID,dwTime);
      printNumber("pBrokerTradingAlgos","HandleTradingAccountAlgoID",pBrokerTradingAlgos->HandleTradingAccountAlgoID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQryBrokerTradingAlgos", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQryBrokerTradingAlgos(self, pBrokerTradingAlgos, pRspInfo, nRequestID, bIsLast);

  };

  ///请求查询监控中心用户令牌
  virtual void  OnRspQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQueryCFMMCTradingAccountToken", "Enter", dwTime);

    if (NULL==pQueryCFMMCTradingAccountToken)
    {
      printString("pQueryCFMMCTradingAccountToken","CThostFtdcQueryCFMMCTradingAccountTokenField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pQueryCFMMCTradingAccountToken","BrokerID",pQueryCFMMCTradingAccountToken->BrokerID,dwTime);
      printString("pQueryCFMMCTradingAccountToken","InvestorID",pQueryCFMMCTradingAccountToken->InvestorID,dwTime);
      printString("pQueryCFMMCTradingAccountToken","InvestUnitID",pQueryCFMMCTradingAccountToken->InvestUnitID,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQueryCFMMCTradingAccountToken", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQueryCFMMCTradingAccountToken(self, pQueryCFMMCTradingAccountToken, pRspInfo, nRequestID, bIsLast);

  };

  ///银行发起银行资金转期货通知
  virtual void  OnRtnFromBankToFutureByBank(CThostFtdcRspTransferField *pRspTransfer) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnFromBankToFutureByBank", "Enter", dwTime);

    if (NULL==pRspTransfer)
    {
      printString("pRspTransfer","CThostFtdcRspTransferField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pRspTransfer","TradeCode",pRspTransfer->TradeCode,dwTime);
      printString("pRspTransfer","BankID",pRspTransfer->BankID,dwTime);
      printString("pRspTransfer","BankBranchID",pRspTransfer->BankBranchID,dwTime);
      printString("pRspTransfer","BrokerID",pRspTransfer->BrokerID,dwTime);
      printString("pRspTransfer","BrokerBranchID",pRspTransfer->BrokerBranchID,dwTime);
      printString("pRspTransfer","TradeDate",pRspTransfer->TradeDate,dwTime);
      printString("pRspTransfer","TradeTime",pRspTransfer->TradeTime,dwTime);
      printString("pRspTransfer","BankSerial",pRspTransfer->BankSerial,dwTime);
      printString("pRspTransfer","TradingDay",pRspTransfer->TradingDay,dwTime);
      printNumber("pRspTransfer","PlateSerial",pRspTransfer->PlateSerial,dwTime);
      printNumber("pRspTransfer","LastFragment",pRspTransfer->LastFragment,dwTime);
      printNumber("pRspTransfer","SessionID",pRspTransfer->SessionID,dwTime);
      printString("pRspTransfer","CustomerName",pRspTransfer->CustomerName,dwTime);
      printNumber("pRspTransfer","IdCardType",pRspTransfer->IdCardType,dwTime);
      printString("pRspTransfer","IdentifiedCardNo",pRspTransfer->IdentifiedCardNo,dwTime);
      printNumber("pRspTransfer","CustType",pRspTransfer->CustType,dwTime);
      printString("pRspTransfer","BankAccount",pRspTransfer->BankAccount,dwTime);
      printString("pRspTransfer","BankPassWord",pRspTransfer->BankPassWord,dwTime);
      printString("pRspTransfer","AccountID",pRspTransfer->AccountID,dwTime);
      printString("pRspTransfer","Password",pRspTransfer->Password,dwTime);
      printNumber("pRspTransfer","InstallID",pRspTransfer->InstallID,dwTime);
      printNumber("pRspTransfer","FutureSerial",pRspTransfer->FutureSerial,dwTime);
      printString("pRspTransfer","UserID",pRspTransfer->UserID,dwTime);
      printNumber("pRspTransfer","VerifyCertNoFlag",pRspTransfer->VerifyCertNoFlag,dwTime);
      printString("pRspTransfer","CurrencyID",pRspTransfer->CurrencyID,dwTime);
      printNumber("pRspTransfer","TradeAmount",pRspTransfer->TradeAmount,dwTime);
      printNumber("pRspTransfer","FutureFetchAmount",pRspTransfer->FutureFetchAmount,dwTime);
      printNumber("pRspTransfer","FeePayFlag",pRspTransfer->FeePayFlag,dwTime);
      printNumber("pRspTransfer","CustFee",pRspTransfer->CustFee,dwTime);
      printNumber("pRspTransfer","BrokerFee",pRspTransfer->BrokerFee,dwTime);
      printString("pRspTransfer","Message",pRspTransfer->Message,dwTime);
      printString("pRspTransfer","Digest",pRspTransfer->Digest,dwTime);
      printNumber("pRspTransfer","BankAccType",pRspTransfer->BankAccType,dwTime);
      printString("pRspTransfer","DeviceID",pRspTransfer->DeviceID,dwTime);
      printNumber("pRspTransfer","BankSecuAccType",pRspTransfer->BankSecuAccType,dwTime);
      printString("pRspTransfer","BrokerIDByBank",pRspTransfer->BrokerIDByBank,dwTime);
      printString("pRspTransfer","BankSecuAcc",pRspTransfer->BankSecuAcc,dwTime);
      printNumber("pRspTransfer","BankPwdFlag",pRspTransfer->BankPwdFlag,dwTime);
      printNumber("pRspTransfer","SecuPwdFlag",pRspTransfer->SecuPwdFlag,dwTime);
      printString("pRspTransfer","OperNo",pRspTransfer->OperNo,dwTime);
      printNumber("pRspTransfer","RequestID",pRspTransfer->RequestID,dwTime);
      printNumber("pRspTransfer","TID",pRspTransfer->TID,dwTime);
      printNumber("pRspTransfer","TransferStatus",pRspTransfer->TransferStatus,dwTime);
      printNumber("pRspTransfer","ErrorID",pRspTransfer->ErrorID,dwTime);
      printString("pRspTransfer","ErrorMsg",pRspTransfer->ErrorMsg,dwTime);
      printString("pRspTransfer","LongCustomerName",pRspTransfer->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnFromBankToFutureByBank", "Leave", dwTime);

    TraderSpi_OnRtnFromBankToFutureByBank(self, pRspTransfer);

  };

  ///银行发起期货资金转银行通知
  virtual void  OnRtnFromFutureToBankByBank(CThostFtdcRspTransferField *pRspTransfer) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnFromFutureToBankByBank", "Enter", dwTime);

    if (NULL==pRspTransfer)
    {
      printString("pRspTransfer","CThostFtdcRspTransferField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pRspTransfer","TradeCode",pRspTransfer->TradeCode,dwTime);
      printString("pRspTransfer","BankID",pRspTransfer->BankID,dwTime);
      printString("pRspTransfer","BankBranchID",pRspTransfer->BankBranchID,dwTime);
      printString("pRspTransfer","BrokerID",pRspTransfer->BrokerID,dwTime);
      printString("pRspTransfer","BrokerBranchID",pRspTransfer->BrokerBranchID,dwTime);
      printString("pRspTransfer","TradeDate",pRspTransfer->TradeDate,dwTime);
      printString("pRspTransfer","TradeTime",pRspTransfer->TradeTime,dwTime);
      printString("pRspTransfer","BankSerial",pRspTransfer->BankSerial,dwTime);
      printString("pRspTransfer","TradingDay",pRspTransfer->TradingDay,dwTime);
      printNumber("pRspTransfer","PlateSerial",pRspTransfer->PlateSerial,dwTime);
      printNumber("pRspTransfer","LastFragment",pRspTransfer->LastFragment,dwTime);
      printNumber("pRspTransfer","SessionID",pRspTransfer->SessionID,dwTime);
      printString("pRspTransfer","CustomerName",pRspTransfer->CustomerName,dwTime);
      printNumber("pRspTransfer","IdCardType",pRspTransfer->IdCardType,dwTime);
      printString("pRspTransfer","IdentifiedCardNo",pRspTransfer->IdentifiedCardNo,dwTime);
      printNumber("pRspTransfer","CustType",pRspTransfer->CustType,dwTime);
      printString("pRspTransfer","BankAccount",pRspTransfer->BankAccount,dwTime);
      printString("pRspTransfer","BankPassWord",pRspTransfer->BankPassWord,dwTime);
      printString("pRspTransfer","AccountID",pRspTransfer->AccountID,dwTime);
      printString("pRspTransfer","Password",pRspTransfer->Password,dwTime);
      printNumber("pRspTransfer","InstallID",pRspTransfer->InstallID,dwTime);
      printNumber("pRspTransfer","FutureSerial",pRspTransfer->FutureSerial,dwTime);
      printString("pRspTransfer","UserID",pRspTransfer->UserID,dwTime);
      printNumber("pRspTransfer","VerifyCertNoFlag",pRspTransfer->VerifyCertNoFlag,dwTime);
      printString("pRspTransfer","CurrencyID",pRspTransfer->CurrencyID,dwTime);
      printNumber("pRspTransfer","TradeAmount",pRspTransfer->TradeAmount,dwTime);
      printNumber("pRspTransfer","FutureFetchAmount",pRspTransfer->FutureFetchAmount,dwTime);
      printNumber("pRspTransfer","FeePayFlag",pRspTransfer->FeePayFlag,dwTime);
      printNumber("pRspTransfer","CustFee",pRspTransfer->CustFee,dwTime);
      printNumber("pRspTransfer","BrokerFee",pRspTransfer->BrokerFee,dwTime);
      printString("pRspTransfer","Message",pRspTransfer->Message,dwTime);
      printString("pRspTransfer","Digest",pRspTransfer->Digest,dwTime);
      printNumber("pRspTransfer","BankAccType",pRspTransfer->BankAccType,dwTime);
      printString("pRspTransfer","DeviceID",pRspTransfer->DeviceID,dwTime);
      printNumber("pRspTransfer","BankSecuAccType",pRspTransfer->BankSecuAccType,dwTime);
      printString("pRspTransfer","BrokerIDByBank",pRspTransfer->BrokerIDByBank,dwTime);
      printString("pRspTransfer","BankSecuAcc",pRspTransfer->BankSecuAcc,dwTime);
      printNumber("pRspTransfer","BankPwdFlag",pRspTransfer->BankPwdFlag,dwTime);
      printNumber("pRspTransfer","SecuPwdFlag",pRspTransfer->SecuPwdFlag,dwTime);
      printString("pRspTransfer","OperNo",pRspTransfer->OperNo,dwTime);
      printNumber("pRspTransfer","RequestID",pRspTransfer->RequestID,dwTime);
      printNumber("pRspTransfer","TID",pRspTransfer->TID,dwTime);
      printNumber("pRspTransfer","TransferStatus",pRspTransfer->TransferStatus,dwTime);
      printNumber("pRspTransfer","ErrorID",pRspTransfer->ErrorID,dwTime);
      printString("pRspTransfer","ErrorMsg",pRspTransfer->ErrorMsg,dwTime);
      printString("pRspTransfer","LongCustomerName",pRspTransfer->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnFromFutureToBankByBank", "Leave", dwTime);

    TraderSpi_OnRtnFromFutureToBankByBank(self, pRspTransfer);

  };

  ///银行发起冲正银行转期货通知
  virtual void  OnRtnRepealFromBankToFutureByBank(CThostFtdcRspRepealField *pRspRepeal) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnRepealFromBankToFutureByBank", "Enter", dwTime);

    if (NULL==pRspRepeal)
    {
      printString("pRspRepeal","CThostFtdcRspRepealField","NULL",dwTime);
      return;
    }
    else
    {
      printNumber("pRspRepeal","RepealTimeInterval",pRspRepeal->RepealTimeInterval,dwTime);
      printNumber("pRspRepeal","RepealedTimes",pRspRepeal->RepealedTimes,dwTime);
      printNumber("pRspRepeal","BankRepealFlag",pRspRepeal->BankRepealFlag,dwTime);
      printNumber("pRspRepeal","BrokerRepealFlag",pRspRepeal->BrokerRepealFlag,dwTime);
      printNumber("pRspRepeal","PlateRepealSerial",pRspRepeal->PlateRepealSerial,dwTime);
      printString("pRspRepeal","BankRepealSerial",pRspRepeal->BankRepealSerial,dwTime);
      printNumber("pRspRepeal","FutureRepealSerial",pRspRepeal->FutureRepealSerial,dwTime);
      printString("pRspRepeal","TradeCode",pRspRepeal->TradeCode,dwTime);
      printString("pRspRepeal","BankID",pRspRepeal->BankID,dwTime);
      printString("pRspRepeal","BankBranchID",pRspRepeal->BankBranchID,dwTime);
      printString("pRspRepeal","BrokerID",pRspRepeal->BrokerID,dwTime);
      printString("pRspRepeal","BrokerBranchID",pRspRepeal->BrokerBranchID,dwTime);
      printString("pRspRepeal","TradeDate",pRspRepeal->TradeDate,dwTime);
      printString("pRspRepeal","TradeTime",pRspRepeal->TradeTime,dwTime);
      printString("pRspRepeal","BankSerial",pRspRepeal->BankSerial,dwTime);
      printString("pRspRepeal","TradingDay",pRspRepeal->TradingDay,dwTime);
      printNumber("pRspRepeal","PlateSerial",pRspRepeal->PlateSerial,dwTime);
      printNumber("pRspRepeal","LastFragment",pRspRepeal->LastFragment,dwTime);
      printNumber("pRspRepeal","SessionID",pRspRepeal->SessionID,dwTime);
      printString("pRspRepeal","CustomerName",pRspRepeal->CustomerName,dwTime);
      printNumber("pRspRepeal","IdCardType",pRspRepeal->IdCardType,dwTime);
      printString("pRspRepeal","IdentifiedCardNo",pRspRepeal->IdentifiedCardNo,dwTime);
      printNumber("pRspRepeal","CustType",pRspRepeal->CustType,dwTime);
      printString("pRspRepeal","BankAccount",pRspRepeal->BankAccount,dwTime);
      printString("pRspRepeal","BankPassWord",pRspRepeal->BankPassWord,dwTime);
      printString("pRspRepeal","AccountID",pRspRepeal->AccountID,dwTime);
      printString("pRspRepeal","Password",pRspRepeal->Password,dwTime);
      printNumber("pRspRepeal","InstallID",pRspRepeal->InstallID,dwTime);
      printNumber("pRspRepeal","FutureSerial",pRspRepeal->FutureSerial,dwTime);
      printString("pRspRepeal","UserID",pRspRepeal->UserID,dwTime);
      printNumber("pRspRepeal","VerifyCertNoFlag",pRspRepeal->VerifyCertNoFlag,dwTime);
      printString("pRspRepeal","CurrencyID",pRspRepeal->CurrencyID,dwTime);
      printNumber("pRspRepeal","TradeAmount",pRspRepeal->TradeAmount,dwTime);
      printNumber("pRspRepeal","FutureFetchAmount",pRspRepeal->FutureFetchAmount,dwTime);
      printNumber("pRspRepeal","FeePayFlag",pRspRepeal->FeePayFlag,dwTime);
      printNumber("pRspRepeal","CustFee",pRspRepeal->CustFee,dwTime);
      printNumber("pRspRepeal","BrokerFee",pRspRepeal->BrokerFee,dwTime);
      printString("pRspRepeal","Message",pRspRepeal->Message,dwTime);
      printString("pRspRepeal","Digest",pRspRepeal->Digest,dwTime);
      printNumber("pRspRepeal","BankAccType",pRspRepeal->BankAccType,dwTime);
      printString("pRspRepeal","DeviceID",pRspRepeal->DeviceID,dwTime);
      printNumber("pRspRepeal","BankSecuAccType",pRspRepeal->BankSecuAccType,dwTime);
      printString("pRspRepeal","BrokerIDByBank",pRspRepeal->BrokerIDByBank,dwTime);
      printString("pRspRepeal","BankSecuAcc",pRspRepeal->BankSecuAcc,dwTime);
      printNumber("pRspRepeal","BankPwdFlag",pRspRepeal->BankPwdFlag,dwTime);
      printNumber("pRspRepeal","SecuPwdFlag",pRspRepeal->SecuPwdFlag,dwTime);
      printString("pRspRepeal","OperNo",pRspRepeal->OperNo,dwTime);
      printNumber("pRspRepeal","RequestID",pRspRepeal->RequestID,dwTime);
      printNumber("pRspRepeal","TID",pRspRepeal->TID,dwTime);
      printNumber("pRspRepeal","TransferStatus",pRspRepeal->TransferStatus,dwTime);
      printNumber("pRspRepeal","ErrorID",pRspRepeal->ErrorID,dwTime);
      printString("pRspRepeal","ErrorMsg",pRspRepeal->ErrorMsg,dwTime);
      printString("pRspRepeal","LongCustomerName",pRspRepeal->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnRepealFromBankToFutureByBank", "Leave", dwTime);

    TraderSpi_OnRtnRepealFromBankToFutureByBank(self, pRspRepeal);

  };

  ///银行发起冲正期货转银行通知
  virtual void  OnRtnRepealFromFutureToBankByBank(CThostFtdcRspRepealField *pRspRepeal) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnRepealFromFutureToBankByBank", "Enter", dwTime);

    if (NULL==pRspRepeal)
    {
      printString("pRspRepeal","CThostFtdcRspRepealField","NULL",dwTime);
      return;
    }
    else
    {
      printNumber("pRspRepeal","RepealTimeInterval",pRspRepeal->RepealTimeInterval,dwTime);
      printNumber("pRspRepeal","RepealedTimes",pRspRepeal->RepealedTimes,dwTime);
      printNumber("pRspRepeal","BankRepealFlag",pRspRepeal->BankRepealFlag,dwTime);
      printNumber("pRspRepeal","BrokerRepealFlag",pRspRepeal->BrokerRepealFlag,dwTime);
      printNumber("pRspRepeal","PlateRepealSerial",pRspRepeal->PlateRepealSerial,dwTime);
      printString("pRspRepeal","BankRepealSerial",pRspRepeal->BankRepealSerial,dwTime);
      printNumber("pRspRepeal","FutureRepealSerial",pRspRepeal->FutureRepealSerial,dwTime);
      printString("pRspRepeal","TradeCode",pRspRepeal->TradeCode,dwTime);
      printString("pRspRepeal","BankID",pRspRepeal->BankID,dwTime);
      printString("pRspRepeal","BankBranchID",pRspRepeal->BankBranchID,dwTime);
      printString("pRspRepeal","BrokerID",pRspRepeal->BrokerID,dwTime);
      printString("pRspRepeal","BrokerBranchID",pRspRepeal->BrokerBranchID,dwTime);
      printString("pRspRepeal","TradeDate",pRspRepeal->TradeDate,dwTime);
      printString("pRspRepeal","TradeTime",pRspRepeal->TradeTime,dwTime);
      printString("pRspRepeal","BankSerial",pRspRepeal->BankSerial,dwTime);
      printString("pRspRepeal","TradingDay",pRspRepeal->TradingDay,dwTime);
      printNumber("pRspRepeal","PlateSerial",pRspRepeal->PlateSerial,dwTime);
      printNumber("pRspRepeal","LastFragment",pRspRepeal->LastFragment,dwTime);
      printNumber("pRspRepeal","SessionID",pRspRepeal->SessionID,dwTime);
      printString("pRspRepeal","CustomerName",pRspRepeal->CustomerName,dwTime);
      printNumber("pRspRepeal","IdCardType",pRspRepeal->IdCardType,dwTime);
      printString("pRspRepeal","IdentifiedCardNo",pRspRepeal->IdentifiedCardNo,dwTime);
      printNumber("pRspRepeal","CustType",pRspRepeal->CustType,dwTime);
      printString("pRspRepeal","BankAccount",pRspRepeal->BankAccount,dwTime);
      printString("pRspRepeal","BankPassWord",pRspRepeal->BankPassWord,dwTime);
      printString("pRspRepeal","AccountID",pRspRepeal->AccountID,dwTime);
      printString("pRspRepeal","Password",pRspRepeal->Password,dwTime);
      printNumber("pRspRepeal","InstallID",pRspRepeal->InstallID,dwTime);
      printNumber("pRspRepeal","FutureSerial",pRspRepeal->FutureSerial,dwTime);
      printString("pRspRepeal","UserID",pRspRepeal->UserID,dwTime);
      printNumber("pRspRepeal","VerifyCertNoFlag",pRspRepeal->VerifyCertNoFlag,dwTime);
      printString("pRspRepeal","CurrencyID",pRspRepeal->CurrencyID,dwTime);
      printNumber("pRspRepeal","TradeAmount",pRspRepeal->TradeAmount,dwTime);
      printNumber("pRspRepeal","FutureFetchAmount",pRspRepeal->FutureFetchAmount,dwTime);
      printNumber("pRspRepeal","FeePayFlag",pRspRepeal->FeePayFlag,dwTime);
      printNumber("pRspRepeal","CustFee",pRspRepeal->CustFee,dwTime);
      printNumber("pRspRepeal","BrokerFee",pRspRepeal->BrokerFee,dwTime);
      printString("pRspRepeal","Message",pRspRepeal->Message,dwTime);
      printString("pRspRepeal","Digest",pRspRepeal->Digest,dwTime);
      printNumber("pRspRepeal","BankAccType",pRspRepeal->BankAccType,dwTime);
      printString("pRspRepeal","DeviceID",pRspRepeal->DeviceID,dwTime);
      printNumber("pRspRepeal","BankSecuAccType",pRspRepeal->BankSecuAccType,dwTime);
      printString("pRspRepeal","BrokerIDByBank",pRspRepeal->BrokerIDByBank,dwTime);
      printString("pRspRepeal","BankSecuAcc",pRspRepeal->BankSecuAcc,dwTime);
      printNumber("pRspRepeal","BankPwdFlag",pRspRepeal->BankPwdFlag,dwTime);
      printNumber("pRspRepeal","SecuPwdFlag",pRspRepeal->SecuPwdFlag,dwTime);
      printString("pRspRepeal","OperNo",pRspRepeal->OperNo,dwTime);
      printNumber("pRspRepeal","RequestID",pRspRepeal->RequestID,dwTime);
      printNumber("pRspRepeal","TID",pRspRepeal->TID,dwTime);
      printNumber("pRspRepeal","TransferStatus",pRspRepeal->TransferStatus,dwTime);
      printNumber("pRspRepeal","ErrorID",pRspRepeal->ErrorID,dwTime);
      printString("pRspRepeal","ErrorMsg",pRspRepeal->ErrorMsg,dwTime);
      printString("pRspRepeal","LongCustomerName",pRspRepeal->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnRepealFromFutureToBankByBank", "Leave", dwTime);

    TraderSpi_OnRtnRepealFromFutureToBankByBank(self, pRspRepeal);

  };

  ///期货发起银行资金转期货通知
  virtual void  OnRtnFromBankToFutureByFuture(CThostFtdcRspTransferField *pRspTransfer) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnFromBankToFutureByFuture", "Enter", dwTime);

    if (NULL==pRspTransfer)
    {
      printString("pRspTransfer","CThostFtdcRspTransferField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pRspTransfer","TradeCode",pRspTransfer->TradeCode,dwTime);
      printString("pRspTransfer","BankID",pRspTransfer->BankID,dwTime);
      printString("pRspTransfer","BankBranchID",pRspTransfer->BankBranchID,dwTime);
      printString("pRspTransfer","BrokerID",pRspTransfer->BrokerID,dwTime);
      printString("pRspTransfer","BrokerBranchID",pRspTransfer->BrokerBranchID,dwTime);
      printString("pRspTransfer","TradeDate",pRspTransfer->TradeDate,dwTime);
      printString("pRspTransfer","TradeTime",pRspTransfer->TradeTime,dwTime);
      printString("pRspTransfer","BankSerial",pRspTransfer->BankSerial,dwTime);
      printString("pRspTransfer","TradingDay",pRspTransfer->TradingDay,dwTime);
      printNumber("pRspTransfer","PlateSerial",pRspTransfer->PlateSerial,dwTime);
      printNumber("pRspTransfer","LastFragment",pRspTransfer->LastFragment,dwTime);
      printNumber("pRspTransfer","SessionID",pRspTransfer->SessionID,dwTime);
      printString("pRspTransfer","CustomerName",pRspTransfer->CustomerName,dwTime);
      printNumber("pRspTransfer","IdCardType",pRspTransfer->IdCardType,dwTime);
      printString("pRspTransfer","IdentifiedCardNo",pRspTransfer->IdentifiedCardNo,dwTime);
      printNumber("pRspTransfer","CustType",pRspTransfer->CustType,dwTime);
      printString("pRspTransfer","BankAccount",pRspTransfer->BankAccount,dwTime);
      printString("pRspTransfer","BankPassWord",pRspTransfer->BankPassWord,dwTime);
      printString("pRspTransfer","AccountID",pRspTransfer->AccountID,dwTime);
      printString("pRspTransfer","Password",pRspTransfer->Password,dwTime);
      printNumber("pRspTransfer","InstallID",pRspTransfer->InstallID,dwTime);
      printNumber("pRspTransfer","FutureSerial",pRspTransfer->FutureSerial,dwTime);
      printString("pRspTransfer","UserID",pRspTransfer->UserID,dwTime);
      printNumber("pRspTransfer","VerifyCertNoFlag",pRspTransfer->VerifyCertNoFlag,dwTime);
      printString("pRspTransfer","CurrencyID",pRspTransfer->CurrencyID,dwTime);
      printNumber("pRspTransfer","TradeAmount",pRspTransfer->TradeAmount,dwTime);
      printNumber("pRspTransfer","FutureFetchAmount",pRspTransfer->FutureFetchAmount,dwTime);
      printNumber("pRspTransfer","FeePayFlag",pRspTransfer->FeePayFlag,dwTime);
      printNumber("pRspTransfer","CustFee",pRspTransfer->CustFee,dwTime);
      printNumber("pRspTransfer","BrokerFee",pRspTransfer->BrokerFee,dwTime);
      printString("pRspTransfer","Message",pRspTransfer->Message,dwTime);
      printString("pRspTransfer","Digest",pRspTransfer->Digest,dwTime);
      printNumber("pRspTransfer","BankAccType",pRspTransfer->BankAccType,dwTime);
      printString("pRspTransfer","DeviceID",pRspTransfer->DeviceID,dwTime);
      printNumber("pRspTransfer","BankSecuAccType",pRspTransfer->BankSecuAccType,dwTime);
      printString("pRspTransfer","BrokerIDByBank",pRspTransfer->BrokerIDByBank,dwTime);
      printString("pRspTransfer","BankSecuAcc",pRspTransfer->BankSecuAcc,dwTime);
      printNumber("pRspTransfer","BankPwdFlag",pRspTransfer->BankPwdFlag,dwTime);
      printNumber("pRspTransfer","SecuPwdFlag",pRspTransfer->SecuPwdFlag,dwTime);
      printString("pRspTransfer","OperNo",pRspTransfer->OperNo,dwTime);
      printNumber("pRspTransfer","RequestID",pRspTransfer->RequestID,dwTime);
      printNumber("pRspTransfer","TID",pRspTransfer->TID,dwTime);
      printNumber("pRspTransfer","TransferStatus",pRspTransfer->TransferStatus,dwTime);
      printNumber("pRspTransfer","ErrorID",pRspTransfer->ErrorID,dwTime);
      printString("pRspTransfer","ErrorMsg",pRspTransfer->ErrorMsg,dwTime);
      printString("pRspTransfer","LongCustomerName",pRspTransfer->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnFromBankToFutureByFuture", "Leave", dwTime);

    TraderSpi_OnRtnFromBankToFutureByFuture(self, pRspTransfer);

  };

  ///期货发起期货资金转银行通知
  virtual void  OnRtnFromFutureToBankByFuture(CThostFtdcRspTransferField *pRspTransfer) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnFromFutureToBankByFuture", "Enter", dwTime);

    if (NULL==pRspTransfer)
    {
      printString("pRspTransfer","CThostFtdcRspTransferField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pRspTransfer","TradeCode",pRspTransfer->TradeCode,dwTime);
      printString("pRspTransfer","BankID",pRspTransfer->BankID,dwTime);
      printString("pRspTransfer","BankBranchID",pRspTransfer->BankBranchID,dwTime);
      printString("pRspTransfer","BrokerID",pRspTransfer->BrokerID,dwTime);
      printString("pRspTransfer","BrokerBranchID",pRspTransfer->BrokerBranchID,dwTime);
      printString("pRspTransfer","TradeDate",pRspTransfer->TradeDate,dwTime);
      printString("pRspTransfer","TradeTime",pRspTransfer->TradeTime,dwTime);
      printString("pRspTransfer","BankSerial",pRspTransfer->BankSerial,dwTime);
      printString("pRspTransfer","TradingDay",pRspTransfer->TradingDay,dwTime);
      printNumber("pRspTransfer","PlateSerial",pRspTransfer->PlateSerial,dwTime);
      printNumber("pRspTransfer","LastFragment",pRspTransfer->LastFragment,dwTime);
      printNumber("pRspTransfer","SessionID",pRspTransfer->SessionID,dwTime);
      printString("pRspTransfer","CustomerName",pRspTransfer->CustomerName,dwTime);
      printNumber("pRspTransfer","IdCardType",pRspTransfer->IdCardType,dwTime);
      printString("pRspTransfer","IdentifiedCardNo",pRspTransfer->IdentifiedCardNo,dwTime);
      printNumber("pRspTransfer","CustType",pRspTransfer->CustType,dwTime);
      printString("pRspTransfer","BankAccount",pRspTransfer->BankAccount,dwTime);
      printString("pRspTransfer","BankPassWord",pRspTransfer->BankPassWord,dwTime);
      printString("pRspTransfer","AccountID",pRspTransfer->AccountID,dwTime);
      printString("pRspTransfer","Password",pRspTransfer->Password,dwTime);
      printNumber("pRspTransfer","InstallID",pRspTransfer->InstallID,dwTime);
      printNumber("pRspTransfer","FutureSerial",pRspTransfer->FutureSerial,dwTime);
      printString("pRspTransfer","UserID",pRspTransfer->UserID,dwTime);
      printNumber("pRspTransfer","VerifyCertNoFlag",pRspTransfer->VerifyCertNoFlag,dwTime);
      printString("pRspTransfer","CurrencyID",pRspTransfer->CurrencyID,dwTime);
      printNumber("pRspTransfer","TradeAmount",pRspTransfer->TradeAmount,dwTime);
      printNumber("pRspTransfer","FutureFetchAmount",pRspTransfer->FutureFetchAmount,dwTime);
      printNumber("pRspTransfer","FeePayFlag",pRspTransfer->FeePayFlag,dwTime);
      printNumber("pRspTransfer","CustFee",pRspTransfer->CustFee,dwTime);
      printNumber("pRspTransfer","BrokerFee",pRspTransfer->BrokerFee,dwTime);
      printString("pRspTransfer","Message",pRspTransfer->Message,dwTime);
      printString("pRspTransfer","Digest",pRspTransfer->Digest,dwTime);
      printNumber("pRspTransfer","BankAccType",pRspTransfer->BankAccType,dwTime);
      printString("pRspTransfer","DeviceID",pRspTransfer->DeviceID,dwTime);
      printNumber("pRspTransfer","BankSecuAccType",pRspTransfer->BankSecuAccType,dwTime);
      printString("pRspTransfer","BrokerIDByBank",pRspTransfer->BrokerIDByBank,dwTime);
      printString("pRspTransfer","BankSecuAcc",pRspTransfer->BankSecuAcc,dwTime);
      printNumber("pRspTransfer","BankPwdFlag",pRspTransfer->BankPwdFlag,dwTime);
      printNumber("pRspTransfer","SecuPwdFlag",pRspTransfer->SecuPwdFlag,dwTime);
      printString("pRspTransfer","OperNo",pRspTransfer->OperNo,dwTime);
      printNumber("pRspTransfer","RequestID",pRspTransfer->RequestID,dwTime);
      printNumber("pRspTransfer","TID",pRspTransfer->TID,dwTime);
      printNumber("pRspTransfer","TransferStatus",pRspTransfer->TransferStatus,dwTime);
      printNumber("pRspTransfer","ErrorID",pRspTransfer->ErrorID,dwTime);
      printString("pRspTransfer","ErrorMsg",pRspTransfer->ErrorMsg,dwTime);
      printString("pRspTransfer","LongCustomerName",pRspTransfer->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnFromFutureToBankByFuture", "Leave", dwTime);

    TraderSpi_OnRtnFromFutureToBankByFuture(self, pRspTransfer);

  };

  ///系统运行时期货端手工发起冲正银行转期货请求，银行处理完毕后报盘发回的通知
  virtual void  OnRtnRepealFromBankToFutureByFutureManual(CThostFtdcRspRepealField *pRspRepeal) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnRepealFromBankToFutureByFutureManual", "Enter", dwTime);

    if (NULL==pRspRepeal)
    {
      printString("pRspRepeal","CThostFtdcRspRepealField","NULL",dwTime);
      return;
    }
    else
    {
      printNumber("pRspRepeal","RepealTimeInterval",pRspRepeal->RepealTimeInterval,dwTime);
      printNumber("pRspRepeal","RepealedTimes",pRspRepeal->RepealedTimes,dwTime);
      printNumber("pRspRepeal","BankRepealFlag",pRspRepeal->BankRepealFlag,dwTime);
      printNumber("pRspRepeal","BrokerRepealFlag",pRspRepeal->BrokerRepealFlag,dwTime);
      printNumber("pRspRepeal","PlateRepealSerial",pRspRepeal->PlateRepealSerial,dwTime);
      printString("pRspRepeal","BankRepealSerial",pRspRepeal->BankRepealSerial,dwTime);
      printNumber("pRspRepeal","FutureRepealSerial",pRspRepeal->FutureRepealSerial,dwTime);
      printString("pRspRepeal","TradeCode",pRspRepeal->TradeCode,dwTime);
      printString("pRspRepeal","BankID",pRspRepeal->BankID,dwTime);
      printString("pRspRepeal","BankBranchID",pRspRepeal->BankBranchID,dwTime);
      printString("pRspRepeal","BrokerID",pRspRepeal->BrokerID,dwTime);
      printString("pRspRepeal","BrokerBranchID",pRspRepeal->BrokerBranchID,dwTime);
      printString("pRspRepeal","TradeDate",pRspRepeal->TradeDate,dwTime);
      printString("pRspRepeal","TradeTime",pRspRepeal->TradeTime,dwTime);
      printString("pRspRepeal","BankSerial",pRspRepeal->BankSerial,dwTime);
      printString("pRspRepeal","TradingDay",pRspRepeal->TradingDay,dwTime);
      printNumber("pRspRepeal","PlateSerial",pRspRepeal->PlateSerial,dwTime);
      printNumber("pRspRepeal","LastFragment",pRspRepeal->LastFragment,dwTime);
      printNumber("pRspRepeal","SessionID",pRspRepeal->SessionID,dwTime);
      printString("pRspRepeal","CustomerName",pRspRepeal->CustomerName,dwTime);
      printNumber("pRspRepeal","IdCardType",pRspRepeal->IdCardType,dwTime);
      printString("pRspRepeal","IdentifiedCardNo",pRspRepeal->IdentifiedCardNo,dwTime);
      printNumber("pRspRepeal","CustType",pRspRepeal->CustType,dwTime);
      printString("pRspRepeal","BankAccount",pRspRepeal->BankAccount,dwTime);
      printString("pRspRepeal","BankPassWord",pRspRepeal->BankPassWord,dwTime);
      printString("pRspRepeal","AccountID",pRspRepeal->AccountID,dwTime);
      printString("pRspRepeal","Password",pRspRepeal->Password,dwTime);
      printNumber("pRspRepeal","InstallID",pRspRepeal->InstallID,dwTime);
      printNumber("pRspRepeal","FutureSerial",pRspRepeal->FutureSerial,dwTime);
      printString("pRspRepeal","UserID",pRspRepeal->UserID,dwTime);
      printNumber("pRspRepeal","VerifyCertNoFlag",pRspRepeal->VerifyCertNoFlag,dwTime);
      printString("pRspRepeal","CurrencyID",pRspRepeal->CurrencyID,dwTime);
      printNumber("pRspRepeal","TradeAmount",pRspRepeal->TradeAmount,dwTime);
      printNumber("pRspRepeal","FutureFetchAmount",pRspRepeal->FutureFetchAmount,dwTime);
      printNumber("pRspRepeal","FeePayFlag",pRspRepeal->FeePayFlag,dwTime);
      printNumber("pRspRepeal","CustFee",pRspRepeal->CustFee,dwTime);
      printNumber("pRspRepeal","BrokerFee",pRspRepeal->BrokerFee,dwTime);
      printString("pRspRepeal","Message",pRspRepeal->Message,dwTime);
      printString("pRspRepeal","Digest",pRspRepeal->Digest,dwTime);
      printNumber("pRspRepeal","BankAccType",pRspRepeal->BankAccType,dwTime);
      printString("pRspRepeal","DeviceID",pRspRepeal->DeviceID,dwTime);
      printNumber("pRspRepeal","BankSecuAccType",pRspRepeal->BankSecuAccType,dwTime);
      printString("pRspRepeal","BrokerIDByBank",pRspRepeal->BrokerIDByBank,dwTime);
      printString("pRspRepeal","BankSecuAcc",pRspRepeal->BankSecuAcc,dwTime);
      printNumber("pRspRepeal","BankPwdFlag",pRspRepeal->BankPwdFlag,dwTime);
      printNumber("pRspRepeal","SecuPwdFlag",pRspRepeal->SecuPwdFlag,dwTime);
      printString("pRspRepeal","OperNo",pRspRepeal->OperNo,dwTime);
      printNumber("pRspRepeal","RequestID",pRspRepeal->RequestID,dwTime);
      printNumber("pRspRepeal","TID",pRspRepeal->TID,dwTime);
      printNumber("pRspRepeal","TransferStatus",pRspRepeal->TransferStatus,dwTime);
      printNumber("pRspRepeal","ErrorID",pRspRepeal->ErrorID,dwTime);
      printString("pRspRepeal","ErrorMsg",pRspRepeal->ErrorMsg,dwTime);
      printString("pRspRepeal","LongCustomerName",pRspRepeal->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnRepealFromBankToFutureByFutureManual", "Leave", dwTime);

    TraderSpi_OnRtnRepealFromBankToFutureByFutureManual(self, pRspRepeal);

  };

  ///系统运行时期货端手工发起冲正期货转银行请求，银行处理完毕后报盘发回的通知
  virtual void  OnRtnRepealFromFutureToBankByFutureManual(CThostFtdcRspRepealField *pRspRepeal) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnRepealFromFutureToBankByFutureManual", "Enter", dwTime);

    if (NULL==pRspRepeal)
    {
      printString("pRspRepeal","CThostFtdcRspRepealField","NULL",dwTime);
      return;
    }
    else
    {
      printNumber("pRspRepeal","RepealTimeInterval",pRspRepeal->RepealTimeInterval,dwTime);
      printNumber("pRspRepeal","RepealedTimes",pRspRepeal->RepealedTimes,dwTime);
      printNumber("pRspRepeal","BankRepealFlag",pRspRepeal->BankRepealFlag,dwTime);
      printNumber("pRspRepeal","BrokerRepealFlag",pRspRepeal->BrokerRepealFlag,dwTime);
      printNumber("pRspRepeal","PlateRepealSerial",pRspRepeal->PlateRepealSerial,dwTime);
      printString("pRspRepeal","BankRepealSerial",pRspRepeal->BankRepealSerial,dwTime);
      printNumber("pRspRepeal","FutureRepealSerial",pRspRepeal->FutureRepealSerial,dwTime);
      printString("pRspRepeal","TradeCode",pRspRepeal->TradeCode,dwTime);
      printString("pRspRepeal","BankID",pRspRepeal->BankID,dwTime);
      printString("pRspRepeal","BankBranchID",pRspRepeal->BankBranchID,dwTime);
      printString("pRspRepeal","BrokerID",pRspRepeal->BrokerID,dwTime);
      printString("pRspRepeal","BrokerBranchID",pRspRepeal->BrokerBranchID,dwTime);
      printString("pRspRepeal","TradeDate",pRspRepeal->TradeDate,dwTime);
      printString("pRspRepeal","TradeTime",pRspRepeal->TradeTime,dwTime);
      printString("pRspRepeal","BankSerial",pRspRepeal->BankSerial,dwTime);
      printString("pRspRepeal","TradingDay",pRspRepeal->TradingDay,dwTime);
      printNumber("pRspRepeal","PlateSerial",pRspRepeal->PlateSerial,dwTime);
      printNumber("pRspRepeal","LastFragment",pRspRepeal->LastFragment,dwTime);
      printNumber("pRspRepeal","SessionID",pRspRepeal->SessionID,dwTime);
      printString("pRspRepeal","CustomerName",pRspRepeal->CustomerName,dwTime);
      printNumber("pRspRepeal","IdCardType",pRspRepeal->IdCardType,dwTime);
      printString("pRspRepeal","IdentifiedCardNo",pRspRepeal->IdentifiedCardNo,dwTime);
      printNumber("pRspRepeal","CustType",pRspRepeal->CustType,dwTime);
      printString("pRspRepeal","BankAccount",pRspRepeal->BankAccount,dwTime);
      printString("pRspRepeal","BankPassWord",pRspRepeal->BankPassWord,dwTime);
      printString("pRspRepeal","AccountID",pRspRepeal->AccountID,dwTime);
      printString("pRspRepeal","Password",pRspRepeal->Password,dwTime);
      printNumber("pRspRepeal","InstallID",pRspRepeal->InstallID,dwTime);
      printNumber("pRspRepeal","FutureSerial",pRspRepeal->FutureSerial,dwTime);
      printString("pRspRepeal","UserID",pRspRepeal->UserID,dwTime);
      printNumber("pRspRepeal","VerifyCertNoFlag",pRspRepeal->VerifyCertNoFlag,dwTime);
      printString("pRspRepeal","CurrencyID",pRspRepeal->CurrencyID,dwTime);
      printNumber("pRspRepeal","TradeAmount",pRspRepeal->TradeAmount,dwTime);
      printNumber("pRspRepeal","FutureFetchAmount",pRspRepeal->FutureFetchAmount,dwTime);
      printNumber("pRspRepeal","FeePayFlag",pRspRepeal->FeePayFlag,dwTime);
      printNumber("pRspRepeal","CustFee",pRspRepeal->CustFee,dwTime);
      printNumber("pRspRepeal","BrokerFee",pRspRepeal->BrokerFee,dwTime);
      printString("pRspRepeal","Message",pRspRepeal->Message,dwTime);
      printString("pRspRepeal","Digest",pRspRepeal->Digest,dwTime);
      printNumber("pRspRepeal","BankAccType",pRspRepeal->BankAccType,dwTime);
      printString("pRspRepeal","DeviceID",pRspRepeal->DeviceID,dwTime);
      printNumber("pRspRepeal","BankSecuAccType",pRspRepeal->BankSecuAccType,dwTime);
      printString("pRspRepeal","BrokerIDByBank",pRspRepeal->BrokerIDByBank,dwTime);
      printString("pRspRepeal","BankSecuAcc",pRspRepeal->BankSecuAcc,dwTime);
      printNumber("pRspRepeal","BankPwdFlag",pRspRepeal->BankPwdFlag,dwTime);
      printNumber("pRspRepeal","SecuPwdFlag",pRspRepeal->SecuPwdFlag,dwTime);
      printString("pRspRepeal","OperNo",pRspRepeal->OperNo,dwTime);
      printNumber("pRspRepeal","RequestID",pRspRepeal->RequestID,dwTime);
      printNumber("pRspRepeal","TID",pRspRepeal->TID,dwTime);
      printNumber("pRspRepeal","TransferStatus",pRspRepeal->TransferStatus,dwTime);
      printNumber("pRspRepeal","ErrorID",pRspRepeal->ErrorID,dwTime);
      printString("pRspRepeal","ErrorMsg",pRspRepeal->ErrorMsg,dwTime);
      printString("pRspRepeal","LongCustomerName",pRspRepeal->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnRepealFromFutureToBankByFutureManual", "Leave", dwTime);

    TraderSpi_OnRtnRepealFromFutureToBankByFutureManual(self, pRspRepeal);

  };

  ///期货发起查询银行余额通知
  virtual void  OnRtnQueryBankBalanceByFuture(CThostFtdcNotifyQueryAccountField *pNotifyQueryAccount) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnQueryBankBalanceByFuture", "Enter", dwTime);

    if (NULL==pNotifyQueryAccount)
    {
      printString("pNotifyQueryAccount","CThostFtdcNotifyQueryAccountField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pNotifyQueryAccount","TradeCode",pNotifyQueryAccount->TradeCode,dwTime);
      printString("pNotifyQueryAccount","BankID",pNotifyQueryAccount->BankID,dwTime);
      printString("pNotifyQueryAccount","BankBranchID",pNotifyQueryAccount->BankBranchID,dwTime);
      printString("pNotifyQueryAccount","BrokerID",pNotifyQueryAccount->BrokerID,dwTime);
      printString("pNotifyQueryAccount","BrokerBranchID",pNotifyQueryAccount->BrokerBranchID,dwTime);
      printString("pNotifyQueryAccount","TradeDate",pNotifyQueryAccount->TradeDate,dwTime);
      printString("pNotifyQueryAccount","TradeTime",pNotifyQueryAccount->TradeTime,dwTime);
      printString("pNotifyQueryAccount","BankSerial",pNotifyQueryAccount->BankSerial,dwTime);
      printString("pNotifyQueryAccount","TradingDay",pNotifyQueryAccount->TradingDay,dwTime);
      printNumber("pNotifyQueryAccount","PlateSerial",pNotifyQueryAccount->PlateSerial,dwTime);
      printNumber("pNotifyQueryAccount","LastFragment",pNotifyQueryAccount->LastFragment,dwTime);
      printNumber("pNotifyQueryAccount","SessionID",pNotifyQueryAccount->SessionID,dwTime);
      printString("pNotifyQueryAccount","CustomerName",pNotifyQueryAccount->CustomerName,dwTime);
      printNumber("pNotifyQueryAccount","IdCardType",pNotifyQueryAccount->IdCardType,dwTime);
      printString("pNotifyQueryAccount","IdentifiedCardNo",pNotifyQueryAccount->IdentifiedCardNo,dwTime);
      printNumber("pNotifyQueryAccount","CustType",pNotifyQueryAccount->CustType,dwTime);
      printString("pNotifyQueryAccount","BankAccount",pNotifyQueryAccount->BankAccount,dwTime);
      printString("pNotifyQueryAccount","BankPassWord",pNotifyQueryAccount->BankPassWord,dwTime);
      printString("pNotifyQueryAccount","AccountID",pNotifyQueryAccount->AccountID,dwTime);
      printString("pNotifyQueryAccount","Password",pNotifyQueryAccount->Password,dwTime);
      printNumber("pNotifyQueryAccount","FutureSerial",pNotifyQueryAccount->FutureSerial,dwTime);
      printNumber("pNotifyQueryAccount","InstallID",pNotifyQueryAccount->InstallID,dwTime);
      printString("pNotifyQueryAccount","UserID",pNotifyQueryAccount->UserID,dwTime);
      printNumber("pNotifyQueryAccount","VerifyCertNoFlag",pNotifyQueryAccount->VerifyCertNoFlag,dwTime);
      printString("pNotifyQueryAccount","CurrencyID",pNotifyQueryAccount->CurrencyID,dwTime);
      printString("pNotifyQueryAccount","Digest",pNotifyQueryAccount->Digest,dwTime);
      printNumber("pNotifyQueryAccount","BankAccType",pNotifyQueryAccount->BankAccType,dwTime);
      printString("pNotifyQueryAccount","DeviceID",pNotifyQueryAccount->DeviceID,dwTime);
      printNumber("pNotifyQueryAccount","BankSecuAccType",pNotifyQueryAccount->BankSecuAccType,dwTime);
      printString("pNotifyQueryAccount","BrokerIDByBank",pNotifyQueryAccount->BrokerIDByBank,dwTime);
      printString("pNotifyQueryAccount","BankSecuAcc",pNotifyQueryAccount->BankSecuAcc,dwTime);
      printNumber("pNotifyQueryAccount","BankPwdFlag",pNotifyQueryAccount->BankPwdFlag,dwTime);
      printNumber("pNotifyQueryAccount","SecuPwdFlag",pNotifyQueryAccount->SecuPwdFlag,dwTime);
      printString("pNotifyQueryAccount","OperNo",pNotifyQueryAccount->OperNo,dwTime);
      printNumber("pNotifyQueryAccount","RequestID",pNotifyQueryAccount->RequestID,dwTime);
      printNumber("pNotifyQueryAccount","TID",pNotifyQueryAccount->TID,dwTime);
      printNumber("pNotifyQueryAccount","BankUseAmount",pNotifyQueryAccount->BankUseAmount,dwTime);
      printNumber("pNotifyQueryAccount","BankFetchAmount",pNotifyQueryAccount->BankFetchAmount,dwTime);
      printNumber("pNotifyQueryAccount","ErrorID",pNotifyQueryAccount->ErrorID,dwTime);
      printString("pNotifyQueryAccount","ErrorMsg",pNotifyQueryAccount->ErrorMsg,dwTime);
      printString("pNotifyQueryAccount","LongCustomerName",pNotifyQueryAccount->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnQueryBankBalanceByFuture", "Leave", dwTime);

    TraderSpi_OnRtnQueryBankBalanceByFuture(self, pNotifyQueryAccount);

  };

  ///期货发起银行资金转期货错误回报
  virtual void  OnErrRtnBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnErrRtnBankToFutureByFuture", "Enter", dwTime);

    if (NULL==pReqTransfer)
    {
      printString("pReqTransfer","CThostFtdcReqTransferField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pReqTransfer","TradeCode",pReqTransfer->TradeCode,dwTime);
      printString("pReqTransfer","BankID",pReqTransfer->BankID,dwTime);
      printString("pReqTransfer","BankBranchID",pReqTransfer->BankBranchID,dwTime);
      printString("pReqTransfer","BrokerID",pReqTransfer->BrokerID,dwTime);
      printString("pReqTransfer","BrokerBranchID",pReqTransfer->BrokerBranchID,dwTime);
      printString("pReqTransfer","TradeDate",pReqTransfer->TradeDate,dwTime);
      printString("pReqTransfer","TradeTime",pReqTransfer->TradeTime,dwTime);
      printString("pReqTransfer","BankSerial",pReqTransfer->BankSerial,dwTime);
      printString("pReqTransfer","TradingDay",pReqTransfer->TradingDay,dwTime);
      printNumber("pReqTransfer","PlateSerial",pReqTransfer->PlateSerial,dwTime);
      printNumber("pReqTransfer","LastFragment",pReqTransfer->LastFragment,dwTime);
      printNumber("pReqTransfer","SessionID",pReqTransfer->SessionID,dwTime);
      printString("pReqTransfer","CustomerName",pReqTransfer->CustomerName,dwTime);
      printNumber("pReqTransfer","IdCardType",pReqTransfer->IdCardType,dwTime);
      printString("pReqTransfer","IdentifiedCardNo",pReqTransfer->IdentifiedCardNo,dwTime);
      printNumber("pReqTransfer","CustType",pReqTransfer->CustType,dwTime);
      printString("pReqTransfer","BankAccount",pReqTransfer->BankAccount,dwTime);
      printString("pReqTransfer","BankPassWord",pReqTransfer->BankPassWord,dwTime);
      printString("pReqTransfer","AccountID",pReqTransfer->AccountID,dwTime);
      printString("pReqTransfer","Password",pReqTransfer->Password,dwTime);
      printNumber("pReqTransfer","InstallID",pReqTransfer->InstallID,dwTime);
      printNumber("pReqTransfer","FutureSerial",pReqTransfer->FutureSerial,dwTime);
      printString("pReqTransfer","UserID",pReqTransfer->UserID,dwTime);
      printNumber("pReqTransfer","VerifyCertNoFlag",pReqTransfer->VerifyCertNoFlag,dwTime);
      printString("pReqTransfer","CurrencyID",pReqTransfer->CurrencyID,dwTime);
      printNumber("pReqTransfer","TradeAmount",pReqTransfer->TradeAmount,dwTime);
      printNumber("pReqTransfer","FutureFetchAmount",pReqTransfer->FutureFetchAmount,dwTime);
      printNumber("pReqTransfer","FeePayFlag",pReqTransfer->FeePayFlag,dwTime);
      printNumber("pReqTransfer","CustFee",pReqTransfer->CustFee,dwTime);
      printNumber("pReqTransfer","BrokerFee",pReqTransfer->BrokerFee,dwTime);
      printString("pReqTransfer","Message",pReqTransfer->Message,dwTime);
      printString("pReqTransfer","Digest",pReqTransfer->Digest,dwTime);
      printNumber("pReqTransfer","BankAccType",pReqTransfer->BankAccType,dwTime);
      printString("pReqTransfer","DeviceID",pReqTransfer->DeviceID,dwTime);
      printNumber("pReqTransfer","BankSecuAccType",pReqTransfer->BankSecuAccType,dwTime);
      printString("pReqTransfer","BrokerIDByBank",pReqTransfer->BrokerIDByBank,dwTime);
      printString("pReqTransfer","BankSecuAcc",pReqTransfer->BankSecuAcc,dwTime);
      printNumber("pReqTransfer","BankPwdFlag",pReqTransfer->BankPwdFlag,dwTime);
      printNumber("pReqTransfer","SecuPwdFlag",pReqTransfer->SecuPwdFlag,dwTime);
      printString("pReqTransfer","OperNo",pReqTransfer->OperNo,dwTime);
      printNumber("pReqTransfer","RequestID",pReqTransfer->RequestID,dwTime);
      printNumber("pReqTransfer","TID",pReqTransfer->TID,dwTime);
      printNumber("pReqTransfer","TransferStatus",pReqTransfer->TransferStatus,dwTime);
      printString("pReqTransfer","LongCustomerName",pReqTransfer->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnErrRtnBankToFutureByFuture", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnErrRtnBankToFutureByFuture(self, pReqTransfer, pRspInfo);

  };

  ///期货发起期货资金转银行错误回报
  virtual void  OnErrRtnFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnErrRtnFutureToBankByFuture", "Enter", dwTime);

    if (NULL==pReqTransfer)
    {
      printString("pReqTransfer","CThostFtdcReqTransferField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pReqTransfer","TradeCode",pReqTransfer->TradeCode,dwTime);
      printString("pReqTransfer","BankID",pReqTransfer->BankID,dwTime);
      printString("pReqTransfer","BankBranchID",pReqTransfer->BankBranchID,dwTime);
      printString("pReqTransfer","BrokerID",pReqTransfer->BrokerID,dwTime);
      printString("pReqTransfer","BrokerBranchID",pReqTransfer->BrokerBranchID,dwTime);
      printString("pReqTransfer","TradeDate",pReqTransfer->TradeDate,dwTime);
      printString("pReqTransfer","TradeTime",pReqTransfer->TradeTime,dwTime);
      printString("pReqTransfer","BankSerial",pReqTransfer->BankSerial,dwTime);
      printString("pReqTransfer","TradingDay",pReqTransfer->TradingDay,dwTime);
      printNumber("pReqTransfer","PlateSerial",pReqTransfer->PlateSerial,dwTime);
      printNumber("pReqTransfer","LastFragment",pReqTransfer->LastFragment,dwTime);
      printNumber("pReqTransfer","SessionID",pReqTransfer->SessionID,dwTime);
      printString("pReqTransfer","CustomerName",pReqTransfer->CustomerName,dwTime);
      printNumber("pReqTransfer","IdCardType",pReqTransfer->IdCardType,dwTime);
      printString("pReqTransfer","IdentifiedCardNo",pReqTransfer->IdentifiedCardNo,dwTime);
      printNumber("pReqTransfer","CustType",pReqTransfer->CustType,dwTime);
      printString("pReqTransfer","BankAccount",pReqTransfer->BankAccount,dwTime);
      printString("pReqTransfer","BankPassWord",pReqTransfer->BankPassWord,dwTime);
      printString("pReqTransfer","AccountID",pReqTransfer->AccountID,dwTime);
      printString("pReqTransfer","Password",pReqTransfer->Password,dwTime);
      printNumber("pReqTransfer","InstallID",pReqTransfer->InstallID,dwTime);
      printNumber("pReqTransfer","FutureSerial",pReqTransfer->FutureSerial,dwTime);
      printString("pReqTransfer","UserID",pReqTransfer->UserID,dwTime);
      printNumber("pReqTransfer","VerifyCertNoFlag",pReqTransfer->VerifyCertNoFlag,dwTime);
      printString("pReqTransfer","CurrencyID",pReqTransfer->CurrencyID,dwTime);
      printNumber("pReqTransfer","TradeAmount",pReqTransfer->TradeAmount,dwTime);
      printNumber("pReqTransfer","FutureFetchAmount",pReqTransfer->FutureFetchAmount,dwTime);
      printNumber("pReqTransfer","FeePayFlag",pReqTransfer->FeePayFlag,dwTime);
      printNumber("pReqTransfer","CustFee",pReqTransfer->CustFee,dwTime);
      printNumber("pReqTransfer","BrokerFee",pReqTransfer->BrokerFee,dwTime);
      printString("pReqTransfer","Message",pReqTransfer->Message,dwTime);
      printString("pReqTransfer","Digest",pReqTransfer->Digest,dwTime);
      printNumber("pReqTransfer","BankAccType",pReqTransfer->BankAccType,dwTime);
      printString("pReqTransfer","DeviceID",pReqTransfer->DeviceID,dwTime);
      printNumber("pReqTransfer","BankSecuAccType",pReqTransfer->BankSecuAccType,dwTime);
      printString("pReqTransfer","BrokerIDByBank",pReqTransfer->BrokerIDByBank,dwTime);
      printString("pReqTransfer","BankSecuAcc",pReqTransfer->BankSecuAcc,dwTime);
      printNumber("pReqTransfer","BankPwdFlag",pReqTransfer->BankPwdFlag,dwTime);
      printNumber("pReqTransfer","SecuPwdFlag",pReqTransfer->SecuPwdFlag,dwTime);
      printString("pReqTransfer","OperNo",pReqTransfer->OperNo,dwTime);
      printNumber("pReqTransfer","RequestID",pReqTransfer->RequestID,dwTime);
      printNumber("pReqTransfer","TID",pReqTransfer->TID,dwTime);
      printNumber("pReqTransfer","TransferStatus",pReqTransfer->TransferStatus,dwTime);
      printString("pReqTransfer","LongCustomerName",pReqTransfer->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnErrRtnFutureToBankByFuture", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnErrRtnFutureToBankByFuture(self, pReqTransfer, pRspInfo);

  };

  ///系统运行时期货端手工发起冲正银行转期货错误回报
  virtual void  OnErrRtnRepealBankToFutureByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnErrRtnRepealBankToFutureByFutureManual", "Enter", dwTime);

    if (NULL==pReqRepeal)
    {
      printString("pReqRepeal","CThostFtdcReqRepealField","NULL",dwTime);
      return;
    }
    else
    {
      printNumber("pReqRepeal","RepealTimeInterval",pReqRepeal->RepealTimeInterval,dwTime);
      printNumber("pReqRepeal","RepealedTimes",pReqRepeal->RepealedTimes,dwTime);
      printNumber("pReqRepeal","BankRepealFlag",pReqRepeal->BankRepealFlag,dwTime);
      printNumber("pReqRepeal","BrokerRepealFlag",pReqRepeal->BrokerRepealFlag,dwTime);
      printNumber("pReqRepeal","PlateRepealSerial",pReqRepeal->PlateRepealSerial,dwTime);
      printString("pReqRepeal","BankRepealSerial",pReqRepeal->BankRepealSerial,dwTime);
      printNumber("pReqRepeal","FutureRepealSerial",pReqRepeal->FutureRepealSerial,dwTime);
      printString("pReqRepeal","TradeCode",pReqRepeal->TradeCode,dwTime);
      printString("pReqRepeal","BankID",pReqRepeal->BankID,dwTime);
      printString("pReqRepeal","BankBranchID",pReqRepeal->BankBranchID,dwTime);
      printString("pReqRepeal","BrokerID",pReqRepeal->BrokerID,dwTime);
      printString("pReqRepeal","BrokerBranchID",pReqRepeal->BrokerBranchID,dwTime);
      printString("pReqRepeal","TradeDate",pReqRepeal->TradeDate,dwTime);
      printString("pReqRepeal","TradeTime",pReqRepeal->TradeTime,dwTime);
      printString("pReqRepeal","BankSerial",pReqRepeal->BankSerial,dwTime);
      printString("pReqRepeal","TradingDay",pReqRepeal->TradingDay,dwTime);
      printNumber("pReqRepeal","PlateSerial",pReqRepeal->PlateSerial,dwTime);
      printNumber("pReqRepeal","LastFragment",pReqRepeal->LastFragment,dwTime);
      printNumber("pReqRepeal","SessionID",pReqRepeal->SessionID,dwTime);
      printString("pReqRepeal","CustomerName",pReqRepeal->CustomerName,dwTime);
      printNumber("pReqRepeal","IdCardType",pReqRepeal->IdCardType,dwTime);
      printString("pReqRepeal","IdentifiedCardNo",pReqRepeal->IdentifiedCardNo,dwTime);
      printNumber("pReqRepeal","CustType",pReqRepeal->CustType,dwTime);
      printString("pReqRepeal","BankAccount",pReqRepeal->BankAccount,dwTime);
      printString("pReqRepeal","BankPassWord",pReqRepeal->BankPassWord,dwTime);
      printString("pReqRepeal","AccountID",pReqRepeal->AccountID,dwTime);
      printString("pReqRepeal","Password",pReqRepeal->Password,dwTime);
      printNumber("pReqRepeal","InstallID",pReqRepeal->InstallID,dwTime);
      printNumber("pReqRepeal","FutureSerial",pReqRepeal->FutureSerial,dwTime);
      printString("pReqRepeal","UserID",pReqRepeal->UserID,dwTime);
      printNumber("pReqRepeal","VerifyCertNoFlag",pReqRepeal->VerifyCertNoFlag,dwTime);
      printString("pReqRepeal","CurrencyID",pReqRepeal->CurrencyID,dwTime);
      printNumber("pReqRepeal","TradeAmount",pReqRepeal->TradeAmount,dwTime);
      printNumber("pReqRepeal","FutureFetchAmount",pReqRepeal->FutureFetchAmount,dwTime);
      printNumber("pReqRepeal","FeePayFlag",pReqRepeal->FeePayFlag,dwTime);
      printNumber("pReqRepeal","CustFee",pReqRepeal->CustFee,dwTime);
      printNumber("pReqRepeal","BrokerFee",pReqRepeal->BrokerFee,dwTime);
      printString("pReqRepeal","Message",pReqRepeal->Message,dwTime);
      printString("pReqRepeal","Digest",pReqRepeal->Digest,dwTime);
      printNumber("pReqRepeal","BankAccType",pReqRepeal->BankAccType,dwTime);
      printString("pReqRepeal","DeviceID",pReqRepeal->DeviceID,dwTime);
      printNumber("pReqRepeal","BankSecuAccType",pReqRepeal->BankSecuAccType,dwTime);
      printString("pReqRepeal","BrokerIDByBank",pReqRepeal->BrokerIDByBank,dwTime);
      printString("pReqRepeal","BankSecuAcc",pReqRepeal->BankSecuAcc,dwTime);
      printNumber("pReqRepeal","BankPwdFlag",pReqRepeal->BankPwdFlag,dwTime);
      printNumber("pReqRepeal","SecuPwdFlag",pReqRepeal->SecuPwdFlag,dwTime);
      printString("pReqRepeal","OperNo",pReqRepeal->OperNo,dwTime);
      printNumber("pReqRepeal","RequestID",pReqRepeal->RequestID,dwTime);
      printNumber("pReqRepeal","TID",pReqRepeal->TID,dwTime);
      printNumber("pReqRepeal","TransferStatus",pReqRepeal->TransferStatus,dwTime);
      printString("pReqRepeal","LongCustomerName",pReqRepeal->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnErrRtnRepealBankToFutureByFutureManual", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnErrRtnRepealBankToFutureByFutureManual(self, pReqRepeal, pRspInfo);

  };

  ///系统运行时期货端手工发起冲正期货转银行错误回报
  virtual void  OnErrRtnRepealFutureToBankByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnErrRtnRepealFutureToBankByFutureManual", "Enter", dwTime);

    if (NULL==pReqRepeal)
    {
      printString("pReqRepeal","CThostFtdcReqRepealField","NULL",dwTime);
      return;
    }
    else
    {
      printNumber("pReqRepeal","RepealTimeInterval",pReqRepeal->RepealTimeInterval,dwTime);
      printNumber("pReqRepeal","RepealedTimes",pReqRepeal->RepealedTimes,dwTime);
      printNumber("pReqRepeal","BankRepealFlag",pReqRepeal->BankRepealFlag,dwTime);
      printNumber("pReqRepeal","BrokerRepealFlag",pReqRepeal->BrokerRepealFlag,dwTime);
      printNumber("pReqRepeal","PlateRepealSerial",pReqRepeal->PlateRepealSerial,dwTime);
      printString("pReqRepeal","BankRepealSerial",pReqRepeal->BankRepealSerial,dwTime);
      printNumber("pReqRepeal","FutureRepealSerial",pReqRepeal->FutureRepealSerial,dwTime);
      printString("pReqRepeal","TradeCode",pReqRepeal->TradeCode,dwTime);
      printString("pReqRepeal","BankID",pReqRepeal->BankID,dwTime);
      printString("pReqRepeal","BankBranchID",pReqRepeal->BankBranchID,dwTime);
      printString("pReqRepeal","BrokerID",pReqRepeal->BrokerID,dwTime);
      printString("pReqRepeal","BrokerBranchID",pReqRepeal->BrokerBranchID,dwTime);
      printString("pReqRepeal","TradeDate",pReqRepeal->TradeDate,dwTime);
      printString("pReqRepeal","TradeTime",pReqRepeal->TradeTime,dwTime);
      printString("pReqRepeal","BankSerial",pReqRepeal->BankSerial,dwTime);
      printString("pReqRepeal","TradingDay",pReqRepeal->TradingDay,dwTime);
      printNumber("pReqRepeal","PlateSerial",pReqRepeal->PlateSerial,dwTime);
      printNumber("pReqRepeal","LastFragment",pReqRepeal->LastFragment,dwTime);
      printNumber("pReqRepeal","SessionID",pReqRepeal->SessionID,dwTime);
      printString("pReqRepeal","CustomerName",pReqRepeal->CustomerName,dwTime);
      printNumber("pReqRepeal","IdCardType",pReqRepeal->IdCardType,dwTime);
      printString("pReqRepeal","IdentifiedCardNo",pReqRepeal->IdentifiedCardNo,dwTime);
      printNumber("pReqRepeal","CustType",pReqRepeal->CustType,dwTime);
      printString("pReqRepeal","BankAccount",pReqRepeal->BankAccount,dwTime);
      printString("pReqRepeal","BankPassWord",pReqRepeal->BankPassWord,dwTime);
      printString("pReqRepeal","AccountID",pReqRepeal->AccountID,dwTime);
      printString("pReqRepeal","Password",pReqRepeal->Password,dwTime);
      printNumber("pReqRepeal","InstallID",pReqRepeal->InstallID,dwTime);
      printNumber("pReqRepeal","FutureSerial",pReqRepeal->FutureSerial,dwTime);
      printString("pReqRepeal","UserID",pReqRepeal->UserID,dwTime);
      printNumber("pReqRepeal","VerifyCertNoFlag",pReqRepeal->VerifyCertNoFlag,dwTime);
      printString("pReqRepeal","CurrencyID",pReqRepeal->CurrencyID,dwTime);
      printNumber("pReqRepeal","TradeAmount",pReqRepeal->TradeAmount,dwTime);
      printNumber("pReqRepeal","FutureFetchAmount",pReqRepeal->FutureFetchAmount,dwTime);
      printNumber("pReqRepeal","FeePayFlag",pReqRepeal->FeePayFlag,dwTime);
      printNumber("pReqRepeal","CustFee",pReqRepeal->CustFee,dwTime);
      printNumber("pReqRepeal","BrokerFee",pReqRepeal->BrokerFee,dwTime);
      printString("pReqRepeal","Message",pReqRepeal->Message,dwTime);
      printString("pReqRepeal","Digest",pReqRepeal->Digest,dwTime);
      printNumber("pReqRepeal","BankAccType",pReqRepeal->BankAccType,dwTime);
      printString("pReqRepeal","DeviceID",pReqRepeal->DeviceID,dwTime);
      printNumber("pReqRepeal","BankSecuAccType",pReqRepeal->BankSecuAccType,dwTime);
      printString("pReqRepeal","BrokerIDByBank",pReqRepeal->BrokerIDByBank,dwTime);
      printString("pReqRepeal","BankSecuAcc",pReqRepeal->BankSecuAcc,dwTime);
      printNumber("pReqRepeal","BankPwdFlag",pReqRepeal->BankPwdFlag,dwTime);
      printNumber("pReqRepeal","SecuPwdFlag",pReqRepeal->SecuPwdFlag,dwTime);
      printString("pReqRepeal","OperNo",pReqRepeal->OperNo,dwTime);
      printNumber("pReqRepeal","RequestID",pReqRepeal->RequestID,dwTime);
      printNumber("pReqRepeal","TID",pReqRepeal->TID,dwTime);
      printNumber("pReqRepeal","TransferStatus",pReqRepeal->TransferStatus,dwTime);
      printString("pReqRepeal","LongCustomerName",pReqRepeal->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnErrRtnRepealFutureToBankByFutureManual", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnErrRtnRepealFutureToBankByFutureManual(self, pReqRepeal, pRspInfo);

  };

  ///期货发起查询银行余额错误回报
  virtual void  OnErrRtnQueryBankBalanceByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnErrRtnQueryBankBalanceByFuture", "Enter", dwTime);

    if (NULL==pReqQueryAccount)
    {
      printString("pReqQueryAccount","CThostFtdcReqQueryAccountField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pReqQueryAccount","TradeCode",pReqQueryAccount->TradeCode,dwTime);
      printString("pReqQueryAccount","BankID",pReqQueryAccount->BankID,dwTime);
      printString("pReqQueryAccount","BankBranchID",pReqQueryAccount->BankBranchID,dwTime);
      printString("pReqQueryAccount","BrokerID",pReqQueryAccount->BrokerID,dwTime);
      printString("pReqQueryAccount","BrokerBranchID",pReqQueryAccount->BrokerBranchID,dwTime);
      printString("pReqQueryAccount","TradeDate",pReqQueryAccount->TradeDate,dwTime);
      printString("pReqQueryAccount","TradeTime",pReqQueryAccount->TradeTime,dwTime);
      printString("pReqQueryAccount","BankSerial",pReqQueryAccount->BankSerial,dwTime);
      printString("pReqQueryAccount","TradingDay",pReqQueryAccount->TradingDay,dwTime);
      printNumber("pReqQueryAccount","PlateSerial",pReqQueryAccount->PlateSerial,dwTime);
      printNumber("pReqQueryAccount","LastFragment",pReqQueryAccount->LastFragment,dwTime);
      printNumber("pReqQueryAccount","SessionID",pReqQueryAccount->SessionID,dwTime);
      printString("pReqQueryAccount","CustomerName",pReqQueryAccount->CustomerName,dwTime);
      printNumber("pReqQueryAccount","IdCardType",pReqQueryAccount->IdCardType,dwTime);
      printString("pReqQueryAccount","IdentifiedCardNo",pReqQueryAccount->IdentifiedCardNo,dwTime);
      printNumber("pReqQueryAccount","CustType",pReqQueryAccount->CustType,dwTime);
      printString("pReqQueryAccount","BankAccount",pReqQueryAccount->BankAccount,dwTime);
      printString("pReqQueryAccount","BankPassWord",pReqQueryAccount->BankPassWord,dwTime);
      printString("pReqQueryAccount","AccountID",pReqQueryAccount->AccountID,dwTime);
      printString("pReqQueryAccount","Password",pReqQueryAccount->Password,dwTime);
      printNumber("pReqQueryAccount","FutureSerial",pReqQueryAccount->FutureSerial,dwTime);
      printNumber("pReqQueryAccount","InstallID",pReqQueryAccount->InstallID,dwTime);
      printString("pReqQueryAccount","UserID",pReqQueryAccount->UserID,dwTime);
      printNumber("pReqQueryAccount","VerifyCertNoFlag",pReqQueryAccount->VerifyCertNoFlag,dwTime);
      printString("pReqQueryAccount","CurrencyID",pReqQueryAccount->CurrencyID,dwTime);
      printString("pReqQueryAccount","Digest",pReqQueryAccount->Digest,dwTime);
      printNumber("pReqQueryAccount","BankAccType",pReqQueryAccount->BankAccType,dwTime);
      printString("pReqQueryAccount","DeviceID",pReqQueryAccount->DeviceID,dwTime);
      printNumber("pReqQueryAccount","BankSecuAccType",pReqQueryAccount->BankSecuAccType,dwTime);
      printString("pReqQueryAccount","BrokerIDByBank",pReqQueryAccount->BrokerIDByBank,dwTime);
      printString("pReqQueryAccount","BankSecuAcc",pReqQueryAccount->BankSecuAcc,dwTime);
      printNumber("pReqQueryAccount","BankPwdFlag",pReqQueryAccount->BankPwdFlag,dwTime);
      printNumber("pReqQueryAccount","SecuPwdFlag",pReqQueryAccount->SecuPwdFlag,dwTime);
      printString("pReqQueryAccount","OperNo",pReqQueryAccount->OperNo,dwTime);
      printNumber("pReqQueryAccount","RequestID",pReqQueryAccount->RequestID,dwTime);
      printNumber("pReqQueryAccount","TID",pReqQueryAccount->TID,dwTime);
      printString("pReqQueryAccount","LongCustomerName",pReqQueryAccount->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnErrRtnQueryBankBalanceByFuture", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnErrRtnQueryBankBalanceByFuture(self, pReqQueryAccount, pRspInfo);

  };

  ///期货发起冲正银行转期货请求，银行处理完毕后报盘发回的通知
  virtual void  OnRtnRepealFromBankToFutureByFuture(CThostFtdcRspRepealField *pRspRepeal) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnRepealFromBankToFutureByFuture", "Enter", dwTime);

    if (NULL==pRspRepeal)
    {
      printString("pRspRepeal","CThostFtdcRspRepealField","NULL",dwTime);
      return;
    }
    else
    {
      printNumber("pRspRepeal","RepealTimeInterval",pRspRepeal->RepealTimeInterval,dwTime);
      printNumber("pRspRepeal","RepealedTimes",pRspRepeal->RepealedTimes,dwTime);
      printNumber("pRspRepeal","BankRepealFlag",pRspRepeal->BankRepealFlag,dwTime);
      printNumber("pRspRepeal","BrokerRepealFlag",pRspRepeal->BrokerRepealFlag,dwTime);
      printNumber("pRspRepeal","PlateRepealSerial",pRspRepeal->PlateRepealSerial,dwTime);
      printString("pRspRepeal","BankRepealSerial",pRspRepeal->BankRepealSerial,dwTime);
      printNumber("pRspRepeal","FutureRepealSerial",pRspRepeal->FutureRepealSerial,dwTime);
      printString("pRspRepeal","TradeCode",pRspRepeal->TradeCode,dwTime);
      printString("pRspRepeal","BankID",pRspRepeal->BankID,dwTime);
      printString("pRspRepeal","BankBranchID",pRspRepeal->BankBranchID,dwTime);
      printString("pRspRepeal","BrokerID",pRspRepeal->BrokerID,dwTime);
      printString("pRspRepeal","BrokerBranchID",pRspRepeal->BrokerBranchID,dwTime);
      printString("pRspRepeal","TradeDate",pRspRepeal->TradeDate,dwTime);
      printString("pRspRepeal","TradeTime",pRspRepeal->TradeTime,dwTime);
      printString("pRspRepeal","BankSerial",pRspRepeal->BankSerial,dwTime);
      printString("pRspRepeal","TradingDay",pRspRepeal->TradingDay,dwTime);
      printNumber("pRspRepeal","PlateSerial",pRspRepeal->PlateSerial,dwTime);
      printNumber("pRspRepeal","LastFragment",pRspRepeal->LastFragment,dwTime);
      printNumber("pRspRepeal","SessionID",pRspRepeal->SessionID,dwTime);
      printString("pRspRepeal","CustomerName",pRspRepeal->CustomerName,dwTime);
      printNumber("pRspRepeal","IdCardType",pRspRepeal->IdCardType,dwTime);
      printString("pRspRepeal","IdentifiedCardNo",pRspRepeal->IdentifiedCardNo,dwTime);
      printNumber("pRspRepeal","CustType",pRspRepeal->CustType,dwTime);
      printString("pRspRepeal","BankAccount",pRspRepeal->BankAccount,dwTime);
      printString("pRspRepeal","BankPassWord",pRspRepeal->BankPassWord,dwTime);
      printString("pRspRepeal","AccountID",pRspRepeal->AccountID,dwTime);
      printString("pRspRepeal","Password",pRspRepeal->Password,dwTime);
      printNumber("pRspRepeal","InstallID",pRspRepeal->InstallID,dwTime);
      printNumber("pRspRepeal","FutureSerial",pRspRepeal->FutureSerial,dwTime);
      printString("pRspRepeal","UserID",pRspRepeal->UserID,dwTime);
      printNumber("pRspRepeal","VerifyCertNoFlag",pRspRepeal->VerifyCertNoFlag,dwTime);
      printString("pRspRepeal","CurrencyID",pRspRepeal->CurrencyID,dwTime);
      printNumber("pRspRepeal","TradeAmount",pRspRepeal->TradeAmount,dwTime);
      printNumber("pRspRepeal","FutureFetchAmount",pRspRepeal->FutureFetchAmount,dwTime);
      printNumber("pRspRepeal","FeePayFlag",pRspRepeal->FeePayFlag,dwTime);
      printNumber("pRspRepeal","CustFee",pRspRepeal->CustFee,dwTime);
      printNumber("pRspRepeal","BrokerFee",pRspRepeal->BrokerFee,dwTime);
      printString("pRspRepeal","Message",pRspRepeal->Message,dwTime);
      printString("pRspRepeal","Digest",pRspRepeal->Digest,dwTime);
      printNumber("pRspRepeal","BankAccType",pRspRepeal->BankAccType,dwTime);
      printString("pRspRepeal","DeviceID",pRspRepeal->DeviceID,dwTime);
      printNumber("pRspRepeal","BankSecuAccType",pRspRepeal->BankSecuAccType,dwTime);
      printString("pRspRepeal","BrokerIDByBank",pRspRepeal->BrokerIDByBank,dwTime);
      printString("pRspRepeal","BankSecuAcc",pRspRepeal->BankSecuAcc,dwTime);
      printNumber("pRspRepeal","BankPwdFlag",pRspRepeal->BankPwdFlag,dwTime);
      printNumber("pRspRepeal","SecuPwdFlag",pRspRepeal->SecuPwdFlag,dwTime);
      printString("pRspRepeal","OperNo",pRspRepeal->OperNo,dwTime);
      printNumber("pRspRepeal","RequestID",pRspRepeal->RequestID,dwTime);
      printNumber("pRspRepeal","TID",pRspRepeal->TID,dwTime);
      printNumber("pRspRepeal","TransferStatus",pRspRepeal->TransferStatus,dwTime);
      printNumber("pRspRepeal","ErrorID",pRspRepeal->ErrorID,dwTime);
      printString("pRspRepeal","ErrorMsg",pRspRepeal->ErrorMsg,dwTime);
      printString("pRspRepeal","LongCustomerName",pRspRepeal->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnRepealFromBankToFutureByFuture", "Leave", dwTime);

    TraderSpi_OnRtnRepealFromBankToFutureByFuture(self, pRspRepeal);

  };

  ///期货发起冲正期货转银行请求，银行处理完毕后报盘发回的通知
  virtual void  OnRtnRepealFromFutureToBankByFuture(CThostFtdcRspRepealField *pRspRepeal) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnRepealFromFutureToBankByFuture", "Enter", dwTime);

    if (NULL==pRspRepeal)
    {
      printString("pRspRepeal","CThostFtdcRspRepealField","NULL",dwTime);
      return;
    }
    else
    {
      printNumber("pRspRepeal","RepealTimeInterval",pRspRepeal->RepealTimeInterval,dwTime);
      printNumber("pRspRepeal","RepealedTimes",pRspRepeal->RepealedTimes,dwTime);
      printNumber("pRspRepeal","BankRepealFlag",pRspRepeal->BankRepealFlag,dwTime);
      printNumber("pRspRepeal","BrokerRepealFlag",pRspRepeal->BrokerRepealFlag,dwTime);
      printNumber("pRspRepeal","PlateRepealSerial",pRspRepeal->PlateRepealSerial,dwTime);
      printString("pRspRepeal","BankRepealSerial",pRspRepeal->BankRepealSerial,dwTime);
      printNumber("pRspRepeal","FutureRepealSerial",pRspRepeal->FutureRepealSerial,dwTime);
      printString("pRspRepeal","TradeCode",pRspRepeal->TradeCode,dwTime);
      printString("pRspRepeal","BankID",pRspRepeal->BankID,dwTime);
      printString("pRspRepeal","BankBranchID",pRspRepeal->BankBranchID,dwTime);
      printString("pRspRepeal","BrokerID",pRspRepeal->BrokerID,dwTime);
      printString("pRspRepeal","BrokerBranchID",pRspRepeal->BrokerBranchID,dwTime);
      printString("pRspRepeal","TradeDate",pRspRepeal->TradeDate,dwTime);
      printString("pRspRepeal","TradeTime",pRspRepeal->TradeTime,dwTime);
      printString("pRspRepeal","BankSerial",pRspRepeal->BankSerial,dwTime);
      printString("pRspRepeal","TradingDay",pRspRepeal->TradingDay,dwTime);
      printNumber("pRspRepeal","PlateSerial",pRspRepeal->PlateSerial,dwTime);
      printNumber("pRspRepeal","LastFragment",pRspRepeal->LastFragment,dwTime);
      printNumber("pRspRepeal","SessionID",pRspRepeal->SessionID,dwTime);
      printString("pRspRepeal","CustomerName",pRspRepeal->CustomerName,dwTime);
      printNumber("pRspRepeal","IdCardType",pRspRepeal->IdCardType,dwTime);
      printString("pRspRepeal","IdentifiedCardNo",pRspRepeal->IdentifiedCardNo,dwTime);
      printNumber("pRspRepeal","CustType",pRspRepeal->CustType,dwTime);
      printString("pRspRepeal","BankAccount",pRspRepeal->BankAccount,dwTime);
      printString("pRspRepeal","BankPassWord",pRspRepeal->BankPassWord,dwTime);
      printString("pRspRepeal","AccountID",pRspRepeal->AccountID,dwTime);
      printString("pRspRepeal","Password",pRspRepeal->Password,dwTime);
      printNumber("pRspRepeal","InstallID",pRspRepeal->InstallID,dwTime);
      printNumber("pRspRepeal","FutureSerial",pRspRepeal->FutureSerial,dwTime);
      printString("pRspRepeal","UserID",pRspRepeal->UserID,dwTime);
      printNumber("pRspRepeal","VerifyCertNoFlag",pRspRepeal->VerifyCertNoFlag,dwTime);
      printString("pRspRepeal","CurrencyID",pRspRepeal->CurrencyID,dwTime);
      printNumber("pRspRepeal","TradeAmount",pRspRepeal->TradeAmount,dwTime);
      printNumber("pRspRepeal","FutureFetchAmount",pRspRepeal->FutureFetchAmount,dwTime);
      printNumber("pRspRepeal","FeePayFlag",pRspRepeal->FeePayFlag,dwTime);
      printNumber("pRspRepeal","CustFee",pRspRepeal->CustFee,dwTime);
      printNumber("pRspRepeal","BrokerFee",pRspRepeal->BrokerFee,dwTime);
      printString("pRspRepeal","Message",pRspRepeal->Message,dwTime);
      printString("pRspRepeal","Digest",pRspRepeal->Digest,dwTime);
      printNumber("pRspRepeal","BankAccType",pRspRepeal->BankAccType,dwTime);
      printString("pRspRepeal","DeviceID",pRspRepeal->DeviceID,dwTime);
      printNumber("pRspRepeal","BankSecuAccType",pRspRepeal->BankSecuAccType,dwTime);
      printString("pRspRepeal","BrokerIDByBank",pRspRepeal->BrokerIDByBank,dwTime);
      printString("pRspRepeal","BankSecuAcc",pRspRepeal->BankSecuAcc,dwTime);
      printNumber("pRspRepeal","BankPwdFlag",pRspRepeal->BankPwdFlag,dwTime);
      printNumber("pRspRepeal","SecuPwdFlag",pRspRepeal->SecuPwdFlag,dwTime);
      printString("pRspRepeal","OperNo",pRspRepeal->OperNo,dwTime);
      printNumber("pRspRepeal","RequestID",pRspRepeal->RequestID,dwTime);
      printNumber("pRspRepeal","TID",pRspRepeal->TID,dwTime);
      printNumber("pRspRepeal","TransferStatus",pRspRepeal->TransferStatus,dwTime);
      printNumber("pRspRepeal","ErrorID",pRspRepeal->ErrorID,dwTime);
      printString("pRspRepeal","ErrorMsg",pRspRepeal->ErrorMsg,dwTime);
      printString("pRspRepeal","LongCustomerName",pRspRepeal->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnRepealFromFutureToBankByFuture", "Leave", dwTime);

    TraderSpi_OnRtnRepealFromFutureToBankByFuture(self, pRspRepeal);

  };

  ///期货发起银行资金转期货应答
  virtual void  OnRspFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspFromBankToFutureByFuture", "Enter", dwTime);

    if (NULL==pReqTransfer)
    {
      printString("pReqTransfer","CThostFtdcReqTransferField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pReqTransfer","TradeCode",pReqTransfer->TradeCode,dwTime);
      printString("pReqTransfer","BankID",pReqTransfer->BankID,dwTime);
      printString("pReqTransfer","BankBranchID",pReqTransfer->BankBranchID,dwTime);
      printString("pReqTransfer","BrokerID",pReqTransfer->BrokerID,dwTime);
      printString("pReqTransfer","BrokerBranchID",pReqTransfer->BrokerBranchID,dwTime);
      printString("pReqTransfer","TradeDate",pReqTransfer->TradeDate,dwTime);
      printString("pReqTransfer","TradeTime",pReqTransfer->TradeTime,dwTime);
      printString("pReqTransfer","BankSerial",pReqTransfer->BankSerial,dwTime);
      printString("pReqTransfer","TradingDay",pReqTransfer->TradingDay,dwTime);
      printNumber("pReqTransfer","PlateSerial",pReqTransfer->PlateSerial,dwTime);
      printNumber("pReqTransfer","LastFragment",pReqTransfer->LastFragment,dwTime);
      printNumber("pReqTransfer","SessionID",pReqTransfer->SessionID,dwTime);
      printString("pReqTransfer","CustomerName",pReqTransfer->CustomerName,dwTime);
      printNumber("pReqTransfer","IdCardType",pReqTransfer->IdCardType,dwTime);
      printString("pReqTransfer","IdentifiedCardNo",pReqTransfer->IdentifiedCardNo,dwTime);
      printNumber("pReqTransfer","CustType",pReqTransfer->CustType,dwTime);
      printString("pReqTransfer","BankAccount",pReqTransfer->BankAccount,dwTime);
      printString("pReqTransfer","BankPassWord",pReqTransfer->BankPassWord,dwTime);
      printString("pReqTransfer","AccountID",pReqTransfer->AccountID,dwTime);
      printString("pReqTransfer","Password",pReqTransfer->Password,dwTime);
      printNumber("pReqTransfer","InstallID",pReqTransfer->InstallID,dwTime);
      printNumber("pReqTransfer","FutureSerial",pReqTransfer->FutureSerial,dwTime);
      printString("pReqTransfer","UserID",pReqTransfer->UserID,dwTime);
      printNumber("pReqTransfer","VerifyCertNoFlag",pReqTransfer->VerifyCertNoFlag,dwTime);
      printString("pReqTransfer","CurrencyID",pReqTransfer->CurrencyID,dwTime);
      printNumber("pReqTransfer","TradeAmount",pReqTransfer->TradeAmount,dwTime);
      printNumber("pReqTransfer","FutureFetchAmount",pReqTransfer->FutureFetchAmount,dwTime);
      printNumber("pReqTransfer","FeePayFlag",pReqTransfer->FeePayFlag,dwTime);
      printNumber("pReqTransfer","CustFee",pReqTransfer->CustFee,dwTime);
      printNumber("pReqTransfer","BrokerFee",pReqTransfer->BrokerFee,dwTime);
      printString("pReqTransfer","Message",pReqTransfer->Message,dwTime);
      printString("pReqTransfer","Digest",pReqTransfer->Digest,dwTime);
      printNumber("pReqTransfer","BankAccType",pReqTransfer->BankAccType,dwTime);
      printString("pReqTransfer","DeviceID",pReqTransfer->DeviceID,dwTime);
      printNumber("pReqTransfer","BankSecuAccType",pReqTransfer->BankSecuAccType,dwTime);
      printString("pReqTransfer","BrokerIDByBank",pReqTransfer->BrokerIDByBank,dwTime);
      printString("pReqTransfer","BankSecuAcc",pReqTransfer->BankSecuAcc,dwTime);
      printNumber("pReqTransfer","BankPwdFlag",pReqTransfer->BankPwdFlag,dwTime);
      printNumber("pReqTransfer","SecuPwdFlag",pReqTransfer->SecuPwdFlag,dwTime);
      printString("pReqTransfer","OperNo",pReqTransfer->OperNo,dwTime);
      printNumber("pReqTransfer","RequestID",pReqTransfer->RequestID,dwTime);
      printNumber("pReqTransfer","TID",pReqTransfer->TID,dwTime);
      printNumber("pReqTransfer","TransferStatus",pReqTransfer->TransferStatus,dwTime);
      printString("pReqTransfer","LongCustomerName",pReqTransfer->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspFromBankToFutureByFuture", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspFromBankToFutureByFuture(self, pReqTransfer, pRspInfo, nRequestID, bIsLast);

  };

  ///期货发起期货资金转银行应答
  virtual void  OnRspFromFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspFromFutureToBankByFuture", "Enter", dwTime);

    if (NULL==pReqTransfer)
    {
      printString("pReqTransfer","CThostFtdcReqTransferField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pReqTransfer","TradeCode",pReqTransfer->TradeCode,dwTime);
      printString("pReqTransfer","BankID",pReqTransfer->BankID,dwTime);
      printString("pReqTransfer","BankBranchID",pReqTransfer->BankBranchID,dwTime);
      printString("pReqTransfer","BrokerID",pReqTransfer->BrokerID,dwTime);
      printString("pReqTransfer","BrokerBranchID",pReqTransfer->BrokerBranchID,dwTime);
      printString("pReqTransfer","TradeDate",pReqTransfer->TradeDate,dwTime);
      printString("pReqTransfer","TradeTime",pReqTransfer->TradeTime,dwTime);
      printString("pReqTransfer","BankSerial",pReqTransfer->BankSerial,dwTime);
      printString("pReqTransfer","TradingDay",pReqTransfer->TradingDay,dwTime);
      printNumber("pReqTransfer","PlateSerial",pReqTransfer->PlateSerial,dwTime);
      printNumber("pReqTransfer","LastFragment",pReqTransfer->LastFragment,dwTime);
      printNumber("pReqTransfer","SessionID",pReqTransfer->SessionID,dwTime);
      printString("pReqTransfer","CustomerName",pReqTransfer->CustomerName,dwTime);
      printNumber("pReqTransfer","IdCardType",pReqTransfer->IdCardType,dwTime);
      printString("pReqTransfer","IdentifiedCardNo",pReqTransfer->IdentifiedCardNo,dwTime);
      printNumber("pReqTransfer","CustType",pReqTransfer->CustType,dwTime);
      printString("pReqTransfer","BankAccount",pReqTransfer->BankAccount,dwTime);
      printString("pReqTransfer","BankPassWord",pReqTransfer->BankPassWord,dwTime);
      printString("pReqTransfer","AccountID",pReqTransfer->AccountID,dwTime);
      printString("pReqTransfer","Password",pReqTransfer->Password,dwTime);
      printNumber("pReqTransfer","InstallID",pReqTransfer->InstallID,dwTime);
      printNumber("pReqTransfer","FutureSerial",pReqTransfer->FutureSerial,dwTime);
      printString("pReqTransfer","UserID",pReqTransfer->UserID,dwTime);
      printNumber("pReqTransfer","VerifyCertNoFlag",pReqTransfer->VerifyCertNoFlag,dwTime);
      printString("pReqTransfer","CurrencyID",pReqTransfer->CurrencyID,dwTime);
      printNumber("pReqTransfer","TradeAmount",pReqTransfer->TradeAmount,dwTime);
      printNumber("pReqTransfer","FutureFetchAmount",pReqTransfer->FutureFetchAmount,dwTime);
      printNumber("pReqTransfer","FeePayFlag",pReqTransfer->FeePayFlag,dwTime);
      printNumber("pReqTransfer","CustFee",pReqTransfer->CustFee,dwTime);
      printNumber("pReqTransfer","BrokerFee",pReqTransfer->BrokerFee,dwTime);
      printString("pReqTransfer","Message",pReqTransfer->Message,dwTime);
      printString("pReqTransfer","Digest",pReqTransfer->Digest,dwTime);
      printNumber("pReqTransfer","BankAccType",pReqTransfer->BankAccType,dwTime);
      printString("pReqTransfer","DeviceID",pReqTransfer->DeviceID,dwTime);
      printNumber("pReqTransfer","BankSecuAccType",pReqTransfer->BankSecuAccType,dwTime);
      printString("pReqTransfer","BrokerIDByBank",pReqTransfer->BrokerIDByBank,dwTime);
      printString("pReqTransfer","BankSecuAcc",pReqTransfer->BankSecuAcc,dwTime);
      printNumber("pReqTransfer","BankPwdFlag",pReqTransfer->BankPwdFlag,dwTime);
      printNumber("pReqTransfer","SecuPwdFlag",pReqTransfer->SecuPwdFlag,dwTime);
      printString("pReqTransfer","OperNo",pReqTransfer->OperNo,dwTime);
      printNumber("pReqTransfer","RequestID",pReqTransfer->RequestID,dwTime);
      printNumber("pReqTransfer","TID",pReqTransfer->TID,dwTime);
      printNumber("pReqTransfer","TransferStatus",pReqTransfer->TransferStatus,dwTime);
      printString("pReqTransfer","LongCustomerName",pReqTransfer->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspFromFutureToBankByFuture", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspFromFutureToBankByFuture(self, pReqTransfer, pRspInfo, nRequestID, bIsLast);

  };

  ///期货发起查询银行余额应答
  virtual void  OnRspQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRspQueryBankAccountMoneyByFuture", "Enter", dwTime);

    if (NULL==pReqQueryAccount)
    {
      printString("pReqQueryAccount","CThostFtdcReqQueryAccountField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pReqQueryAccount","TradeCode",pReqQueryAccount->TradeCode,dwTime);
      printString("pReqQueryAccount","BankID",pReqQueryAccount->BankID,dwTime);
      printString("pReqQueryAccount","BankBranchID",pReqQueryAccount->BankBranchID,dwTime);
      printString("pReqQueryAccount","BrokerID",pReqQueryAccount->BrokerID,dwTime);
      printString("pReqQueryAccount","BrokerBranchID",pReqQueryAccount->BrokerBranchID,dwTime);
      printString("pReqQueryAccount","TradeDate",pReqQueryAccount->TradeDate,dwTime);
      printString("pReqQueryAccount","TradeTime",pReqQueryAccount->TradeTime,dwTime);
      printString("pReqQueryAccount","BankSerial",pReqQueryAccount->BankSerial,dwTime);
      printString("pReqQueryAccount","TradingDay",pReqQueryAccount->TradingDay,dwTime);
      printNumber("pReqQueryAccount","PlateSerial",pReqQueryAccount->PlateSerial,dwTime);
      printNumber("pReqQueryAccount","LastFragment",pReqQueryAccount->LastFragment,dwTime);
      printNumber("pReqQueryAccount","SessionID",pReqQueryAccount->SessionID,dwTime);
      printString("pReqQueryAccount","CustomerName",pReqQueryAccount->CustomerName,dwTime);
      printNumber("pReqQueryAccount","IdCardType",pReqQueryAccount->IdCardType,dwTime);
      printString("pReqQueryAccount","IdentifiedCardNo",pReqQueryAccount->IdentifiedCardNo,dwTime);
      printNumber("pReqQueryAccount","CustType",pReqQueryAccount->CustType,dwTime);
      printString("pReqQueryAccount","BankAccount",pReqQueryAccount->BankAccount,dwTime);
      printString("pReqQueryAccount","BankPassWord",pReqQueryAccount->BankPassWord,dwTime);
      printString("pReqQueryAccount","AccountID",pReqQueryAccount->AccountID,dwTime);
      printString("pReqQueryAccount","Password",pReqQueryAccount->Password,dwTime);
      printNumber("pReqQueryAccount","FutureSerial",pReqQueryAccount->FutureSerial,dwTime);
      printNumber("pReqQueryAccount","InstallID",pReqQueryAccount->InstallID,dwTime);
      printString("pReqQueryAccount","UserID",pReqQueryAccount->UserID,dwTime);
      printNumber("pReqQueryAccount","VerifyCertNoFlag",pReqQueryAccount->VerifyCertNoFlag,dwTime);
      printString("pReqQueryAccount","CurrencyID",pReqQueryAccount->CurrencyID,dwTime);
      printString("pReqQueryAccount","Digest",pReqQueryAccount->Digest,dwTime);
      printNumber("pReqQueryAccount","BankAccType",pReqQueryAccount->BankAccType,dwTime);
      printString("pReqQueryAccount","DeviceID",pReqQueryAccount->DeviceID,dwTime);
      printNumber("pReqQueryAccount","BankSecuAccType",pReqQueryAccount->BankSecuAccType,dwTime);
      printString("pReqQueryAccount","BrokerIDByBank",pReqQueryAccount->BrokerIDByBank,dwTime);
      printString("pReqQueryAccount","BankSecuAcc",pReqQueryAccount->BankSecuAcc,dwTime);
      printNumber("pReqQueryAccount","BankPwdFlag",pReqQueryAccount->BankPwdFlag,dwTime);
      printNumber("pReqQueryAccount","SecuPwdFlag",pReqQueryAccount->SecuPwdFlag,dwTime);
      printString("pReqQueryAccount","OperNo",pReqQueryAccount->OperNo,dwTime);
      printNumber("pReqQueryAccount","RequestID",pReqQueryAccount->RequestID,dwTime);
      printNumber("pReqQueryAccount","TID",pReqQueryAccount->TID,dwTime);
      printString("pReqQueryAccount","LongCustomerName",pReqQueryAccount->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRspQueryBankAccountMoneyByFuture", "Leave", dwTime);

    if (NULL==pRspInfo)
        {
            printString("pRspInfo","CThostFtdcRspInfoField","NULL",dwTime);
        }
        else
        {
            printNumber("pRspInfo","ErrorID",pRspInfo->ErrorID,dwTime);
            printString("pRspInfo","ErrorMsg",pRspInfo->ErrorMsg,dwTime);
        }

    TraderSpi_OnRspQueryBankAccountMoneyByFuture(self, pReqQueryAccount, pRspInfo, nRequestID, bIsLast);

  };

  ///银行发起银期开户通知
  virtual void  OnRtnOpenAccountByBank(CThostFtdcOpenAccountField *pOpenAccount) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnOpenAccountByBank", "Enter", dwTime);

    if (NULL==pOpenAccount)
    {
      printString("pOpenAccount","CThostFtdcOpenAccountField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pOpenAccount","TradeCode",pOpenAccount->TradeCode,dwTime);
      printString("pOpenAccount","BankID",pOpenAccount->BankID,dwTime);
      printString("pOpenAccount","BankBranchID",pOpenAccount->BankBranchID,dwTime);
      printString("pOpenAccount","BrokerID",pOpenAccount->BrokerID,dwTime);
      printString("pOpenAccount","BrokerBranchID",pOpenAccount->BrokerBranchID,dwTime);
      printString("pOpenAccount","TradeDate",pOpenAccount->TradeDate,dwTime);
      printString("pOpenAccount","TradeTime",pOpenAccount->TradeTime,dwTime);
      printString("pOpenAccount","BankSerial",pOpenAccount->BankSerial,dwTime);
      printString("pOpenAccount","TradingDay",pOpenAccount->TradingDay,dwTime);
      printNumber("pOpenAccount","PlateSerial",pOpenAccount->PlateSerial,dwTime);
      printNumber("pOpenAccount","LastFragment",pOpenAccount->LastFragment,dwTime);
      printNumber("pOpenAccount","SessionID",pOpenAccount->SessionID,dwTime);
      printString("pOpenAccount","CustomerName",pOpenAccount->CustomerName,dwTime);
      printNumber("pOpenAccount","IdCardType",pOpenAccount->IdCardType,dwTime);
      printString("pOpenAccount","IdentifiedCardNo",pOpenAccount->IdentifiedCardNo,dwTime);
      printNumber("pOpenAccount","Gender",pOpenAccount->Gender,dwTime);
      printString("pOpenAccount","CountryCode",pOpenAccount->CountryCode,dwTime);
      printNumber("pOpenAccount","CustType",pOpenAccount->CustType,dwTime);
      printString("pOpenAccount","Address",pOpenAccount->Address,dwTime);
      printString("pOpenAccount","ZipCode",pOpenAccount->ZipCode,dwTime);
      printString("pOpenAccount","Telephone",pOpenAccount->Telephone,dwTime);
      printString("pOpenAccount","MobilePhone",pOpenAccount->MobilePhone,dwTime);
      printString("pOpenAccount","Fax",pOpenAccount->Fax,dwTime);
      printString("pOpenAccount","EMail",pOpenAccount->EMail,dwTime);
      printNumber("pOpenAccount","MoneyAccountStatus",pOpenAccount->MoneyAccountStatus,dwTime);
      printString("pOpenAccount","BankAccount",pOpenAccount->BankAccount,dwTime);
      printString("pOpenAccount","BankPassWord",pOpenAccount->BankPassWord,dwTime);
      printString("pOpenAccount","AccountID",pOpenAccount->AccountID,dwTime);
      printString("pOpenAccount","Password",pOpenAccount->Password,dwTime);
      printNumber("pOpenAccount","InstallID",pOpenAccount->InstallID,dwTime);
      printNumber("pOpenAccount","VerifyCertNoFlag",pOpenAccount->VerifyCertNoFlag,dwTime);
      printString("pOpenAccount","CurrencyID",pOpenAccount->CurrencyID,dwTime);
      printNumber("pOpenAccount","CashExchangeCode",pOpenAccount->CashExchangeCode,dwTime);
      printString("pOpenAccount","Digest",pOpenAccount->Digest,dwTime);
      printNumber("pOpenAccount","BankAccType",pOpenAccount->BankAccType,dwTime);
      printString("pOpenAccount","DeviceID",pOpenAccount->DeviceID,dwTime);
      printNumber("pOpenAccount","BankSecuAccType",pOpenAccount->BankSecuAccType,dwTime);
      printString("pOpenAccount","BrokerIDByBank",pOpenAccount->BrokerIDByBank,dwTime);
      printString("pOpenAccount","BankSecuAcc",pOpenAccount->BankSecuAcc,dwTime);
      printNumber("pOpenAccount","BankPwdFlag",pOpenAccount->BankPwdFlag,dwTime);
      printNumber("pOpenAccount","SecuPwdFlag",pOpenAccount->SecuPwdFlag,dwTime);
      printString("pOpenAccount","OperNo",pOpenAccount->OperNo,dwTime);
      printNumber("pOpenAccount","TID",pOpenAccount->TID,dwTime);
      printString("pOpenAccount","UserID",pOpenAccount->UserID,dwTime);
      printNumber("pOpenAccount","ErrorID",pOpenAccount->ErrorID,dwTime);
      printString("pOpenAccount","ErrorMsg",pOpenAccount->ErrorMsg,dwTime);
      printString("pOpenAccount","LongCustomerName",pOpenAccount->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnOpenAccountByBank", "Leave", dwTime);

    TraderSpi_OnRtnOpenAccountByBank(self, pOpenAccount);

  };

  ///银行发起银期销户通知
  virtual void  OnRtnCancelAccountByBank(CThostFtdcCancelAccountField *pCancelAccount) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnCancelAccountByBank", "Enter", dwTime);

    if (NULL==pCancelAccount)
    {
      printString("pCancelAccount","CThostFtdcCancelAccountField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pCancelAccount","TradeCode",pCancelAccount->TradeCode,dwTime);
      printString("pCancelAccount","BankID",pCancelAccount->BankID,dwTime);
      printString("pCancelAccount","BankBranchID",pCancelAccount->BankBranchID,dwTime);
      printString("pCancelAccount","BrokerID",pCancelAccount->BrokerID,dwTime);
      printString("pCancelAccount","BrokerBranchID",pCancelAccount->BrokerBranchID,dwTime);
      printString("pCancelAccount","TradeDate",pCancelAccount->TradeDate,dwTime);
      printString("pCancelAccount","TradeTime",pCancelAccount->TradeTime,dwTime);
      printString("pCancelAccount","BankSerial",pCancelAccount->BankSerial,dwTime);
      printString("pCancelAccount","TradingDay",pCancelAccount->TradingDay,dwTime);
      printNumber("pCancelAccount","PlateSerial",pCancelAccount->PlateSerial,dwTime);
      printNumber("pCancelAccount","LastFragment",pCancelAccount->LastFragment,dwTime);
      printNumber("pCancelAccount","SessionID",pCancelAccount->SessionID,dwTime);
      printString("pCancelAccount","CustomerName",pCancelAccount->CustomerName,dwTime);
      printNumber("pCancelAccount","IdCardType",pCancelAccount->IdCardType,dwTime);
      printString("pCancelAccount","IdentifiedCardNo",pCancelAccount->IdentifiedCardNo,dwTime);
      printNumber("pCancelAccount","Gender",pCancelAccount->Gender,dwTime);
      printString("pCancelAccount","CountryCode",pCancelAccount->CountryCode,dwTime);
      printNumber("pCancelAccount","CustType",pCancelAccount->CustType,dwTime);
      printString("pCancelAccount","Address",pCancelAccount->Address,dwTime);
      printString("pCancelAccount","ZipCode",pCancelAccount->ZipCode,dwTime);
      printString("pCancelAccount","Telephone",pCancelAccount->Telephone,dwTime);
      printString("pCancelAccount","MobilePhone",pCancelAccount->MobilePhone,dwTime);
      printString("pCancelAccount","Fax",pCancelAccount->Fax,dwTime);
      printString("pCancelAccount","EMail",pCancelAccount->EMail,dwTime);
      printNumber("pCancelAccount","MoneyAccountStatus",pCancelAccount->MoneyAccountStatus,dwTime);
      printString("pCancelAccount","BankAccount",pCancelAccount->BankAccount,dwTime);
      printString("pCancelAccount","BankPassWord",pCancelAccount->BankPassWord,dwTime);
      printString("pCancelAccount","AccountID",pCancelAccount->AccountID,dwTime);
      printString("pCancelAccount","Password",pCancelAccount->Password,dwTime);
      printNumber("pCancelAccount","InstallID",pCancelAccount->InstallID,dwTime);
      printNumber("pCancelAccount","VerifyCertNoFlag",pCancelAccount->VerifyCertNoFlag,dwTime);
      printString("pCancelAccount","CurrencyID",pCancelAccount->CurrencyID,dwTime);
      printNumber("pCancelAccount","CashExchangeCode",pCancelAccount->CashExchangeCode,dwTime);
      printString("pCancelAccount","Digest",pCancelAccount->Digest,dwTime);
      printNumber("pCancelAccount","BankAccType",pCancelAccount->BankAccType,dwTime);
      printString("pCancelAccount","DeviceID",pCancelAccount->DeviceID,dwTime);
      printNumber("pCancelAccount","BankSecuAccType",pCancelAccount->BankSecuAccType,dwTime);
      printString("pCancelAccount","BrokerIDByBank",pCancelAccount->BrokerIDByBank,dwTime);
      printString("pCancelAccount","BankSecuAcc",pCancelAccount->BankSecuAcc,dwTime);
      printNumber("pCancelAccount","BankPwdFlag",pCancelAccount->BankPwdFlag,dwTime);
      printNumber("pCancelAccount","SecuPwdFlag",pCancelAccount->SecuPwdFlag,dwTime);
      printString("pCancelAccount","OperNo",pCancelAccount->OperNo,dwTime);
      printNumber("pCancelAccount","TID",pCancelAccount->TID,dwTime);
      printString("pCancelAccount","UserID",pCancelAccount->UserID,dwTime);
      printNumber("pCancelAccount","ErrorID",pCancelAccount->ErrorID,dwTime);
      printString("pCancelAccount","ErrorMsg",pCancelAccount->ErrorMsg,dwTime);
      printString("pCancelAccount","LongCustomerName",pCancelAccount->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnCancelAccountByBank", "Leave", dwTime);

    TraderSpi_OnRtnCancelAccountByBank(self, pCancelAccount);

  };

  ///银行发起变更银行账号通知
  virtual void  OnRtnChangeAccountByBank(CThostFtdcChangeAccountField *pChangeAccount) {
    double dwTime = get_tick_count();
    PyGILLock gilLock;

    printString("CThostFtdcTraderSpi","OnRtnChangeAccountByBank", "Enter", dwTime);

    if (NULL==pChangeAccount)
    {
      printString("pChangeAccount","CThostFtdcChangeAccountField","NULL",dwTime);
      return;
    }
    else
    {
      printString("pChangeAccount","TradeCode",pChangeAccount->TradeCode,dwTime);
      printString("pChangeAccount","BankID",pChangeAccount->BankID,dwTime);
      printString("pChangeAccount","BankBranchID",pChangeAccount->BankBranchID,dwTime);
      printString("pChangeAccount","BrokerID",pChangeAccount->BrokerID,dwTime);
      printString("pChangeAccount","BrokerBranchID",pChangeAccount->BrokerBranchID,dwTime);
      printString("pChangeAccount","TradeDate",pChangeAccount->TradeDate,dwTime);
      printString("pChangeAccount","TradeTime",pChangeAccount->TradeTime,dwTime);
      printString("pChangeAccount","BankSerial",pChangeAccount->BankSerial,dwTime);
      printString("pChangeAccount","TradingDay",pChangeAccount->TradingDay,dwTime);
      printNumber("pChangeAccount","PlateSerial",pChangeAccount->PlateSerial,dwTime);
      printNumber("pChangeAccount","LastFragment",pChangeAccount->LastFragment,dwTime);
      printNumber("pChangeAccount","SessionID",pChangeAccount->SessionID,dwTime);
      printString("pChangeAccount","CustomerName",pChangeAccount->CustomerName,dwTime);
      printNumber("pChangeAccount","IdCardType",pChangeAccount->IdCardType,dwTime);
      printString("pChangeAccount","IdentifiedCardNo",pChangeAccount->IdentifiedCardNo,dwTime);
      printNumber("pChangeAccount","Gender",pChangeAccount->Gender,dwTime);
      printString("pChangeAccount","CountryCode",pChangeAccount->CountryCode,dwTime);
      printNumber("pChangeAccount","CustType",pChangeAccount->CustType,dwTime);
      printString("pChangeAccount","Address",pChangeAccount->Address,dwTime);
      printString("pChangeAccount","ZipCode",pChangeAccount->ZipCode,dwTime);
      printString("pChangeAccount","Telephone",pChangeAccount->Telephone,dwTime);
      printString("pChangeAccount","MobilePhone",pChangeAccount->MobilePhone,dwTime);
      printString("pChangeAccount","Fax",pChangeAccount->Fax,dwTime);
      printString("pChangeAccount","EMail",pChangeAccount->EMail,dwTime);
      printNumber("pChangeAccount","MoneyAccountStatus",pChangeAccount->MoneyAccountStatus,dwTime);
      printString("pChangeAccount","BankAccount",pChangeAccount->BankAccount,dwTime);
      printString("pChangeAccount","BankPassWord",pChangeAccount->BankPassWord,dwTime);
      printString("pChangeAccount","NewBankAccount",pChangeAccount->NewBankAccount,dwTime);
      printString("pChangeAccount","NewBankPassWord",pChangeAccount->NewBankPassWord,dwTime);
      printString("pChangeAccount","AccountID",pChangeAccount->AccountID,dwTime);
      printString("pChangeAccount","Password",pChangeAccount->Password,dwTime);
      printNumber("pChangeAccount","BankAccType",pChangeAccount->BankAccType,dwTime);
      printNumber("pChangeAccount","InstallID",pChangeAccount->InstallID,dwTime);
      printNumber("pChangeAccount","VerifyCertNoFlag",pChangeAccount->VerifyCertNoFlag,dwTime);
      printString("pChangeAccount","CurrencyID",pChangeAccount->CurrencyID,dwTime);
      printString("pChangeAccount","BrokerIDByBank",pChangeAccount->BrokerIDByBank,dwTime);
      printNumber("pChangeAccount","BankPwdFlag",pChangeAccount->BankPwdFlag,dwTime);
      printNumber("pChangeAccount","SecuPwdFlag",pChangeAccount->SecuPwdFlag,dwTime);
      printNumber("pChangeAccount","TID",pChangeAccount->TID,dwTime);
      printString("pChangeAccount","Digest",pChangeAccount->Digest,dwTime);
      printNumber("pChangeAccount","ErrorID",pChangeAccount->ErrorID,dwTime);
      printString("pChangeAccount","ErrorMsg",pChangeAccount->ErrorMsg,dwTime);
      printString("pChangeAccount","LongCustomerName",pChangeAccount->LongCustomerName,dwTime);

    }

    printString("CThostFtdcTraderSpi","OnRtnChangeAccountByBank", "Leave", dwTime);

    TraderSpi_OnRtnChangeAccountByBank(self, pChangeAccount);

  };
private:
    PyObject *self;
};

#endif /* CTraderSpi_H */
