/* Generated by Cython 0.26 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "F:\\python\\CTP\\ptp\\ctp\\v6.3.11\\windows64\\ThostFtdcTraderApi.h",
            "F:\\python\\CTP\\ptp\\ctp\\v6.3.11\\windows64\\ThostFtdcUserApiDataType.h",
            "F:\\python\\CTP\\ptp\\ctp\\v6.3.11\\windows64\\ThostFtdcUserApiStruct.h",
            "F:\\python\\CTP\\ptp\\ptp\\c2cython\\CTraderAPI.h"
        ],
        "extra_compile_args": [
            "/GR",
            "/EHsc"
        ],
        "include_dirs": [
            "F:\\python\\CTP\\ptp\\ctp\\v6.3.11\\windows64",
            "F:\\python\\CTP\\ptp\\ptp\\c2cython"
        ],
        "language": "c++",
        "libraries": [
            "thosttraderapi"
        ],
        "library_dirs": [
            "F:\\python\\CTP\\ptp\\ctp\\v6.3.11\\windows64"
        ],
        "name": "ptp.TraderApi",
        "sources": [
            "ptp/TraderApi.pyx"
        ]
    },
    "module_name": "ptp.TraderApi"
}
END: Cython Metadata */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_26"
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
    #define HAVE_LONG_LONG
  #endif
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
#elif defined(PYSTON_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
  #undef SHIFT
  #undef BASE
  #undef MASK
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL)
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
           typedef unsigned char     uint8_t;
           typedef unsigned int      uint32_t;
        #else
           typedef unsigned __int8   uint8_t;
           typedef unsigned __int32  uint32_t;
        #endif
    #endif
#else
   #include <stdint.h>
#endif
#ifndef CYTHON_FALLTHROUGH
  #ifdef __cplusplus
    #if __has_cpp_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH [[fallthrough]]
    #elif __has_cpp_attribute(clang::fallthrough)
      #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__))
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif

#ifndef __cplusplus
  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
#endif
#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #else
    #define CYTHON_INLINE inline
  #endif
#endif
template<typename T>
void __Pyx_call_destructor(T& x) {
    x.~T();
}
template<typename T>
class __Pyx_FakeReference {
  public:
    __Pyx_FakeReference() : ptr(NULL) { }
    __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
    T *operator->() { return ptr; }
    T *operator&() { return ptr; }
    operator T&() { return *ptr; }
    template<typename U> bool operator ==(U other) { return *ptr == other; }
    template<typename U> bool operator !=(U other) { return *ptr != other; }
  private:
    T *ptr;
};

#if defined(WIN32) || defined(MS_WINDOWS)
  #define _USE_MATH_DEFINES
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif


#define __PYX_ERR(f_index, lineno, Ln_error) \
{ \
  __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
}

#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#endif

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__ptp__TraderApi
#define __PYX_HAVE_API__ptp__TraderApi
#include <string.h>
#include <stdio.h>
#include "pythread.h"
#include <stdlib.h>
#include <memory>
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include "ThostFtdcUserApiDataType.h"
#include "ThostFtdcUserApiStruct.h"
#include "ThostFtdcTraderApi.h"
#include "CTraderAPI.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER) && defined (_M_X64)
    #define __Pyx_sst_abs(value) _abs64(value)
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }

static PyObject *__pyx_m;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_cython_runtime;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;


static const char *__pyx_f[] = {
  "ptp\\TraderApi.pyx",
  "stringsource",
  "type.pxd",
  "bool.pxd",
  "complex.pxd",
};

/*--- Type declarations ---*/
struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper;

/* "ptp/TraderApi.pyx":29
 * from .cython2c.cTraderApi cimport CTraderSpi, CTraderApi, CreateFtdcTraderApi
 * 
 * cdef class TraderApiWrapper:             # <<<<<<<<<<<<<<
 *   cdef CTraderApi *_api
 *   cdef CTraderSpi *_spi
 */
struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper {
  PyObject_HEAD
  CThostFtdcTraderApi *_api;
  CTraderSpi *_spi;
};


/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          if (acquire_gil) {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
              PyGILState_Release(__pyx_gilstate_save);\
          } else {\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

/* KeywordStringCheck.proto */
static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);

/* GetModuleGlobalName.proto */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
#endif
#endif

/* PyCFunctionFastCall.proto */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
#else
#define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
#endif

/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = PyThreadState_GET();
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#endif

/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil);

/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
#endif

/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
#endif

/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* SwapException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* NoFastGil.proto */
#define __Pyx_PyGILState_Ensure PyGILState_Ensure
#define __Pyx_PyGILState_Release PyGILState_Release
#define __Pyx_FastGIL_Remember()
#define __Pyx_FastGIL_Forget()
#define __Pyx_FastGilFuncInit()

/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

/* ParseKeywords.proto */
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
    const char* function_name);

/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

/* SetupReduce.proto */
static int __Pyx_setup_reduce(PyObject* type_obj);

/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

/* CythonFunction.proto */
#define __Pyx_CyFunction_USED 1
#include <structmember.h>
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f)\
    (((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
    PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj;
    void *defaults;
    int defaults_pyobjects;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *self,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(void);

/* GetNameInClass.proto */
static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name);

/* CLineInTraceback.proto */
static int __Pyx_CLineForTraceback(int c_line);

/* CodeObjectCache.proto */
typedef struct {
    PyCodeObject* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

/* CppExceptionConversion.proto */
#ifndef __Pyx_CppExn2PyErr
#include <new>
#include <typeinfo>
#include <stdexcept>
#include <ios>
static void __Pyx_CppExn2PyErr() {
  try {
    if (PyErr_Occurred())
      ; // let the latest Python exn pass through and ignore the current one
    else
      throw;
  } catch (const std::bad_alloc& exn) {
    PyErr_SetString(PyExc_MemoryError, exn.what());
  } catch (const std::bad_cast& exn) {
    PyErr_SetString(PyExc_TypeError, exn.what());
  } catch (const std::bad_typeid& exn) {
    PyErr_SetString(PyExc_TypeError, exn.what());
  } catch (const std::domain_error& exn) {
    PyErr_SetString(PyExc_ValueError, exn.what());
  } catch (const std::invalid_argument& exn) {
    PyErr_SetString(PyExc_ValueError, exn.what());
  } catch (const std::ios_base::failure& exn) {
    PyErr_SetString(PyExc_IOError, exn.what());
  } catch (const std::out_of_range& exn) {
    PyErr_SetString(PyExc_IndexError, exn.what());
  } catch (const std::overflow_error& exn) {
    PyErr_SetString(PyExc_OverflowError, exn.what());
  } catch (const std::range_error& exn) {
    PyErr_SetString(PyExc_ArithmeticError, exn.what());
  } catch (const std::underflow_error& exn) {
    PyErr_SetString(PyExc_ArithmeticError, exn.what());
  } catch (const std::exception& exn) {
    PyErr_SetString(PyExc_RuntimeError, exn.what());
  }
  catch (...)
  {
    PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
  }
}
#endif

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

/* CIntFromPy.proto */
static CYTHON_INLINE enum THOST_TE_RESUME_TYPE __Pyx_PyInt_As_enum__THOST_TE_RESUME_TYPE(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);

/* PyIdentifierFromString.proto */
#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#else
  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#endif
#endif

/* ModuleImport.proto */
static PyObject *__Pyx_ImportModule(const char *name);

/* TypeImport.proto */
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);

/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);


/* Module declarations from 'cpython.version' */

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.type' */
static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;

/* Module declarations from 'libc.string' */

/* Module declarations from 'libc.stdio' */

/* Module declarations from 'cpython.object' */

/* Module declarations from 'cpython.ref' */

/* Module declarations from 'cpython.exc' */

/* Module declarations from 'cpython.module' */

/* Module declarations from 'cpython.mem' */

/* Module declarations from 'cpython.tuple' */

/* Module declarations from 'cpython.list' */

/* Module declarations from 'cpython.sequence' */

/* Module declarations from 'cpython.mapping' */

/* Module declarations from 'cpython.iterator' */

/* Module declarations from 'cpython.number' */

/* Module declarations from 'cpython.int' */

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.bool' */
static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;

/* Module declarations from 'cpython.long' */

/* Module declarations from 'cpython.float' */

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.complex' */
static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;

/* Module declarations from 'cpython.string' */

/* Module declarations from 'cpython.unicode' */

/* Module declarations from 'cpython.dict' */

/* Module declarations from 'cpython.instance' */

/* Module declarations from 'cpython.function' */

/* Module declarations from 'cpython.method' */

/* Module declarations from 'cpython.weakref' */

/* Module declarations from 'cpython.getargs' */

/* Module declarations from 'cpython.pythread' */

/* Module declarations from 'cpython.pystate' */

/* Module declarations from 'cpython.cobject' */

/* Module declarations from 'cpython.oldbuffer' */

/* Module declarations from 'cpython.set' */

/* Module declarations from 'cpython.buffer' */

/* Module declarations from 'cpython.bytes' */

/* Module declarations from 'cpython.pycapsule' */

/* Module declarations from 'cpython' */

/* Module declarations from 'libc.stdlib' */

/* Module declarations from 'libcpp' */

/* Module declarations from 'libcpp.memory' */

/* Module declarations from 'ptp.cython2c.ThostFtdcUserApiDataType' */

/* Module declarations from 'ptp.cython2c.ThostFtdcUserApiStruct' */

/* Module declarations from 'ptp.cython2c.cTraderApi' */

/* Module declarations from 'ptp.TraderApi' */
static PyTypeObject *__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper = 0;
#define __Pyx_MODULE_NAME "ptp.TraderApi"
int __pyx_module_is_main_ptp__TraderApi = 0;

/* Implementation of 'ptp.TraderApi' */
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_TypeError;
static const char __pyx_k_ctp[] = "ctp";
static const char __pyx_k_err[] = "err";
static const char __pyx_k_imp[] = "imp";
static const char __pyx_k_ptp[] = "ptp";
static const char __pyx_k_s_s[] = "%s.%s";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_Join[] = "Join";
static const char __pyx_k__214[] = "*";
static const char __pyx_k_call[] = "call->";
static const char __pyx_k_info[] = "info";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_bInit[] = "bInit";
static const char __pyx_k_cinit[] = "__cinit__";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_error[] = "error";
static const char __pyx_k_myEnv[] = "myEnv";
static const char __pyx_k_sleep[] = "sleep";
static const char __pyx_k_Trader[] = "Trader";
static const char __pyx_k_call_2[] = "call-<";
static const char __pyx_k_ctypes[] = "ctypes";
static const char __pyx_k_dwTime[] = "dwTime";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_f_code[] = "f_code";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_logDes[] = "logDes";
static const char __pyx_k_logger[] = "logger";
static const char __pyx_k_myDEnv[] = "myDEnv";
static const char __pyx_k_regist[] = "regist ";
static const char __pyx_k_reload[] = "reload";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_server[] = "server";
static const char __pyx_k_Release[] = "Release";
static const char __pyx_k_address[] = "address";
static const char __pyx_k_co_name[] = "co_name";
static const char __pyx_k_express[] = "express";
static const char __pyx_k_funName[] = "funName";
static const char __pyx_k_Init_Net[] = "Init_Net";
static const char __pyx_k_datetime[] = "datetime";
static const char __pyx_k_exc_info[] = "exc_info";
static const char __pyx_k_getframe[] = "_getframe";
static const char __pyx_k_CythonLib[] = "CythonLib";
static const char __pyx_k_Init_Base[] = "Init_Base";
static const char __pyx_k_RequestID[] = "RequestID";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_addressof[] = "addressof";
static const char __pyx_k_pQryOrder[] = "pQryOrder";
static const char __pyx_k_pQryQuote[] = "pQryQuote";
static const char __pyx_k_pQryTrade[] = "pQryTrade";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_OnRspError[] = "OnRspError";
static const char __pyx_k_OnRtnOrder[] = "OnRtnOrder";
static const char __pyx_k_OnRtnQuote[] = "OnRtnQuote";
static const char __pyx_k_OnRtnTrade[] = "OnRtnTrade";
static const char __pyx_k_OrderField[] = "OrderField";
static const char __pyx_k_QuoteField[] = "QuoteField";
static const char __pyx_k_Tader_Init[] = "Tader.Init";
static const char __pyx_k_TradeField[] = "TradeField";
static const char __pyx_k_nRequestID[] = "nRequestID";
static const char __pyx_k_pQryNotice[] = "pQryNotice";
static const char __pyx_k_MemoryError[] = "MemoryError";
static const char __pyx_k_NoticeField[] = "NoticeField";
static const char __pyx_k_ReqQryOrder[] = "ReqQryOrder";
static const char __pyx_k_ReqQryQuote[] = "ReqQryQuote";
static const char __pyx_k_ReqQryTrade[] = "ReqQryTrade";
static const char __pyx_k_cfg_ptp_env[] = "cfg.ptp_env";
static const char __pyx_k_nResumeType[] = "nResumeType";
static const char __pyx_k_pInputOrder[] = "pInputOrder";
static const char __pyx_k_pInputQuote[] = "pInputQuote";
static const char __pyx_k_pQryProduct[] = "pQryProduct";
static const char __pyx_k_pUserLogout[] = "pUserLogout";
static const char __pyx_k_printNumber[] = "printNumber";
static const char __pyx_k_printString[] = "printString";
static const char __pyx_k_pszFlowPath[] = "pszFlowPath";
static const char __pyx_k_ProductField[] = "ProductField";
static const char __pyx_k_ReqQryNotice[] = "ReqQryNotice";
static const char __pyx_k_ReqUserLogin[] = "ReqUserLogin";
static const char __pyx_k_RspInfoField[] = "RspInfoField";
static const char __pyx_k_configparser[] = "configparser";
static const char __pyx_k_from_address[] = "from_address";
static const char __pyx_k_md_lastPrice[] = "md_lastPrice";
static const char __pyx_k_pParkedOrder[] = "pParkedOrder";
static const char __pyx_k_pQryExchange[] = "pQryExchange";
static const char __pyx_k_pQryForQuote[] = "pQryForQuote";
static const char __pyx_k_pQryInvestor[] = "pQryInvestor";
static const char __pyx_k_pReqTransfer[] = "pReqTransfer";
static const char __pyx_k_pszNsAddress[] = "pszNsAddress";
static const char __pyx_k_staticmethod[] = "staticmethod";
static const char __pyx_k_stringsource[] = "stringsource";
static const char __pyx_k_BulletinField[] = "BulletinField";
static const char __pyx_k_ExchangeField[] = "ExchangeField";
static const char __pyx_k_ForQuoteField[] = "ForQuoteField";
static const char __pyx_k_GetApiVersion[] = "GetApiVersion";
static const char __pyx_k_GetTradingDay[] = "GetTradingDay";
static const char __pyx_k_Inc_RequestID[] = "Inc_RequestID";
static const char __pyx_k_InvestorField[] = "InvestorField";
static const char __pyx_k_OnRspQryOrder[] = "OnRspQryOrder";
static const char __pyx_k_OnRspQryQuote[] = "OnRspQryQuote";
static const char __pyx_k_OnRspQryTrade[] = "OnRspQryTrade";
static const char __pyx_k_OnRtnBulletin[] = "OnRtnBulletin";
static const char __pyx_k_RegisterFront[] = "RegisterFront";
static const char __pyx_k_ReqQryProduct[] = "ReqQryProduct";
static const char __pyx_k_ReqUserLogin2[] = "ReqUserLogin2";
static const char __pyx_k_ReqUserLogout[] = "ReqUserLogout";
static const char __pyx_k_pFensUserInfo[] = "pFensUserInfo";
static const char __pyx_k_pQryExecOrder[] = "pQryExecOrder";
static const char __pyx_k_pReqUserLogin[] = "pReqUserLogin";
static const char __pyx_k_ptp_CythonLib[] = "ptp.CythonLib";
static const char __pyx_k_ptp_TraderApi[] = "ptp.TraderApi";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_trader_server[] = "trader_server";
static const char __pyx_k_ExecOrderField[] = "ExecOrderField";
static const char __pyx_k_OnRspQryNotice[] = "OnRspQryNotice";
static const char __pyx_k_OnRspUserLogin[] = "OnRspUserLogin";
static const char __pyx_k_OnRtnExecOrder[] = "OnRtnExecOrder";
static const char __pyx_k_ReqOrderAction[] = "ReqOrderAction";
static const char __pyx_k_ReqOrderInsert[] = "ReqOrderInsert";
static const char __pyx_k_ReqQryExchange[] = "ReqQryExchange";
static const char __pyx_k_ReqQryForQuote[] = "ReqQryForQuote";
static const char __pyx_k_ReqQryInvestor[] = "ReqQryInvestor";
static const char __pyx_k_ReqQuoteAction[] = "ReqQuoteAction";
static const char __pyx_k_ReqQuoteInsert[] = "ReqQuoteInsert";
static const char __pyx_k_ReqRepealField[] = "ReqRepealField";
static const char __pyx_k_RspRepealField[] = "RspRepealField";
static const char __pyx_k_pInputForQuote[] = "pInputForQuote";
static const char __pyx_k_pQryCombAction[] = "pQryCombAction";
static const char __pyx_k_pQryInstrument[] = "pQryInstrument";
static const char __pyx_k_pQryInvestUnit[] = "pQryInvestUnit";
static const char __pyx_k_CombActionField[] = "CombActionField";
static const char __pyx_k_InputOrderField[] = "InputOrderField";
static const char __pyx_k_InputQuoteField[] = "InputQuoteField";
static const char __pyx_k_InstrumentField[] = "InstrumentField";
static const char __pyx_k_InvestUnitField[] = "InvestUnitField";
static const char __pyx_k_OnRspQryProduct[] = "OnRspQryProduct";
static const char __pyx_k_OnRspUserLogout[] = "OnRspUserLogout";
static const char __pyx_k_OnRtnCombAction[] = "OnRtnCombAction";
static const char __pyx_k_ReqAuthenticate[] = "ReqAuthenticate";
static const char __pyx_k_ReqQryExecOrder[] = "ReqQryExecOrder";
static const char __pyx_k_UserLogoutField[] = "UserLogoutField";
static const char __pyx_k_pInputExecOrder[] = "pInputExecOrder";
static const char __pyx_k_pQryParkedOrder[] = "pQryParkedOrder";
static const char __pyx_k_pQryTradingCode[] = "pQryTradingCode";
static const char __pyx_k_pszFrontAddress[] = "pszFrontAddress";
static const char __pyx_k_py_ApiStructure[] = "py_ApiStructure";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_ForQuoteRspField[] = "ForQuoteRspField";
static const char __pyx_k_OnFrontConnected[] = "OnFrontConnected";
static const char __pyx_k_OnRspOrderAction[] = "OnRspOrderAction";
static const char __pyx_k_OnRspOrderInsert[] = "OnRspOrderInsert";
static const char __pyx_k_OnRspQryExchange[] = "OnRspQryExchange";
static const char __pyx_k_OnRspQryForQuote[] = "OnRspQryForQuote";
static const char __pyx_k_OnRspQryInvestor[] = "OnRspQryInvestor";
static const char __pyx_k_OnRspQuoteAction[] = "OnRspQuoteAction";
static const char __pyx_k_OnRspQuoteInsert[] = "OnRspQuoteInsert";
static const char __pyx_k_OnRtnForQuoteRsp[] = "OnRtnForQuoteRsp";
static const char __pyx_k_OpenAccountField[] = "OpenAccountField";
static const char __pyx_k_OrderActionField[] = "OrderActionField";
static const char __pyx_k_ParkedOrderField[] = "ParkedOrderField";
static const char __pyx_k_QuoteActionField[] = "QuoteActionField";
static const char __pyx_k_ReqQryCombAction[] = "ReqQryCombAction";
static const char __pyx_k_ReqQryInstrument[] = "ReqQryInstrument";
static const char __pyx_k_ReqQryInvestUnit[] = "ReqQryInvestUnit";
static const char __pyx_k_ReqTransferField[] = "ReqTransferField";
static const char __pyx_k_RspTransferField[] = "RspTransferField";
static const char __pyx_k_TraderApiWrapper[] = "TraderApiWrapper";
static const char __pyx_k_TradingCodeField[] = "TradingCodeField";
static const char __pyx_k_pInputCombAction[] = "pInputCombAction";
static const char __pyx_k_pQryContractBank[] = "pQryContractBank";
static const char __pyx_k_pQryExchangeRate[] = "pQryExchangeRate";
static const char __pyx_k_pQryProductGroup[] = "pQryProductGroup";
static const char __pyx_k_pQryTransferBank[] = "pQryTransferBank";
static const char __pyx_k_pReqQueryAccount[] = "pReqQueryAccount";
static const char __pyx_k_ContractBankField[] = "ContractBankField";
static const char __pyx_k_ExchangeRateField[] = "ExchangeRateField";
static const char __pyx_k_OnRspAuthenticate[] = "OnRspAuthenticate";
static const char __pyx_k_OnRspQryExecOrder[] = "OnRspQryExecOrder";
static const char __pyx_k_ProductGroupField[] = "ProductGroupField";
static const char __pyx_k_ReqForQuoteInsert[] = "ReqForQuoteInsert";
static const char __pyx_k_ReqQryParkedOrder[] = "ReqQryParkedOrder";
static const char __pyx_k_ReqQryTradingCode[] = "ReqQryTradingCode";
static const char __pyx_k_RspUserLoginField[] = "RspUserLoginField";
static const char __pyx_k_TransferBankField[] = "TransferBankField";
static const char __pyx_k_pInputOrderAction[] = "pInputOrderAction";
static const char __pyx_k_pInputQuoteAction[] = "pInputQuoteAction";
static const char __pyx_k_pQryTradingNotice[] = "pQryTradingNotice";
static const char __pyx_k_ptp_TraderApi_pyx[] = "ptp\\TraderApi.pyx";
static const char __pyx_k_CancelAccountField[] = "CancelAccountField";
static const char __pyx_k_ChangeAccountField[] = "ChangeAccountField";
static const char __pyx_k_InputForQuoteField[] = "InputForQuoteField";
static const char __pyx_k_OnHeartBeatWarning[] = "OnHeartBeatWarning";
static const char __pyx_k_OnRspQryCombAction[] = "OnRspQryCombAction";
static const char __pyx_k_OnRspQryInstrument[] = "OnRspQryInstrument";
static const char __pyx_k_OnRspQryInvestUnit[] = "OnRspQryInvestUnit";
static const char __pyx_k_OnRtnTradingNotice[] = "OnRtnTradingNotice";
static const char __pyx_k_RegisterNameServer[] = "RegisterNameServer";
static const char __pyx_k_ReqExecOrderAction[] = "ReqExecOrderAction";
static const char __pyx_k_ReqExecOrderInsert[] = "ReqExecOrderInsert";
static const char __pyx_k_ReqQryContractBank[] = "ReqQryContractBank";
static const char __pyx_k_ReqQryExchangeRate[] = "ReqQryExchangeRate";
static const char __pyx_k_ReqQryProductGroup[] = "ReqQryProductGroup";
static const char __pyx_k_ReqQryTransferBank[] = "ReqQryTransferBank";
static const char __pyx_k_TradingNoticeField[] = "TradingNoticeField";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_pParkedOrderAction[] = "pParkedOrderAction";
static const char __pyx_k_pQryEWarrantOffset[] = "pQryEWarrantOffset";
static const char __pyx_k_pQrySettlementInfo[] = "pQrySettlementInfo";
static const char __pyx_k_pQryTradingAccount[] = "pQryTradingAccount";
static const char __pyx_k_pQryTransferSerial[] = "pQryTransferSerial";
static const char __pyx_k_pRemoveParkedOrder[] = "pRemoveParkedOrder";
static const char __pyx_k_pReqUserLoginField[] = "pReqUserLoginField";
static const char __pyx_k_EWarrantOffsetField[] = "EWarrantOffsetField";
static const char __pyx_k_InputExecOrderField[] = "InputExecOrderField";
static const char __pyx_k_OnErrRtnOrderAction[] = "OnErrRtnOrderAction";
static const char __pyx_k_OnErrRtnOrderInsert[] = "OnErrRtnOrderInsert";
static const char __pyx_k_OnErrRtnQuoteAction[] = "OnErrRtnQuoteAction";
static const char __pyx_k_OnErrRtnQuoteInsert[] = "OnErrRtnQuoteInsert";
static const char __pyx_k_OnFrontDisconnected[] = "OnFrontDisconnected";
static const char __pyx_k_OnRspForQuoteInsert[] = "OnRspForQuoteInsert";
static const char __pyx_k_OnRspQryParkedOrder[] = "OnRspQryParkedOrder";
static const char __pyx_k_OnRspQryTradingCode[] = "OnRspQryTradingCode";
static const char __pyx_k_ReqBatchOrderAction[] = "ReqBatchOrderAction";
static const char __pyx_k_ReqCombActionInsert[] = "ReqCombActionInsert";
static const char __pyx_k_ReqQryTradingNotice[] = "ReqQryTradingNotice";
static const char __pyx_k_SettlementInfoField[] = "SettlementInfoField";
static const char __pyx_k_TraderApicall_stack[] = "TraderApicall_stack";
static const char __pyx_k_TradingAccountField[] = "TradingAccountField";
static const char __pyx_k_TransferSerialField[] = "TransferSerialField";
static const char __pyx_k_pQryAccountregister[] = "pQryAccountregister";
static const char __pyx_k_pQryDepthMarketData[] = "pQryDepthMarketData";
static const char __pyx_k_pQryOptionSelfClose[] = "pQryOptionSelfClose";
static const char __pyx_k_pQryProductExchRate[] = "pQryProductExchRate";
static const char __pyx_k_pQrySecAgentACIDMap[] = "pQrySecAgentACIDMap";
static const char __pyx_k_pUserPasswordUpdate[] = "pUserPasswordUpdate";
static const char __pyx_k_AccountregisterField[] = "AccountregisterField";
static const char __pyx_k_DepthMarketDataField[] = "DepthMarketDataField";
static const char __pyx_k_ExecOrderActionField[] = "ExecOrderActionField";
static const char __pyx_k_InputCombActionField[] = "InputCombActionField";
static const char __pyx_k_OnRspExecOrderAction[] = "OnRspExecOrderAction";
static const char __pyx_k_OnRspExecOrderInsert[] = "OnRspExecOrderInsert";
static const char __pyx_k_OnRspQryContractBank[] = "OnRspQryContractBank";
static const char __pyx_k_OnRspQryExchangeRate[] = "OnRspQryExchangeRate";
static const char __pyx_k_OnRspQryProductGroup[] = "OnRspQryProductGroup";
static const char __pyx_k_OnRspQryTransferBank[] = "OnRspQryTransferBank";
static const char __pyx_k_OnRtnOptionSelfClose[] = "OnRtnOptionSelfClose";
static const char __pyx_k_OptionSelfCloseField[] = "OptionSelfCloseField";
static const char __pyx_k_ProductExchRateField[] = "ProductExchRateField";
static const char __pyx_k_PublicSubscribeTopic[] = "PublicSubscribeTopic";
static const char __pyx_k_RegisterFensUserInfo[] = "RegisterFensUserInfo";
static const char __pyx_k_ReqParkedOrderAction[] = "ReqParkedOrderAction";
static const char __pyx_k_ReqParkedOrderInsert[] = "ReqParkedOrderInsert";
static const char __pyx_k_ReqQryEWarrantOffset[] = "ReqQryEWarrantOffset";
static const char __pyx_k_ReqQrySettlementInfo[] = "ReqQrySettlementInfo";
static const char __pyx_k_ReqQryTradingAccount[] = "ReqQryTradingAccount";
static const char __pyx_k_ReqQryTransferSerial[] = "ReqQryTransferSerial";
static const char __pyx_k_ReqQueryAccountField[] = "ReqQueryAccountField";
static const char __pyx_k_ReqRemoveParkedOrder[] = "ReqRemoveParkedOrder";
static const char __pyx_k_RspAuthenticateField[] = "RspAuthenticateField";
static const char __pyx_k_SecAgentACIDMapField[] = "SecAgentACIDMapField";
static const char __pyx_k_SubscribePublicTopic[] = "SubscribePublicTopic";
static const char __pyx_k_pQryInvestorPosition[] = "pQryInvestorPosition";
static const char __pyx_k_pQueryMaxOrderVolume[] = "pQueryMaxOrderVolume";
static const char __pyx_k_BatchOrderActionField[] = "BatchOrderActionField";
static const char __pyx_k_InputOrderActionField[] = "InputOrderActionField";
static const char __pyx_k_InputQuoteActionField[] = "InputQuoteActionField";
static const char __pyx_k_InstrumentStatusField[] = "InstrumentStatusField";
static const char __pyx_k_InvestorPositionField[] = "InvestorPositionField";
static const char __pyx_k_OnRspBatchOrderAction[] = "OnRspBatchOrderAction";
static const char __pyx_k_OnRspCombActionInsert[] = "OnRspCombActionInsert";
static const char __pyx_k_OnRspQryTradingNotice[] = "OnRspQryTradingNotice";
static const char __pyx_k_OnRtnInstrumentStatus[] = "OnRtnInstrumentStatus";
static const char __pyx_k_PrivateSubscribeTopic[] = "PrivateSubscribeTopic";
static const char __pyx_k_ReqQryAccountregister[] = "ReqQryAccountregister";
static const char __pyx_k_ReqQryDepthMarketData[] = "ReqQryDepthMarketData";
static const char __pyx_k_ReqQryOptionSelfClose[] = "ReqQryOptionSelfClose";
static const char __pyx_k_ReqQryProductExchRate[] = "ReqQryProductExchRate";
static const char __pyx_k_ReqQrySecAgentACIDMap[] = "ReqQrySecAgentACIDMap";
static const char __pyx_k_ReqUserPasswordUpdate[] = "ReqUserPasswordUpdate";
static const char __pyx_k_SubscribePrivateTopic[] = "SubscribePrivateTopic";
static const char __pyx_k_TraderApiWrapper_Join[] = "TraderApiWrapper.Join";
static const char __pyx_k_pInputExecOrderAction[] = "pInputExecOrderAction";
static const char __pyx_k_pInputOptionSelfClose[] = "pInputOptionSelfClose";
static const char __pyx_k_pQryParkedOrderAction[] = "pQryParkedOrderAction";
static const char __pyx_k_pQrySecAgentCheckMode[] = "pQrySecAgentCheckMode";
static const char __pyx_k_pReqAuthenticateField[] = "pReqAuthenticateField";
static const char __pyx_k_OnErrRtnForQuoteInsert[] = "OnErrRtnForQuoteInsert";
static const char __pyx_k_OnRspParkedOrderAction[] = "OnRspParkedOrderAction";
static const char __pyx_k_OnRspParkedOrderInsert[] = "OnRspParkedOrderInsert";
static const char __pyx_k_OnRspQryEWarrantOffset[] = "OnRspQryEWarrantOffset";
static const char __pyx_k_OnRspQrySettlementInfo[] = "OnRspQrySettlementInfo";
static const char __pyx_k_OnRspQryTradingAccount[] = "OnRspQryTradingAccount";
static const char __pyx_k_OnRspQryTransferSerial[] = "OnRspQryTransferSerial";
static const char __pyx_k_OnRspRemoveParkedOrder[] = "OnRspRemoveParkedOrder";
static const char __pyx_k_OnRtnOpenAccountByBank[] = "OnRtnOpenAccountByBank";
static const char __pyx_k_ParkedOrderActionField[] = "ParkedOrderActionField";
static const char __pyx_k_RemoveParkedOrderField[] = "RemoveParkedOrderField";
static const char __pyx_k_ReqQryInvestorPosition[] = "ReqQryInvestorPosition";
static const char __pyx_k_ReqQueryMaxOrderVolume[] = "ReqQueryMaxOrderVolume";
static const char __pyx_k_ReqUserPasswordUpdate2[] = "ReqUserPasswordUpdate2";
static const char __pyx_k_SecAgentCheckModeField[] = "SecAgentCheckModeField";
static const char __pyx_k_TradingNoticeInfoField[] = "TradingNoticeInfoField";
static const char __pyx_k_cfg_ptp_can_change_env[] = "cfg.ptp_can_change_env";
static const char __pyx_k_pInputBatchOrderAction[] = "pInputBatchOrderAction";
static const char __pyx_k_pQryBrokerTradingAlgos[] = "pQryBrokerTradingAlgos";
static const char __pyx_k_pQryExchangeMarginRate[] = "pQryExchangeMarginRate";
static const char __pyx_k_pSettlementInfoConfirm[] = "pSettlementInfoConfirm";
static const char __pyx_k_BrokerTradingAlgosField[] = "BrokerTradingAlgosField";
static const char __pyx_k_ExchangeMarginRateField[] = "ExchangeMarginRateField";
static const char __pyx_k_NotifyQueryAccountField[] = "NotifyQueryAccountField";
static const char __pyx_k_OnErrRtnExecOrderAction[] = "OnErrRtnExecOrderAction";
static const char __pyx_k_OnErrRtnExecOrderInsert[] = "OnErrRtnExecOrderInsert";
static const char __pyx_k_OnRspQryAccountregister[] = "OnRspQryAccountregister";
static const char __pyx_k_OnRspQryDepthMarketData[] = "OnRspQryDepthMarketData";
static const char __pyx_k_OnRspQryOptionSelfClose[] = "OnRspQryOptionSelfClose";
static const char __pyx_k_OnRspQryProductExchRate[] = "OnRspQryProductExchRate";
static const char __pyx_k_OnRspQrySecAgentACIDMap[] = "OnRspQrySecAgentACIDMap";
static const char __pyx_k_OnRspUserPasswordUpdate[] = "OnRspUserPasswordUpdate";
static const char __pyx_k_ReqQryParkedOrderAction[] = "ReqQryParkedOrderAction";
static const char __pyx_k_ReqQrySecAgentCheckMode[] = "ReqQrySecAgentCheckMode";
static const char __pyx_k_UserPasswordUpdateField[] = "UserPasswordUpdateField";
static const char __pyx_k_pQryBrokerTradingParams[] = "pQryBrokerTradingParams";
static const char __pyx_k_pQryCombInstrumentGuard[] = "pQryCombInstrumentGuard";
static const char __pyx_k_pQryOptionInstrCommRate[] = "pQryOptionInstrCommRate";
static const char __pyx_k_BrokerTradingParamsField[] = "BrokerTradingParamsField";
static const char __pyx_k_CombInstrumentGuardField[] = "CombInstrumentGuardField";
static const char __pyx_k_OnErrRtnBatchOrderAction[] = "OnErrRtnBatchOrderAction";
static const char __pyx_k_OnErrRtnCombActionInsert[] = "OnErrRtnCombActionInsert";
static const char __pyx_k_OnRspQryInvestorPosition[] = "OnRspQryInvestorPosition";
static const char __pyx_k_OnRspQueryMaxOrderVolume[] = "OnRspQueryMaxOrderVolume";
static const char __pyx_k_OnRtnCancelAccountByBank[] = "OnRtnCancelAccountByBank";
static const char __pyx_k_OnRtnChangeAccountByBank[] = "OnRtnChangeAccountByBank";
static const char __pyx_k_OptionInstrCommRateField[] = "OptionInstrCommRateField";
static const char __pyx_k_QueryMaxOrderVolumeField[] = "QueryMaxOrderVolumeField";
static const char __pyx_k_ReqOptionSelfCloseAction[] = "ReqOptionSelfCloseAction";
static const char __pyx_k_ReqOptionSelfCloseInsert[] = "ReqOptionSelfCloseInsert";
static const char __pyx_k_ReqQryBrokerTradingAlgos[] = "ReqQryBrokerTradingAlgos";
static const char __pyx_k_ReqQryExchangeMarginRate[] = "ReqQryExchangeMarginRate";
static const char __pyx_k_ReqSettlementInfoConfirm[] = "ReqSettlementInfoConfirm";
static const char __pyx_k_TraderApiWrapper_Release[] = "TraderApiWrapper.Release";
static const char __pyx_k_pQryInstrumentMarginRate[] = "pQryInstrumentMarginRate";
static const char __pyx_k_pQryOptionInstrTradeCost[] = "pQryOptionInstrTradeCost";
static const char __pyx_k_pRemoveParkedOrderAction[] = "pRemoveParkedOrderAction";
static const char __pyx_k_InputExecOrderActionField[] = "InputExecOrderActionField";
static const char __pyx_k_InputOptionSelfCloseField[] = "InputOptionSelfCloseField";
static const char __pyx_k_InstrumentMarginRateField[] = "InstrumentMarginRateField";
static const char __pyx_k_OnRspQryParkedOrderAction[] = "OnRspQryParkedOrderAction";
static const char __pyx_k_OnRspQrySecAgentCheckMode[] = "OnRspQrySecAgentCheckMode";
static const char __pyx_k_OptionInstrTradeCostField[] = "OptionInstrTradeCostField";
static const char __pyx_k_ReqQryBrokerTradingParams[] = "ReqQryBrokerTradingParams";
static const char __pyx_k_ReqQryCombInstrumentGuard[] = "ReqQryCombInstrumentGuard";
static const char __pyx_k_ReqQryOptionInstrCommRate[] = "ReqQryOptionInstrCommRate";
static const char __pyx_k_TraderApiWrapper_Init_Net[] = "TraderApiWrapper.Init_Net";
static const char __pyx_k_pQryMMOptionInstrCommRate[] = "pQryMMOptionInstrCommRate";
static const char __pyx_k_pQrySettlementInfoConfirm[] = "pQrySettlementInfoConfirm";
static const char __pyx_k_ErrorConditionalOrderField[] = "ErrorConditionalOrderField";
static const char __pyx_k_InputBatchOrderActionField[] = "InputBatchOrderActionField";
static const char __pyx_k_MMOptionInstrCommRateField[] = "MMOptionInstrCommRateField";
static const char __pyx_k_OnRspOptionSelfCloseAction[] = "OnRspOptionSelfCloseAction";
static const char __pyx_k_OnRspOptionSelfCloseInsert[] = "OnRspOptionSelfCloseInsert";
static const char __pyx_k_OnRspQryBrokerTradingAlgos[] = "OnRspQryBrokerTradingAlgos";
static const char __pyx_k_OnRspQryExchangeMarginRate[] = "OnRspQryExchangeMarginRate";
static const char __pyx_k_OnRspSettlementInfoConfirm[] = "OnRspSettlementInfoConfirm";
static const char __pyx_k_OnRtnErrorConditionalOrder[] = "OnRtnErrorConditionalOrder";
static const char __pyx_k_OptionSelfCloseActionField[] = "OptionSelfCloseActionField";
static const char __pyx_k_ReqQryInstrumentMarginRate[] = "ReqQryInstrumentMarginRate";
static const char __pyx_k_ReqQryOptionInstrTradeCost[] = "ReqQryOptionInstrTradeCost";
static const char __pyx_k_ReqRemoveParkedOrderAction[] = "ReqRemoveParkedOrderAction";
static const char __pyx_k_SettlementInfoConfirmField[] = "SettlementInfoConfirmField";
static const char __pyx_k_TraderApiWrapper_Init_Base[] = "TraderApiWrapper.Init_Base";
static const char __pyx_k_pQryCFMMCTradingAccountKey[] = "pQryCFMMCTradingAccountKey";
static const char __pyx_k_pQryInvestorPositionDetail[] = "pQryInvestorPositionDetail";
static const char __pyx_k_BaseEnv_has_not_been_inited[] = "BaseEnv has not been inited";
static const char __pyx_k_CFMMCTradingAccountKeyField[] = "CFMMCTradingAccountKeyField";
static const char __pyx_k_InvestorPositionDetailField[] = "InvestorPositionDetailField";
static const char __pyx_k_OnRspQryBrokerTradingParams[] = "OnRspQryBrokerTradingParams";
static const char __pyx_k_OnRspQryCombInstrumentGuard[] = "OnRspQryCombInstrumentGuard";
static const char __pyx_k_OnRspQryOptionInstrCommRate[] = "OnRspQryOptionInstrCommRate";
static const char __pyx_k_OnRtnFromBankToFutureByBank[] = "OnRtnFromBankToFutureByBank";
static const char __pyx_k_OnRtnFromFutureToBankByBank[] = "OnRtnFromFutureToBankByBank";
static const char __pyx_k_ReqFromBankToFutureByFuture[] = "ReqFromBankToFutureByFuture";
static const char __pyx_k_ReqFromFutureToBankByFuture[] = "ReqFromFutureToBankByFuture";
static const char __pyx_k_ReqQryMMOptionInstrCommRate[] = "ReqQryMMOptionInstrCommRate";
static const char __pyx_k_ReqQrySettlementInfoConfirm[] = "ReqQrySettlementInfoConfirm";
static const char __pyx_k_pInputOptionSelfCloseAction[] = "pInputOptionSelfCloseAction";
static const char __pyx_k_pQryInstrumentOrderCommRate[] = "pQryInstrumentOrderCommRate";
static const char __pyx_k_step_Infra_Init_4_of_4_step[] = "step(Infra_Init) 4(of 4 step)";
static const char __pyx_k_InstrumentOrderCommRateField[] = "InstrumentOrderCommRateField";
static const char __pyx_k_OnErrRtnBankToFutureByFuture[] = "OnErrRtnBankToFutureByFuture";
static const char __pyx_k_OnErrRtnFutureToBankByFuture[] = "OnErrRtnFutureToBankByFuture";
static const char __pyx_k_OnRspQryInstrumentMarginRate[] = "OnRspQryInstrumentMarginRate";
static const char __pyx_k_OnRspQryOptionInstrTradeCost[] = "OnRspQryOptionInstrTradeCost";
static const char __pyx_k_OnRspRemoveParkedOrderAction[] = "OnRspRemoveParkedOrderAction";
static const char __pyx_k_RemoveParkedOrderActionField[] = "RemoveParkedOrderActionField";
static const char __pyx_k_ReqQryCFMMCTradingAccountKey[] = "ReqQryCFMMCTradingAccountKey";
static const char __pyx_k_ReqQryInvestorPositionDetail[] = "ReqQryInvestorPositionDetail";
static const char __pyx_k_ReqQrySecAgentTradingAccount[] = "ReqQrySecAgentTradingAccount";
static const char __pyx_k_TraderApiWrapper_ReqQryOrder[] = "TraderApiWrapper.ReqQryOrder";
static const char __pyx_k_TraderApiWrapper_ReqQryQuote[] = "TraderApiWrapper.ReqQryQuote";
static const char __pyx_k_TraderApiWrapper_ReqQryTrade[] = "TraderApiWrapper.ReqQryTrade";
static const char __pyx_k_pQryExchangeMarginRateAdjust[] = "pQryExchangeMarginRateAdjust";
static const char __pyx_k_pQryInstrumentCommissionRate[] = "pQryInstrumentCommissionRate";
static const char __pyx_k_step_RegisterSpi_1_of_4_step[] = "step(RegisterSpi) 1(of 4 step)";
static const char __pyx_k_CFMMCTradingAccountTokenField[] = "CFMMCTradingAccountTokenField";
static const char __pyx_k_ExchangeMarginRateAdjustField[] = "ExchangeMarginRateAdjustField";
static const char __pyx_k_InstrumentCommissionRateField[] = "InstrumentCommissionRateField";
static const char __pyx_k_OnErrRtnOptionSelfCloseAction[] = "OnErrRtnOptionSelfCloseAction";
static const char __pyx_k_OnErrRtnOptionSelfCloseInsert[] = "OnErrRtnOptionSelfCloseInsert";
static const char __pyx_k_OnRspFromBankToFutureByFuture[] = "OnRspFromBankToFutureByFuture";
static const char __pyx_k_OnRspFromFutureToBankByFuture[] = "OnRspFromFutureToBankByFuture";
static const char __pyx_k_OnRspQryMMOptionInstrCommRate[] = "OnRspQryMMOptionInstrCommRate";
static const char __pyx_k_OnRspQrySettlementInfoConfirm[] = "OnRspQrySettlementInfoConfirm";
static const char __pyx_k_OnRtnCFMMCTradingAccountToken[] = "OnRtnCFMMCTradingAccountToken";
static const char __pyx_k_OnRtnFromBankToFutureByFuture[] = "OnRtnFromBankToFutureByFuture";
static const char __pyx_k_OnRtnFromFutureToBankByFuture[] = "OnRtnFromFutureToBankByFuture";
static const char __pyx_k_OnRtnQueryBankBalanceByFuture[] = "OnRtnQueryBankBalanceByFuture";
static const char __pyx_k_ReqQryInstrumentOrderCommRate[] = "ReqQryInstrumentOrderCommRate";
static const char __pyx_k_TraderApiWrapper_ReqQryNotice[] = "TraderApiWrapper.ReqQryNotice";
static const char __pyx_k_TraderApiWrapper_ReqUserLogin[] = "TraderApiWrapper.ReqUserLogin";
static const char __pyx_k_pTradingAccountPasswordUpdate[] = "pTradingAccountPasswordUpdate";
static const char __pyx_k_OnRspQryCFMMCTradingAccountKey[] = "OnRspQryCFMMCTradingAccountKey";
static const char __pyx_k_OnRspQryInvestorPositionDetail[] = "OnRspQryInvestorPositionDetail";
static const char __pyx_k_OnRspQrySecAgentTradingAccount[] = "OnRspQrySecAgentTradingAccount";
static const char __pyx_k_ReqQryExchangeMarginRateAdjust[] = "ReqQryExchangeMarginRateAdjust";
static const char __pyx_k_ReqQryInstrumentCommissionRate[] = "ReqQryInstrumentCommissionRate";
static const char __pyx_k_TraderApiWrapper_GetApiVersion[] = "TraderApiWrapper.GetApiVersion";
static const char __pyx_k_TraderApiWrapper_GetTradingDay[] = "TraderApiWrapper.GetTradingDay";
static const char __pyx_k_TraderApiWrapper_Inc_RequestID[] = "TraderApiWrapper.Inc_RequestID";
static const char __pyx_k_TraderApiWrapper_RegisterFront[] = "TraderApiWrapper.RegisterFront";
static const char __pyx_k_TraderApiWrapper_ReqQryProduct[] = "TraderApiWrapper.ReqQryProduct";
static const char __pyx_k_TraderApiWrapper_ReqUserLogin2[] = "TraderApiWrapper.ReqUserLogin2";
static const char __pyx_k_TraderApiWrapper_ReqUserLogout[] = "TraderApiWrapper.ReqUserLogout";
static const char __pyx_k_pQryInvestorProductGroupMargin[] = "pQryInvestorProductGroupMargin";
static const char __pyx_k_pQryMMInstrumentCommissionRate[] = "pQryMMInstrumentCommissionRate";
static const char __pyx_k_pQueryCFMMCTradingAccountToken[] = "pQueryCFMMCTradingAccountToken";
static const char __pyx_k_step_RegisterFront_3_of_4_step[] = "step(RegisterFront) 3(of 4 step)";
static const char __pyx_k_InputOptionSelfCloseActionField[] = "InputOptionSelfCloseActionField";
static const char __pyx_k_InvestorProductGroupMarginField[] = "InvestorProductGroupMarginField";
static const char __pyx_k_MMInstrumentCommissionRateField[] = "MMInstrumentCommissionRateField";
static const char __pyx_k_OnRspQryInstrumentOrderCommRate[] = "OnRspQryInstrumentOrderCommRate";
static const char __pyx_k_ReqTradingAccountPasswordUpdate[] = "ReqTradingAccountPasswordUpdate";
static const char __pyx_k_TraderApiWrapper_ReqOrderAction[] = "TraderApiWrapper.ReqOrderAction";
static const char __pyx_k_TraderApiWrapper_ReqOrderInsert[] = "TraderApiWrapper.ReqOrderInsert";
static const char __pyx_k_TraderApiWrapper_ReqQryExchange[] = "TraderApiWrapper.ReqQryExchange";
static const char __pyx_k_TraderApiWrapper_ReqQryForQuote[] = "TraderApiWrapper.ReqQryForQuote";
static const char __pyx_k_TraderApiWrapper_ReqQryInvestor[] = "TraderApiWrapper.ReqQryInvestor";
static const char __pyx_k_TraderApiWrapper_ReqQuoteAction[] = "TraderApiWrapper.ReqQuoteAction";
static const char __pyx_k_TraderApiWrapper_ReqQuoteInsert[] = "TraderApiWrapper.ReqQuoteInsert";
static const char __pyx_k_step_SubscribeTopic_2_of_4_step[] = "step(SubscribeTopic) 2(of 4 step)";
static const char __pyx_k_InvestorPositionCombineDetailFie[] = "InvestorPositionCombineDetailField";
static const char __pyx_k_OnErrRtnQueryBankBalanceByFuture[] = "OnErrRtnQueryBankBalanceByFuture";
static const char __pyx_k_OnErrRtnRepealBankToFutureByFutu[] = "OnErrRtnRepealBankToFutureByFutureManual";
static const char __pyx_k_OnErrRtnRepealFutureToBankByFutu[] = "OnErrRtnRepealFutureToBankByFutureManual";
static const char __pyx_k_OnRspQryExchangeMarginRateAdjust[] = "OnRspQryExchangeMarginRateAdjust";
static const char __pyx_k_OnRspQryInstrumentCommissionRate[] = "OnRspQryInstrumentCommissionRate";
static const char __pyx_k_OnRspQryInvestorPositionCombineD[] = "OnRspQryInvestorPositionCombineDetail";
static const char __pyx_k_OnRspQryInvestorProductGroupMarg[] = "OnRspQryInvestorProductGroupMargin";
static const char __pyx_k_OnRspQryMMInstrumentCommissionRa[] = "OnRspQryMMInstrumentCommissionRate";
static const char __pyx_k_OnRspQueryBankAccountMoneyByFutu[] = "OnRspQueryBankAccountMoneyByFuture";
static const char __pyx_k_OnRspQueryCFMMCTradingAccountTok[] = "OnRspQueryCFMMCTradingAccountToken";
static const char __pyx_k_OnRspTradingAccountPasswordUpdat[] = "OnRspTradingAccountPasswordUpdate";
static const char __pyx_k_OnRtnRepealFromBankToFutureByBan[] = "OnRtnRepealFromBankToFutureByBank";
static const char __pyx_k_OnRtnRepealFromBankToFutureByFut[] = "OnRtnRepealFromBankToFutureByFutureManual";
static const char __pyx_k_OnRtnRepealFromFutureToBankByBan[] = "OnRtnRepealFromFutureToBankByBank";
static const char __pyx_k_OnRtnRepealFromFutureToBankByFut[] = "OnRtnRepealFromFutureToBankByFutureManual";
static const char __pyx_k_QueryCFMMCTradingAccountTokenFie[] = "QueryCFMMCTradingAccountTokenField";
static const char __pyx_k_ReqQryInvestorPositionCombineDet[] = "ReqQryInvestorPositionCombineDetail";
static const char __pyx_k_ReqQryInvestorProductGroupMargin[] = "ReqQryInvestorProductGroupMargin";
static const char __pyx_k_ReqQryMMInstrumentCommissionRate[] = "ReqQryMMInstrumentCommissionRate";
static const char __pyx_k_ReqQueryBankAccountMoneyByFuture[] = "ReqQueryBankAccountMoneyByFuture";
static const char __pyx_k_ReqQueryCFMMCTradingAccountToken[] = "ReqQueryCFMMCTradingAccountToken";
static const char __pyx_k_TraderApiWrapper_RegisterFensUse[] = "TraderApiWrapper.RegisterFensUserInfo";
static const char __pyx_k_TraderApiWrapper_RegisterNameSer[] = "TraderApiWrapper.RegisterNameServer";
static const char __pyx_k_TraderApiWrapper_ReqAuthenticate[] = "TraderApiWrapper.ReqAuthenticate";
static const char __pyx_k_TraderApiWrapper_ReqBatchOrderAc[] = "TraderApiWrapper.ReqBatchOrderAction";
static const char __pyx_k_TraderApiWrapper_ReqCombActionIn[] = "TraderApiWrapper.ReqCombActionInsert";
static const char __pyx_k_TraderApiWrapper_ReqExecOrderAct[] = "TraderApiWrapper.ReqExecOrderAction";
static const char __pyx_k_TraderApiWrapper_ReqExecOrderIns[] = "TraderApiWrapper.ReqExecOrderInsert";
static const char __pyx_k_TraderApiWrapper_ReqForQuoteInse[] = "TraderApiWrapper.ReqForQuoteInsert";
static const char __pyx_k_TraderApiWrapper_ReqFromBankToFu[] = "TraderApiWrapper.ReqFromBankToFutureByFuture";
static const char __pyx_k_TraderApiWrapper_ReqFromFutureTo[] = "TraderApiWrapper.ReqFromFutureToBankByFuture";
static const char __pyx_k_TraderApiWrapper_ReqOptionSelfCl[] = "TraderApiWrapper.ReqOptionSelfCloseInsert";
static const char __pyx_k_TraderApiWrapper_ReqParkedOrderA[] = "TraderApiWrapper.ReqParkedOrderAction";
static const char __pyx_k_TraderApiWrapper_ReqParkedOrderI[] = "TraderApiWrapper.ReqParkedOrderInsert";
static const char __pyx_k_TraderApiWrapper_ReqQryAccountre[] = "TraderApiWrapper.ReqQryAccountregister";
static const char __pyx_k_TraderApiWrapper_ReqQryBrokerTra[] = "TraderApiWrapper.ReqQryBrokerTradingParams";
static const char __pyx_k_TraderApiWrapper_ReqQryCFMMCTrad[] = "TraderApiWrapper.ReqQryCFMMCTradingAccountKey";
static const char __pyx_k_TraderApiWrapper_ReqQryCombActio[] = "TraderApiWrapper.ReqQryCombAction";
static const char __pyx_k_TraderApiWrapper_ReqQryCombInstr[] = "TraderApiWrapper.ReqQryCombInstrumentGuard";
static const char __pyx_k_TraderApiWrapper_ReqQryContractB[] = "TraderApiWrapper.ReqQryContractBank";
static const char __pyx_k_TraderApiWrapper_ReqQryDepthMark[] = "TraderApiWrapper.ReqQryDepthMarketData";
static const char __pyx_k_TraderApiWrapper_ReqQryEWarrantO[] = "TraderApiWrapper.ReqQryEWarrantOffset";
static const char __pyx_k_TraderApiWrapper_ReqQryExchangeM[] = "TraderApiWrapper.ReqQryExchangeMarginRate";
static const char __pyx_k_TraderApiWrapper_ReqQryExchangeR[] = "TraderApiWrapper.ReqQryExchangeRate";
static const char __pyx_k_TraderApiWrapper_ReqQryExecOrder[] = "TraderApiWrapper.ReqQryExecOrder";
static const char __pyx_k_TraderApiWrapper_ReqQryInstrumen[] = "TraderApiWrapper.ReqQryInstrumentMarginRate";
static const char __pyx_k_TraderApiWrapper_ReqQryInvestUni[] = "TraderApiWrapper.ReqQryInvestUnit";
static const char __pyx_k_TraderApiWrapper_ReqQryInvestorP[] = "TraderApiWrapper.ReqQryInvestorPosition";
static const char __pyx_k_TraderApiWrapper_ReqQryMMInstrum[] = "TraderApiWrapper.ReqQryMMInstrumentCommissionRate";
static const char __pyx_k_TraderApiWrapper_ReqQryMMOptionI[] = "TraderApiWrapper.ReqQryMMOptionInstrCommRate";
static const char __pyx_k_TraderApiWrapper_ReqQryOptionIns[] = "TraderApiWrapper.ReqQryOptionInstrTradeCost";
static const char __pyx_k_TraderApiWrapper_ReqQryOptionSel[] = "TraderApiWrapper.ReqQryOptionSelfClose";
static const char __pyx_k_TraderApiWrapper_ReqQryParkedOrd[] = "TraderApiWrapper.ReqQryParkedOrder";
static const char __pyx_k_TraderApiWrapper_ReqQryProductEx[] = "TraderApiWrapper.ReqQryProductExchRate";
static const char __pyx_k_TraderApiWrapper_ReqQryProductGr[] = "TraderApiWrapper.ReqQryProductGroup";
static const char __pyx_k_TraderApiWrapper_ReqQrySecAgentA[] = "TraderApiWrapper.ReqQrySecAgentACIDMap";
static const char __pyx_k_TraderApiWrapper_ReqQrySecAgentC[] = "TraderApiWrapper.ReqQrySecAgentCheckMode";
static const char __pyx_k_TraderApiWrapper_ReqQrySecAgentT[] = "TraderApiWrapper.ReqQrySecAgentTradingAccount";
static const char __pyx_k_TraderApiWrapper_ReqQrySettlemen[] = "TraderApiWrapper.ReqQrySettlementInfo";
static const char __pyx_k_TraderApiWrapper_ReqQryTradingAc[] = "TraderApiWrapper.ReqQryTradingAccount";
static const char __pyx_k_TraderApiWrapper_ReqQryTradingCo[] = "TraderApiWrapper.ReqQryTradingCode";
static const char __pyx_k_TraderApiWrapper_ReqQryTradingNo[] = "TraderApiWrapper.ReqQryTradingNotice";
static const char __pyx_k_TraderApiWrapper_ReqQryTransferB[] = "TraderApiWrapper.ReqQryTransferBank";
static const char __pyx_k_TraderApiWrapper_ReqQryTransferS[] = "TraderApiWrapper.ReqQryTransferSerial";
static const char __pyx_k_TraderApiWrapper_ReqQueryBankAcc[] = "TraderApiWrapper.ReqQueryBankAccountMoneyByFuture";
static const char __pyx_k_TraderApiWrapper_ReqQueryCFMMCTr[] = "TraderApiWrapper.ReqQueryCFMMCTradingAccountToken";
static const char __pyx_k_TraderApiWrapper_ReqQueryMaxOrde[] = "TraderApiWrapper.ReqQueryMaxOrderVolume";
static const char __pyx_k_TraderApiWrapper_ReqRemoveParked[] = "TraderApiWrapper.ReqRemoveParkedOrder";
static const char __pyx_k_TraderApiWrapper_ReqSettlementIn[] = "TraderApiWrapper.ReqSettlementInfoConfirm";
static const char __pyx_k_TraderApiWrapper_ReqTradingAccou[] = "TraderApiWrapper.ReqTradingAccountPasswordUpdate";
static const char __pyx_k_TraderApiWrapper_ReqUserPassword[] = "TraderApiWrapper.ReqUserPasswordUpdate";
static const char __pyx_k_TraderApiWrapper_SubscribePrivat[] = "TraderApiWrapper.SubscribePrivateTopic";
static const char __pyx_k_TraderApiWrapper_SubscribePublic[] = "TraderApiWrapper.SubscribePublicTopic";
static const char __pyx_k_TraderApiWrapper___reduce_cython[] = "TraderApiWrapper.__reduce_cython__";
static const char __pyx_k_TraderApiWrapper___setstate_cyth[] = "TraderApiWrapper.__setstate_cython__";
static const char __pyx_k_TradingAccountPasswordUpdateFiel[] = "TradingAccountPasswordUpdateField";
static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
static const char __pyx_k_pQryInvestorPositionCombineDetai[] = "pQryInvestorPositionCombineDetail";
static const char __pyx_k_OnRtnRepealFromBankToFutureByFut_2[] = "OnRtnRepealFromBankToFutureByFuture";
static const char __pyx_k_OnRtnRepealFromFutureToBankByFut_2[] = "OnRtnRepealFromFutureToBankByFuture";
static const char __pyx_k_TraderApiWrapper_ReqOptionSelfCl_2[] = "TraderApiWrapper.ReqOptionSelfCloseAction";
static const char __pyx_k_TraderApiWrapper_ReqQryBrokerTra_2[] = "TraderApiWrapper.ReqQryBrokerTradingAlgos";
static const char __pyx_k_TraderApiWrapper_ReqQryExchangeM_2[] = "TraderApiWrapper.ReqQryExchangeMarginRateAdjust";
static const char __pyx_k_TraderApiWrapper_ReqQryInstrumen_2[] = "TraderApiWrapper.ReqQryInstrumentCommissionRate";
static const char __pyx_k_TraderApiWrapper_ReqQryInstrumen_3[] = "TraderApiWrapper.ReqQryInstrument";
static const char __pyx_k_TraderApiWrapper_ReqQryInstrumen_4[] = "TraderApiWrapper.ReqQryInstrumentOrderCommRate";
static const char __pyx_k_TraderApiWrapper_ReqQryInvestorP_2[] = "TraderApiWrapper.ReqQryInvestorPositionDetail";
static const char __pyx_k_TraderApiWrapper_ReqQryInvestorP_3[] = "TraderApiWrapper.ReqQryInvestorPositionCombineDetail";
static const char __pyx_k_TraderApiWrapper_ReqQryInvestorP_4[] = "TraderApiWrapper.ReqQryInvestorProductGroupMargin";
static const char __pyx_k_TraderApiWrapper_ReqQryOptionIns_2[] = "TraderApiWrapper.ReqQryOptionInstrCommRate";
static const char __pyx_k_TraderApiWrapper_ReqQryParkedOrd_2[] = "TraderApiWrapper.ReqQryParkedOrderAction";
static const char __pyx_k_TraderApiWrapper_ReqQrySettlemen_2[] = "TraderApiWrapper.ReqQrySettlementInfoConfirm";
static const char __pyx_k_TraderApiWrapper_ReqRemoveParked_2[] = "TraderApiWrapper.ReqRemoveParkedOrderAction";
static const char __pyx_k_TraderApiWrapper_ReqUserPassword_2[] = "TraderApiWrapper.ReqUserPasswordUpdate2";
static PyObject *__pyx_n_s_AccountregisterField;
static PyObject *__pyx_kp_u_BaseEnv_has_not_been_inited;
static PyObject *__pyx_n_s_BatchOrderActionField;
static PyObject *__pyx_n_s_BrokerTradingAlgosField;
static PyObject *__pyx_n_s_BrokerTradingParamsField;
static PyObject *__pyx_n_s_BulletinField;
static PyObject *__pyx_n_s_CFMMCTradingAccountKeyField;
static PyObject *__pyx_n_s_CFMMCTradingAccountTokenField;
static PyObject *__pyx_n_s_CancelAccountField;
static PyObject *__pyx_n_s_ChangeAccountField;
static PyObject *__pyx_n_s_CombActionField;
static PyObject *__pyx_n_s_CombInstrumentGuardField;
static PyObject *__pyx_n_s_ContractBankField;
static PyObject *__pyx_n_s_CythonLib;
static PyObject *__pyx_n_s_DepthMarketDataField;
static PyObject *__pyx_n_s_EWarrantOffsetField;
static PyObject *__pyx_n_s_ErrorConditionalOrderField;
static PyObject *__pyx_n_s_ExchangeField;
static PyObject *__pyx_n_s_ExchangeMarginRateAdjustField;
static PyObject *__pyx_n_s_ExchangeMarginRateField;
static PyObject *__pyx_n_s_ExchangeRateField;
static PyObject *__pyx_n_s_ExecOrderActionField;
static PyObject *__pyx_n_s_ExecOrderField;
static PyObject *__pyx_n_s_ForQuoteField;
static PyObject *__pyx_n_s_ForQuoteRspField;
static PyObject *__pyx_n_s_GetApiVersion;
static PyObject *__pyx_n_u_GetApiVersion;
static PyObject *__pyx_n_s_GetTradingDay;
static PyObject *__pyx_n_u_GetTradingDay;
static PyObject *__pyx_n_s_Inc_RequestID;
static PyObject *__pyx_n_s_Init_Base;
static PyObject *__pyx_n_u_Init_Base;
static PyObject *__pyx_n_s_Init_Net;
static PyObject *__pyx_n_s_InputBatchOrderActionField;
static PyObject *__pyx_n_s_InputCombActionField;
static PyObject *__pyx_n_s_InputExecOrderActionField;
static PyObject *__pyx_n_s_InputExecOrderField;
static PyObject *__pyx_n_s_InputForQuoteField;
static PyObject *__pyx_n_s_InputOptionSelfCloseActionField;
static PyObject *__pyx_n_s_InputOptionSelfCloseField;
static PyObject *__pyx_n_s_InputOrderActionField;
static PyObject *__pyx_n_s_InputOrderField;
static PyObject *__pyx_n_s_InputQuoteActionField;
static PyObject *__pyx_n_s_InputQuoteField;
static PyObject *__pyx_n_s_InstrumentCommissionRateField;
static PyObject *__pyx_n_s_InstrumentField;
static PyObject *__pyx_n_s_InstrumentMarginRateField;
static PyObject *__pyx_n_s_InstrumentOrderCommRateField;
static PyObject *__pyx_n_s_InstrumentStatusField;
static PyObject *__pyx_n_s_InvestUnitField;
static PyObject *__pyx_n_s_InvestorField;
static PyObject *__pyx_n_s_InvestorPositionCombineDetailFie;
static PyObject *__pyx_n_s_InvestorPositionDetailField;
static PyObject *__pyx_n_s_InvestorPositionField;
static PyObject *__pyx_n_s_InvestorProductGroupMarginField;
static PyObject *__pyx_n_s_Join;
static PyObject *__pyx_n_u_Join;
static PyObject *__pyx_n_s_MMInstrumentCommissionRateField;
static PyObject *__pyx_n_s_MMOptionInstrCommRateField;
static PyObject *__pyx_n_s_MemoryError;
static PyObject *__pyx_n_s_NoticeField;
static PyObject *__pyx_n_s_NotifyQueryAccountField;
static PyObject *__pyx_n_s_OnErrRtnBankToFutureByFuture;
static PyObject *__pyx_n_u_OnErrRtnBankToFutureByFuture;
static PyObject *__pyx_n_s_OnErrRtnBatchOrderAction;
static PyObject *__pyx_n_u_OnErrRtnBatchOrderAction;
static PyObject *__pyx_n_s_OnErrRtnCombActionInsert;
static PyObject *__pyx_n_u_OnErrRtnCombActionInsert;
static PyObject *__pyx_n_s_OnErrRtnExecOrderAction;
static PyObject *__pyx_n_u_OnErrRtnExecOrderAction;
static PyObject *__pyx_n_s_OnErrRtnExecOrderInsert;
static PyObject *__pyx_n_u_OnErrRtnExecOrderInsert;
static PyObject *__pyx_n_s_OnErrRtnForQuoteInsert;
static PyObject *__pyx_n_u_OnErrRtnForQuoteInsert;
static PyObject *__pyx_n_s_OnErrRtnFutureToBankByFuture;
static PyObject *__pyx_n_u_OnErrRtnFutureToBankByFuture;
static PyObject *__pyx_n_s_OnErrRtnOptionSelfCloseAction;
static PyObject *__pyx_n_u_OnErrRtnOptionSelfCloseAction;
static PyObject *__pyx_n_s_OnErrRtnOptionSelfCloseInsert;
static PyObject *__pyx_n_u_OnErrRtnOptionSelfCloseInsert;
static PyObject *__pyx_n_s_OnErrRtnOrderAction;
static PyObject *__pyx_n_u_OnErrRtnOrderAction;
static PyObject *__pyx_n_s_OnErrRtnOrderInsert;
static PyObject *__pyx_n_u_OnErrRtnOrderInsert;
static PyObject *__pyx_n_s_OnErrRtnQueryBankBalanceByFuture;
static PyObject *__pyx_n_u_OnErrRtnQueryBankBalanceByFuture;
static PyObject *__pyx_n_s_OnErrRtnQuoteAction;
static PyObject *__pyx_n_u_OnErrRtnQuoteAction;
static PyObject *__pyx_n_s_OnErrRtnQuoteInsert;
static PyObject *__pyx_n_u_OnErrRtnQuoteInsert;
static PyObject *__pyx_n_s_OnErrRtnRepealBankToFutureByFutu;
static PyObject *__pyx_n_u_OnErrRtnRepealBankToFutureByFutu;
static PyObject *__pyx_n_s_OnErrRtnRepealFutureToBankByFutu;
static PyObject *__pyx_n_u_OnErrRtnRepealFutureToBankByFutu;
static PyObject *__pyx_n_s_OnFrontConnected;
static PyObject *__pyx_n_u_OnFrontConnected;
static PyObject *__pyx_n_s_OnFrontDisconnected;
static PyObject *__pyx_n_u_OnFrontDisconnected;
static PyObject *__pyx_n_s_OnHeartBeatWarning;
static PyObject *__pyx_n_u_OnHeartBeatWarning;
static PyObject *__pyx_n_s_OnRspAuthenticate;
static PyObject *__pyx_n_u_OnRspAuthenticate;
static PyObject *__pyx_n_s_OnRspBatchOrderAction;
static PyObject *__pyx_n_u_OnRspBatchOrderAction;
static PyObject *__pyx_n_s_OnRspCombActionInsert;
static PyObject *__pyx_n_u_OnRspCombActionInsert;
static PyObject *__pyx_n_s_OnRspError;
static PyObject *__pyx_n_u_OnRspError;
static PyObject *__pyx_n_s_OnRspExecOrderAction;
static PyObject *__pyx_n_u_OnRspExecOrderAction;
static PyObject *__pyx_n_s_OnRspExecOrderInsert;
static PyObject *__pyx_n_u_OnRspExecOrderInsert;
static PyObject *__pyx_n_s_OnRspForQuoteInsert;
static PyObject *__pyx_n_u_OnRspForQuoteInsert;
static PyObject *__pyx_n_s_OnRspFromBankToFutureByFuture;
static PyObject *__pyx_n_u_OnRspFromBankToFutureByFuture;
static PyObject *__pyx_n_s_OnRspFromFutureToBankByFuture;
static PyObject *__pyx_n_u_OnRspFromFutureToBankByFuture;
static PyObject *__pyx_n_s_OnRspOptionSelfCloseAction;
static PyObject *__pyx_n_u_OnRspOptionSelfCloseAction;
static PyObject *__pyx_n_s_OnRspOptionSelfCloseInsert;
static PyObject *__pyx_n_u_OnRspOptionSelfCloseInsert;
static PyObject *__pyx_n_s_OnRspOrderAction;
static PyObject *__pyx_n_u_OnRspOrderAction;
static PyObject *__pyx_n_s_OnRspOrderInsert;
static PyObject *__pyx_n_u_OnRspOrderInsert;
static PyObject *__pyx_n_s_OnRspParkedOrderAction;
static PyObject *__pyx_n_u_OnRspParkedOrderAction;
static PyObject *__pyx_n_s_OnRspParkedOrderInsert;
static PyObject *__pyx_n_u_OnRspParkedOrderInsert;
static PyObject *__pyx_n_s_OnRspQryAccountregister;
static PyObject *__pyx_n_u_OnRspQryAccountregister;
static PyObject *__pyx_n_s_OnRspQryBrokerTradingAlgos;
static PyObject *__pyx_n_u_OnRspQryBrokerTradingAlgos;
static PyObject *__pyx_n_s_OnRspQryBrokerTradingParams;
static PyObject *__pyx_n_u_OnRspQryBrokerTradingParams;
static PyObject *__pyx_n_s_OnRspQryCFMMCTradingAccountKey;
static PyObject *__pyx_n_u_OnRspQryCFMMCTradingAccountKey;
static PyObject *__pyx_n_s_OnRspQryCombAction;
static PyObject *__pyx_n_u_OnRspQryCombAction;
static PyObject *__pyx_n_s_OnRspQryCombInstrumentGuard;
static PyObject *__pyx_n_u_OnRspQryCombInstrumentGuard;
static PyObject *__pyx_n_s_OnRspQryContractBank;
static PyObject *__pyx_n_u_OnRspQryContractBank;
static PyObject *__pyx_n_s_OnRspQryDepthMarketData;
static PyObject *__pyx_n_u_OnRspQryDepthMarketData;
static PyObject *__pyx_n_s_OnRspQryEWarrantOffset;
static PyObject *__pyx_n_u_OnRspQryEWarrantOffset;
static PyObject *__pyx_n_s_OnRspQryExchange;
static PyObject *__pyx_n_u_OnRspQryExchange;
static PyObject *__pyx_n_s_OnRspQryExchangeMarginRate;
static PyObject *__pyx_n_u_OnRspQryExchangeMarginRate;
static PyObject *__pyx_n_s_OnRspQryExchangeMarginRateAdjust;
static PyObject *__pyx_n_u_OnRspQryExchangeMarginRateAdjust;
static PyObject *__pyx_n_s_OnRspQryExchangeRate;
static PyObject *__pyx_n_u_OnRspQryExchangeRate;
static PyObject *__pyx_n_s_OnRspQryExecOrder;
static PyObject *__pyx_n_u_OnRspQryExecOrder;
static PyObject *__pyx_n_s_OnRspQryForQuote;
static PyObject *__pyx_n_u_OnRspQryForQuote;
static PyObject *__pyx_n_s_OnRspQryInstrument;
static PyObject *__pyx_n_u_OnRspQryInstrument;
static PyObject *__pyx_n_s_OnRspQryInstrumentCommissionRate;
static PyObject *__pyx_n_u_OnRspQryInstrumentCommissionRate;
static PyObject *__pyx_n_s_OnRspQryInstrumentMarginRate;
static PyObject *__pyx_n_u_OnRspQryInstrumentMarginRate;
static PyObject *__pyx_n_s_OnRspQryInstrumentOrderCommRate;
static PyObject *__pyx_n_u_OnRspQryInstrumentOrderCommRate;
static PyObject *__pyx_n_s_OnRspQryInvestUnit;
static PyObject *__pyx_n_u_OnRspQryInvestUnit;
static PyObject *__pyx_n_s_OnRspQryInvestor;
static PyObject *__pyx_n_u_OnRspQryInvestor;
static PyObject *__pyx_n_s_OnRspQryInvestorPosition;
static PyObject *__pyx_n_u_OnRspQryInvestorPosition;
static PyObject *__pyx_n_s_OnRspQryInvestorPositionCombineD;
static PyObject *__pyx_n_u_OnRspQryInvestorPositionCombineD;
static PyObject *__pyx_n_s_OnRspQryInvestorPositionDetail;
static PyObject *__pyx_n_u_OnRspQryInvestorPositionDetail;
static PyObject *__pyx_n_s_OnRspQryInvestorProductGroupMarg;
static PyObject *__pyx_n_u_OnRspQryInvestorProductGroupMarg;
static PyObject *__pyx_n_s_OnRspQryMMInstrumentCommissionRa;
static PyObject *__pyx_n_u_OnRspQryMMInstrumentCommissionRa;
static PyObject *__pyx_n_s_OnRspQryMMOptionInstrCommRate;
static PyObject *__pyx_n_u_OnRspQryMMOptionInstrCommRate;
static PyObject *__pyx_n_s_OnRspQryNotice;
static PyObject *__pyx_n_u_OnRspQryNotice;
static PyObject *__pyx_n_s_OnRspQryOptionInstrCommRate;
static PyObject *__pyx_n_u_OnRspQryOptionInstrCommRate;
static PyObject *__pyx_n_s_OnRspQryOptionInstrTradeCost;
static PyObject *__pyx_n_u_OnRspQryOptionInstrTradeCost;
static PyObject *__pyx_n_s_OnRspQryOptionSelfClose;
static PyObject *__pyx_n_u_OnRspQryOptionSelfClose;
static PyObject *__pyx_n_s_OnRspQryOrder;
static PyObject *__pyx_n_u_OnRspQryOrder;
static PyObject *__pyx_n_s_OnRspQryParkedOrder;
static PyObject *__pyx_n_u_OnRspQryParkedOrder;
static PyObject *__pyx_n_s_OnRspQryParkedOrderAction;
static PyObject *__pyx_n_u_OnRspQryParkedOrderAction;
static PyObject *__pyx_n_s_OnRspQryProduct;
static PyObject *__pyx_n_u_OnRspQryProduct;
static PyObject *__pyx_n_s_OnRspQryProductExchRate;
static PyObject *__pyx_n_u_OnRspQryProductExchRate;
static PyObject *__pyx_n_s_OnRspQryProductGroup;
static PyObject *__pyx_n_u_OnRspQryProductGroup;
static PyObject *__pyx_n_s_OnRspQryQuote;
static PyObject *__pyx_n_u_OnRspQryQuote;
static PyObject *__pyx_n_s_OnRspQrySecAgentACIDMap;
static PyObject *__pyx_n_u_OnRspQrySecAgentACIDMap;
static PyObject *__pyx_n_s_OnRspQrySecAgentCheckMode;
static PyObject *__pyx_n_u_OnRspQrySecAgentCheckMode;
static PyObject *__pyx_n_s_OnRspQrySecAgentTradingAccount;
static PyObject *__pyx_n_u_OnRspQrySecAgentTradingAccount;
static PyObject *__pyx_n_s_OnRspQrySettlementInfo;
static PyObject *__pyx_n_u_OnRspQrySettlementInfo;
static PyObject *__pyx_n_s_OnRspQrySettlementInfoConfirm;
static PyObject *__pyx_n_u_OnRspQrySettlementInfoConfirm;
static PyObject *__pyx_n_s_OnRspQryTrade;
static PyObject *__pyx_n_u_OnRspQryTrade;
static PyObject *__pyx_n_s_OnRspQryTradingAccount;
static PyObject *__pyx_n_u_OnRspQryTradingAccount;
static PyObject *__pyx_n_s_OnRspQryTradingCode;
static PyObject *__pyx_n_u_OnRspQryTradingCode;
static PyObject *__pyx_n_s_OnRspQryTradingNotice;
static PyObject *__pyx_n_u_OnRspQryTradingNotice;
static PyObject *__pyx_n_s_OnRspQryTransferBank;
static PyObject *__pyx_n_u_OnRspQryTransferBank;
static PyObject *__pyx_n_s_OnRspQryTransferSerial;
static PyObject *__pyx_n_u_OnRspQryTransferSerial;
static PyObject *__pyx_n_s_OnRspQueryBankAccountMoneyByFutu;
static PyObject *__pyx_n_u_OnRspQueryBankAccountMoneyByFutu;
static PyObject *__pyx_n_s_OnRspQueryCFMMCTradingAccountTok;
static PyObject *__pyx_n_u_OnRspQueryCFMMCTradingAccountTok;
static PyObject *__pyx_n_s_OnRspQueryMaxOrderVolume;
static PyObject *__pyx_n_u_OnRspQueryMaxOrderVolume;
static PyObject *__pyx_n_s_OnRspQuoteAction;
static PyObject *__pyx_n_u_OnRspQuoteAction;
static PyObject *__pyx_n_s_OnRspQuoteInsert;
static PyObject *__pyx_n_u_OnRspQuoteInsert;
static PyObject *__pyx_n_s_OnRspRemoveParkedOrder;
static PyObject *__pyx_n_u_OnRspRemoveParkedOrder;
static PyObject *__pyx_n_s_OnRspRemoveParkedOrderAction;
static PyObject *__pyx_n_u_OnRspRemoveParkedOrderAction;
static PyObject *__pyx_n_s_OnRspSettlementInfoConfirm;
static PyObject *__pyx_n_u_OnRspSettlementInfoConfirm;
static PyObject *__pyx_n_s_OnRspTradingAccountPasswordUpdat;
static PyObject *__pyx_n_u_OnRspTradingAccountPasswordUpdat;
static PyObject *__pyx_n_s_OnRspUserLogin;
static PyObject *__pyx_n_u_OnRspUserLogin;
static PyObject *__pyx_n_s_OnRspUserLogout;
static PyObject *__pyx_n_u_OnRspUserLogout;
static PyObject *__pyx_n_s_OnRspUserPasswordUpdate;
static PyObject *__pyx_n_u_OnRspUserPasswordUpdate;
static PyObject *__pyx_n_s_OnRtnBulletin;
static PyObject *__pyx_n_u_OnRtnBulletin;
static PyObject *__pyx_n_s_OnRtnCFMMCTradingAccountToken;
static PyObject *__pyx_n_u_OnRtnCFMMCTradingAccountToken;
static PyObject *__pyx_n_s_OnRtnCancelAccountByBank;
static PyObject *__pyx_n_u_OnRtnCancelAccountByBank;
static PyObject *__pyx_n_s_OnRtnChangeAccountByBank;
static PyObject *__pyx_n_u_OnRtnChangeAccountByBank;
static PyObject *__pyx_n_s_OnRtnCombAction;
static PyObject *__pyx_n_u_OnRtnCombAction;
static PyObject *__pyx_n_s_OnRtnErrorConditionalOrder;
static PyObject *__pyx_n_u_OnRtnErrorConditionalOrder;
static PyObject *__pyx_n_s_OnRtnExecOrder;
static PyObject *__pyx_n_u_OnRtnExecOrder;
static PyObject *__pyx_n_s_OnRtnForQuoteRsp;
static PyObject *__pyx_n_u_OnRtnForQuoteRsp;
static PyObject *__pyx_n_s_OnRtnFromBankToFutureByBank;
static PyObject *__pyx_n_u_OnRtnFromBankToFutureByBank;
static PyObject *__pyx_n_s_OnRtnFromBankToFutureByFuture;
static PyObject *__pyx_n_u_OnRtnFromBankToFutureByFuture;
static PyObject *__pyx_n_s_OnRtnFromFutureToBankByBank;
static PyObject *__pyx_n_u_OnRtnFromFutureToBankByBank;
static PyObject *__pyx_n_s_OnRtnFromFutureToBankByFuture;
static PyObject *__pyx_n_u_OnRtnFromFutureToBankByFuture;
static PyObject *__pyx_n_s_OnRtnInstrumentStatus;
static PyObject *__pyx_n_u_OnRtnInstrumentStatus;
static PyObject *__pyx_n_s_OnRtnOpenAccountByBank;
static PyObject *__pyx_n_u_OnRtnOpenAccountByBank;
static PyObject *__pyx_n_s_OnRtnOptionSelfClose;
static PyObject *__pyx_n_u_OnRtnOptionSelfClose;
static PyObject *__pyx_n_s_OnRtnOrder;
static PyObject *__pyx_n_u_OnRtnOrder;
static PyObject *__pyx_n_s_OnRtnQueryBankBalanceByFuture;
static PyObject *__pyx_n_u_OnRtnQueryBankBalanceByFuture;
static PyObject *__pyx_n_s_OnRtnQuote;
static PyObject *__pyx_n_u_OnRtnQuote;
static PyObject *__pyx_n_s_OnRtnRepealFromBankToFutureByBan;
static PyObject *__pyx_n_u_OnRtnRepealFromBankToFutureByBan;
static PyObject *__pyx_n_s_OnRtnRepealFromBankToFutureByFut;
static PyObject *__pyx_n_u_OnRtnRepealFromBankToFutureByFut;
static PyObject *__pyx_n_s_OnRtnRepealFromBankToFutureByFut_2;
static PyObject *__pyx_n_u_OnRtnRepealFromBankToFutureByFut_2;
static PyObject *__pyx_n_s_OnRtnRepealFromFutureToBankByBan;
static PyObject *__pyx_n_u_OnRtnRepealFromFutureToBankByBan;
static PyObject *__pyx_n_s_OnRtnRepealFromFutureToBankByFut;
static PyObject *__pyx_n_u_OnRtnRepealFromFutureToBankByFut;
static PyObject *__pyx_n_s_OnRtnRepealFromFutureToBankByFut_2;
static PyObject *__pyx_n_u_OnRtnRepealFromFutureToBankByFut_2;
static PyObject *__pyx_n_s_OnRtnTrade;
static PyObject *__pyx_n_u_OnRtnTrade;
static PyObject *__pyx_n_s_OnRtnTradingNotice;
static PyObject *__pyx_n_u_OnRtnTradingNotice;
static PyObject *__pyx_n_s_OpenAccountField;
static PyObject *__pyx_n_s_OptionInstrCommRateField;
static PyObject *__pyx_n_s_OptionInstrTradeCostField;
static PyObject *__pyx_n_s_OptionSelfCloseActionField;
static PyObject *__pyx_n_s_OptionSelfCloseField;
static PyObject *__pyx_n_s_OrderActionField;
static PyObject *__pyx_n_s_OrderField;
static PyObject *__pyx_n_s_ParkedOrderActionField;
static PyObject *__pyx_n_s_ParkedOrderField;
static PyObject *__pyx_n_s_PrivateSubscribeTopic;
static PyObject *__pyx_n_s_ProductExchRateField;
static PyObject *__pyx_n_s_ProductField;
static PyObject *__pyx_n_s_ProductGroupField;
static PyObject *__pyx_n_s_PublicSubscribeTopic;
static PyObject *__pyx_n_s_QueryCFMMCTradingAccountTokenFie;
static PyObject *__pyx_n_s_QueryMaxOrderVolumeField;
static PyObject *__pyx_n_s_QuoteActionField;
static PyObject *__pyx_n_s_QuoteField;
static PyObject *__pyx_n_s_RegisterFensUserInfo;
static PyObject *__pyx_n_u_RegisterFensUserInfo;
static PyObject *__pyx_n_s_RegisterFront;
static PyObject *__pyx_n_u_RegisterFront;
static PyObject *__pyx_n_s_RegisterNameServer;
static PyObject *__pyx_n_u_RegisterNameServer;
static PyObject *__pyx_n_s_Release;
static PyObject *__pyx_n_s_RemoveParkedOrderActionField;
static PyObject *__pyx_n_s_RemoveParkedOrderField;
static PyObject *__pyx_n_s_ReqAuthenticate;
static PyObject *__pyx_n_u_ReqAuthenticate;
static PyObject *__pyx_n_s_ReqBatchOrderAction;
static PyObject *__pyx_n_u_ReqBatchOrderAction;
static PyObject *__pyx_n_s_ReqCombActionInsert;
static PyObject *__pyx_n_u_ReqCombActionInsert;
static PyObject *__pyx_n_s_ReqExecOrderAction;
static PyObject *__pyx_n_u_ReqExecOrderAction;
static PyObject *__pyx_n_s_ReqExecOrderInsert;
static PyObject *__pyx_n_u_ReqExecOrderInsert;
static PyObject *__pyx_n_s_ReqForQuoteInsert;
static PyObject *__pyx_n_u_ReqForQuoteInsert;
static PyObject *__pyx_n_s_ReqFromBankToFutureByFuture;
static PyObject *__pyx_n_u_ReqFromBankToFutureByFuture;
static PyObject *__pyx_n_s_ReqFromFutureToBankByFuture;
static PyObject *__pyx_n_u_ReqFromFutureToBankByFuture;
static PyObject *__pyx_n_s_ReqOptionSelfCloseAction;
static PyObject *__pyx_n_u_ReqOptionSelfCloseAction;
static PyObject *__pyx_n_s_ReqOptionSelfCloseInsert;
static PyObject *__pyx_n_u_ReqOptionSelfCloseInsert;
static PyObject *__pyx_n_s_ReqOrderAction;
static PyObject *__pyx_n_u_ReqOrderAction;
static PyObject *__pyx_n_s_ReqOrderInsert;
static PyObject *__pyx_n_u_ReqOrderInsert;
static PyObject *__pyx_n_s_ReqParkedOrderAction;
static PyObject *__pyx_n_u_ReqParkedOrderAction;
static PyObject *__pyx_n_s_ReqParkedOrderInsert;
static PyObject *__pyx_n_u_ReqParkedOrderInsert;
static PyObject *__pyx_n_s_ReqQryAccountregister;
static PyObject *__pyx_n_u_ReqQryAccountregister;
static PyObject *__pyx_n_s_ReqQryBrokerTradingAlgos;
static PyObject *__pyx_n_u_ReqQryBrokerTradingAlgos;
static PyObject *__pyx_n_s_ReqQryBrokerTradingParams;
static PyObject *__pyx_n_u_ReqQryBrokerTradingParams;
static PyObject *__pyx_n_s_ReqQryCFMMCTradingAccountKey;
static PyObject *__pyx_n_u_ReqQryCFMMCTradingAccountKey;
static PyObject *__pyx_n_s_ReqQryCombAction;
static PyObject *__pyx_n_u_ReqQryCombAction;
static PyObject *__pyx_n_s_ReqQryCombInstrumentGuard;
static PyObject *__pyx_n_u_ReqQryCombInstrumentGuard;
static PyObject *__pyx_n_s_ReqQryContractBank;
static PyObject *__pyx_n_u_ReqQryContractBank;
static PyObject *__pyx_n_s_ReqQryDepthMarketData;
static PyObject *__pyx_n_u_ReqQryDepthMarketData;
static PyObject *__pyx_n_s_ReqQryEWarrantOffset;
static PyObject *__pyx_n_u_ReqQryEWarrantOffset;
static PyObject *__pyx_n_s_ReqQryExchange;
static PyObject *__pyx_n_u_ReqQryExchange;
static PyObject *__pyx_n_s_ReqQryExchangeMarginRate;
static PyObject *__pyx_n_u_ReqQryExchangeMarginRate;
static PyObject *__pyx_n_s_ReqQryExchangeMarginRateAdjust;
static PyObject *__pyx_n_u_ReqQryExchangeMarginRateAdjust;
static PyObject *__pyx_n_s_ReqQryExchangeRate;
static PyObject *__pyx_n_u_ReqQryExchangeRate;
static PyObject *__pyx_n_s_ReqQryExecOrder;
static PyObject *__pyx_n_u_ReqQryExecOrder;
static PyObject *__pyx_n_s_ReqQryForQuote;
static PyObject *__pyx_n_u_ReqQryForQuote;
static PyObject *__pyx_n_s_ReqQryInstrument;
static PyObject *__pyx_n_u_ReqQryInstrument;
static PyObject *__pyx_n_s_ReqQryInstrumentCommissionRate;
static PyObject *__pyx_n_u_ReqQryInstrumentCommissionRate;
static PyObject *__pyx_n_s_ReqQryInstrumentMarginRate;
static PyObject *__pyx_n_u_ReqQryInstrumentMarginRate;
static PyObject *__pyx_n_s_ReqQryInstrumentOrderCommRate;
static PyObject *__pyx_n_u_ReqQryInstrumentOrderCommRate;
static PyObject *__pyx_n_s_ReqQryInvestUnit;
static PyObject *__pyx_n_u_ReqQryInvestUnit;
static PyObject *__pyx_n_s_ReqQryInvestor;
static PyObject *__pyx_n_u_ReqQryInvestor;
static PyObject *__pyx_n_s_ReqQryInvestorPosition;
static PyObject *__pyx_n_u_ReqQryInvestorPosition;
static PyObject *__pyx_n_s_ReqQryInvestorPositionCombineDet;
static PyObject *__pyx_n_u_ReqQryInvestorPositionCombineDet;
static PyObject *__pyx_n_s_ReqQryInvestorPositionDetail;
static PyObject *__pyx_n_u_ReqQryInvestorPositionDetail;
static PyObject *__pyx_n_s_ReqQryInvestorProductGroupMargin;
static PyObject *__pyx_n_u_ReqQryInvestorProductGroupMargin;
static PyObject *__pyx_n_s_ReqQryMMInstrumentCommissionRate;
static PyObject *__pyx_n_u_ReqQryMMInstrumentCommissionRate;
static PyObject *__pyx_n_s_ReqQryMMOptionInstrCommRate;
static PyObject *__pyx_n_u_ReqQryMMOptionInstrCommRate;
static PyObject *__pyx_n_s_ReqQryNotice;
static PyObject *__pyx_n_u_ReqQryNotice;
static PyObject *__pyx_n_s_ReqQryOptionInstrCommRate;
static PyObject *__pyx_n_u_ReqQryOptionInstrCommRate;
static PyObject *__pyx_n_s_ReqQryOptionInstrTradeCost;
static PyObject *__pyx_n_u_ReqQryOptionInstrTradeCost;
static PyObject *__pyx_n_s_ReqQryOptionSelfClose;
static PyObject *__pyx_n_u_ReqQryOptionSelfClose;
static PyObject *__pyx_n_s_ReqQryOrder;
static PyObject *__pyx_n_u_ReqQryOrder;
static PyObject *__pyx_n_s_ReqQryParkedOrder;
static PyObject *__pyx_n_u_ReqQryParkedOrder;
static PyObject *__pyx_n_s_ReqQryParkedOrderAction;
static PyObject *__pyx_n_u_ReqQryParkedOrderAction;
static PyObject *__pyx_n_s_ReqQryProduct;
static PyObject *__pyx_n_u_ReqQryProduct;
static PyObject *__pyx_n_s_ReqQryProductExchRate;
static PyObject *__pyx_n_u_ReqQryProductExchRate;
static PyObject *__pyx_n_s_ReqQryProductGroup;
static PyObject *__pyx_n_u_ReqQryProductGroup;
static PyObject *__pyx_n_s_ReqQryQuote;
static PyObject *__pyx_n_u_ReqQryQuote;
static PyObject *__pyx_n_s_ReqQrySecAgentACIDMap;
static PyObject *__pyx_n_u_ReqQrySecAgentACIDMap;
static PyObject *__pyx_n_s_ReqQrySecAgentCheckMode;
static PyObject *__pyx_n_u_ReqQrySecAgentCheckMode;
static PyObject *__pyx_n_s_ReqQrySecAgentTradingAccount;
static PyObject *__pyx_n_u_ReqQrySecAgentTradingAccount;
static PyObject *__pyx_n_s_ReqQrySettlementInfo;
static PyObject *__pyx_n_u_ReqQrySettlementInfo;
static PyObject *__pyx_n_s_ReqQrySettlementInfoConfirm;
static PyObject *__pyx_n_u_ReqQrySettlementInfoConfirm;
static PyObject *__pyx_n_s_ReqQryTrade;
static PyObject *__pyx_n_u_ReqQryTrade;
static PyObject *__pyx_n_s_ReqQryTradingAccount;
static PyObject *__pyx_n_u_ReqQryTradingAccount;
static PyObject *__pyx_n_s_ReqQryTradingCode;
static PyObject *__pyx_n_u_ReqQryTradingCode;
static PyObject *__pyx_n_s_ReqQryTradingNotice;
static PyObject *__pyx_n_u_ReqQryTradingNotice;
static PyObject *__pyx_n_s_ReqQryTransferBank;
static PyObject *__pyx_n_u_ReqQryTransferBank;
static PyObject *__pyx_n_s_ReqQryTransferSerial;
static PyObject *__pyx_n_u_ReqQryTransferSerial;
static PyObject *__pyx_n_s_ReqQueryAccountField;
static PyObject *__pyx_n_s_ReqQueryBankAccountMoneyByFuture;
static PyObject *__pyx_n_u_ReqQueryBankAccountMoneyByFuture;
static PyObject *__pyx_n_s_ReqQueryCFMMCTradingAccountToken;
static PyObject *__pyx_n_u_ReqQueryCFMMCTradingAccountToken;
static PyObject *__pyx_n_s_ReqQueryMaxOrderVolume;
static PyObject *__pyx_n_u_ReqQueryMaxOrderVolume;
static PyObject *__pyx_n_s_ReqQuoteAction;
static PyObject *__pyx_n_u_ReqQuoteAction;
static PyObject *__pyx_n_s_ReqQuoteInsert;
static PyObject *__pyx_n_u_ReqQuoteInsert;
static PyObject *__pyx_n_s_ReqRemoveParkedOrder;
static PyObject *__pyx_n_u_ReqRemoveParkedOrder;
static PyObject *__pyx_n_s_ReqRemoveParkedOrderAction;
static PyObject *__pyx_n_u_ReqRemoveParkedOrderAction;
static PyObject *__pyx_n_s_ReqRepealField;
static PyObject *__pyx_n_s_ReqSettlementInfoConfirm;
static PyObject *__pyx_n_u_ReqSettlementInfoConfirm;
static PyObject *__pyx_n_s_ReqTradingAccountPasswordUpdate;
static PyObject *__pyx_n_u_ReqTradingAccountPasswordUpdate;
static PyObject *__pyx_n_s_ReqTransferField;
static PyObject *__pyx_n_s_ReqUserLogin;
static PyObject *__pyx_n_u_ReqUserLogin;
static PyObject *__pyx_n_s_ReqUserLogin2;
static PyObject *__pyx_n_u_ReqUserLogin2;
static PyObject *__pyx_n_s_ReqUserLogout;
static PyObject *__pyx_n_u_ReqUserLogout;
static PyObject *__pyx_n_s_ReqUserPasswordUpdate;
static PyObject *__pyx_n_u_ReqUserPasswordUpdate;
static PyObject *__pyx_n_s_ReqUserPasswordUpdate2;
static PyObject *__pyx_n_u_ReqUserPasswordUpdate2;
static PyObject *__pyx_n_s_RequestID;
static PyObject *__pyx_n_s_RspAuthenticateField;
static PyObject *__pyx_n_s_RspInfoField;
static PyObject *__pyx_n_s_RspRepealField;
static PyObject *__pyx_n_s_RspTransferField;
static PyObject *__pyx_n_s_RspUserLoginField;
static PyObject *__pyx_n_s_SecAgentACIDMapField;
static PyObject *__pyx_n_s_SecAgentCheckModeField;
static PyObject *__pyx_n_s_SettlementInfoConfirmField;
static PyObject *__pyx_n_s_SettlementInfoField;
static PyObject *__pyx_n_s_SubscribePrivateTopic;
static PyObject *__pyx_n_u_SubscribePrivateTopic;
static PyObject *__pyx_n_s_SubscribePublicTopic;
static PyObject *__pyx_n_u_SubscribePublicTopic;
static PyObject *__pyx_kp_u_Tader_Init;
static PyObject *__pyx_n_s_TradeField;
static PyObject *__pyx_n_u_Trader;
static PyObject *__pyx_n_u_TraderApiWrapper;
static PyObject *__pyx_n_s_TraderApiWrapper_GetApiVersion;
static PyObject *__pyx_n_s_TraderApiWrapper_GetTradingDay;
static PyObject *__pyx_n_s_TraderApiWrapper_Inc_RequestID;
static PyObject *__pyx_n_s_TraderApiWrapper_Init_Base;
static PyObject *__pyx_n_s_TraderApiWrapper_Init_Net;
static PyObject *__pyx_n_s_TraderApiWrapper_Join;
static PyObject *__pyx_n_s_TraderApiWrapper_RegisterFensUse;
static PyObject *__pyx_n_s_TraderApiWrapper_RegisterFront;
static PyObject *__pyx_n_s_TraderApiWrapper_RegisterNameSer;
static PyObject *__pyx_n_s_TraderApiWrapper_Release;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqAuthenticate;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqBatchOrderAc;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqCombActionIn;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqExecOrderAct;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqExecOrderIns;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqForQuoteInse;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqFromBankToFu;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqFromFutureTo;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqOptionSelfCl;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqOptionSelfCl_2;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqOrderAction;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqOrderInsert;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqParkedOrderA;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqParkedOrderI;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryAccountre;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryBrokerTra;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryBrokerTra_2;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryCFMMCTrad;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryCombActio;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryCombInstr;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryContractB;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryDepthMark;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryEWarrantO;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryExchange;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryExchangeM;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryExchangeM_2;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryExchangeR;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryExecOrder;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryForQuote;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryInstrumen;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryInstrumen_2;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryInstrumen_3;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryInstrumen_4;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryInvestUni;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryInvestor;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryInvestorP;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryInvestorP_2;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryInvestorP_3;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryInvestorP_4;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryMMInstrum;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryMMOptionI;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryNotice;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryOptionIns;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryOptionIns_2;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryOptionSel;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryOrder;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryParkedOrd;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryParkedOrd_2;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryProduct;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryProductEx;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryProductGr;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryQuote;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQrySecAgentA;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQrySecAgentC;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQrySecAgentT;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQrySettlemen;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQrySettlemen_2;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryTrade;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryTradingAc;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryTradingCo;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryTradingNo;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryTransferB;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQryTransferS;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQueryBankAcc;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQueryCFMMCTr;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQueryMaxOrde;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQuoteAction;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqQuoteInsert;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqRemoveParked;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqRemoveParked_2;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqSettlementIn;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqTradingAccou;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqUserLogin;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqUserLogin2;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqUserLogout;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqUserPassword;
static PyObject *__pyx_n_s_TraderApiWrapper_ReqUserPassword_2;
static PyObject *__pyx_n_s_TraderApiWrapper_SubscribePrivat;
static PyObject *__pyx_n_s_TraderApiWrapper_SubscribePublic;
static PyObject *__pyx_n_s_TraderApiWrapper___reduce_cython;
static PyObject *__pyx_n_s_TraderApiWrapper___setstate_cyth;
static PyObject *__pyx_n_u_TraderApicall_stack;
static PyObject *__pyx_n_s_TradingAccountField;
static PyObject *__pyx_n_s_TradingAccountPasswordUpdateFiel;
static PyObject *__pyx_n_s_TradingCodeField;
static PyObject *__pyx_n_s_TradingNoticeField;
static PyObject *__pyx_n_s_TradingNoticeInfoField;
static PyObject *__pyx_n_s_TransferBankField;
static PyObject *__pyx_n_s_TransferSerialField;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_s_UserLogoutField;
static PyObject *__pyx_n_s_UserPasswordUpdateField;
static PyObject *__pyx_n_s__214;
static PyObject *__pyx_n_s_address;
static PyObject *__pyx_n_s_addressof;
static PyObject *__pyx_n_s_bInit;
static PyObject *__pyx_kp_u_call;
static PyObject *__pyx_kp_u_call_2;
static PyObject *__pyx_n_s_cfg_ptp_can_change_env;
static PyObject *__pyx_n_s_cfg_ptp_env;
static PyObject *__pyx_n_u_cinit;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_co_name;
static PyObject *__pyx_n_s_configparser;
static PyObject *__pyx_n_u_ctp;
static PyObject *__pyx_n_s_ctypes;
static PyObject *__pyx_n_s_datetime;
static PyObject *__pyx_n_s_dwTime;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_err;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_n_s_exc_info;
static PyObject *__pyx_n_s_express;
static PyObject *__pyx_n_s_f_code;
static PyObject *__pyx_n_s_from_address;
static PyObject *__pyx_n_s_funName;
static PyObject *__pyx_n_s_getframe;
static PyObject *__pyx_n_s_imp;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_info;
static PyObject *__pyx_n_s_logDes;
static PyObject *__pyx_n_s_logger;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_md_lastPrice;
static PyObject *__pyx_n_s_myDEnv;
static PyObject *__pyx_n_s_myEnv;
static PyObject *__pyx_n_s_nRequestID;
static PyObject *__pyx_n_s_nResumeType;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
static PyObject *__pyx_n_s_pFensUserInfo;
static PyObject *__pyx_n_s_pInputBatchOrderAction;
static PyObject *__pyx_n_s_pInputCombAction;
static PyObject *__pyx_n_s_pInputExecOrder;
static PyObject *__pyx_n_s_pInputExecOrderAction;
static PyObject *__pyx_n_s_pInputForQuote;
static PyObject *__pyx_n_s_pInputOptionSelfClose;
static PyObject *__pyx_n_s_pInputOptionSelfCloseAction;
static PyObject *__pyx_n_s_pInputOrder;
static PyObject *__pyx_n_s_pInputOrderAction;
static PyObject *__pyx_n_s_pInputQuote;
static PyObject *__pyx_n_s_pInputQuoteAction;
static PyObject *__pyx_n_s_pParkedOrder;
static PyObject *__pyx_n_s_pParkedOrderAction;
static PyObject *__pyx_n_s_pQryAccountregister;
static PyObject *__pyx_n_s_pQryBrokerTradingAlgos;
static PyObject *__pyx_n_s_pQryBrokerTradingParams;
static PyObject *__pyx_n_s_pQryCFMMCTradingAccountKey;
static PyObject *__pyx_n_s_pQryCombAction;
static PyObject *__pyx_n_s_pQryCombInstrumentGuard;
static PyObject *__pyx_n_s_pQryContractBank;
static PyObject *__pyx_n_s_pQryDepthMarketData;
static PyObject *__pyx_n_s_pQryEWarrantOffset;
static PyObject *__pyx_n_s_pQryExchange;
static PyObject *__pyx_n_s_pQryExchangeMarginRate;
static PyObject *__pyx_n_s_pQryExchangeMarginRateAdjust;
static PyObject *__pyx_n_s_pQryExchangeRate;
static PyObject *__pyx_n_s_pQryExecOrder;
static PyObject *__pyx_n_s_pQryForQuote;
static PyObject *__pyx_n_s_pQryInstrument;
static PyObject *__pyx_n_s_pQryInstrumentCommissionRate;
static PyObject *__pyx_n_s_pQryInstrumentMarginRate;
static PyObject *__pyx_n_s_pQryInstrumentOrderCommRate;
static PyObject *__pyx_n_s_pQryInvestUnit;
static PyObject *__pyx_n_s_pQryInvestor;
static PyObject *__pyx_n_s_pQryInvestorPosition;
static PyObject *__pyx_n_s_pQryInvestorPositionCombineDetai;
static PyObject *__pyx_n_s_pQryInvestorPositionDetail;
static PyObject *__pyx_n_s_pQryInvestorProductGroupMargin;
static PyObject *__pyx_n_s_pQryMMInstrumentCommissionRate;
static PyObject *__pyx_n_s_pQryMMOptionInstrCommRate;
static PyObject *__pyx_n_s_pQryNotice;
static PyObject *__pyx_n_s_pQryOptionInstrCommRate;
static PyObject *__pyx_n_s_pQryOptionInstrTradeCost;
static PyObject *__pyx_n_s_pQryOptionSelfClose;
static PyObject *__pyx_n_s_pQryOrder;
static PyObject *__pyx_n_s_pQryParkedOrder;
static PyObject *__pyx_n_s_pQryParkedOrderAction;
static PyObject *__pyx_n_s_pQryProduct;
static PyObject *__pyx_n_s_pQryProductExchRate;
static PyObject *__pyx_n_s_pQryProductGroup;
static PyObject *__pyx_n_s_pQryQuote;
static PyObject *__pyx_n_s_pQrySecAgentACIDMap;
static PyObject *__pyx_n_s_pQrySecAgentCheckMode;
static PyObject *__pyx_n_s_pQrySettlementInfo;
static PyObject *__pyx_n_s_pQrySettlementInfoConfirm;
static PyObject *__pyx_n_s_pQryTrade;
static PyObject *__pyx_n_s_pQryTradingAccount;
static PyObject *__pyx_n_s_pQryTradingCode;
static PyObject *__pyx_n_s_pQryTradingNotice;
static PyObject *__pyx_n_s_pQryTransferBank;
static PyObject *__pyx_n_s_pQryTransferSerial;
static PyObject *__pyx_n_s_pQueryCFMMCTradingAccountToken;
static PyObject *__pyx_n_s_pQueryMaxOrderVolume;
static PyObject *__pyx_n_s_pRemoveParkedOrder;
static PyObject *__pyx_n_s_pRemoveParkedOrderAction;
static PyObject *__pyx_n_s_pReqAuthenticateField;
static PyObject *__pyx_n_s_pReqQueryAccount;
static PyObject *__pyx_n_s_pReqTransfer;
static PyObject *__pyx_n_s_pReqUserLogin;
static PyObject *__pyx_n_s_pReqUserLoginField;
static PyObject *__pyx_n_s_pSettlementInfoConfirm;
static PyObject *__pyx_n_s_pTradingAccountPasswordUpdate;
static PyObject *__pyx_n_s_pUserLogout;
static PyObject *__pyx_n_s_pUserPasswordUpdate;
static PyObject *__pyx_n_s_printNumber;
static PyObject *__pyx_n_s_printString;
static PyObject *__pyx_n_s_pszFlowPath;
static PyObject *__pyx_n_s_pszFrontAddress;
static PyObject *__pyx_n_s_pszNsAddress;
static PyObject *__pyx_n_s_ptp;
static PyObject *__pyx_n_s_ptp_CythonLib;
static PyObject *__pyx_n_s_ptp_TraderApi;
static PyObject *__pyx_kp_s_ptp_TraderApi_pyx;
static PyObject *__pyx_n_s_py_ApiStructure;
static PyObject *__pyx_n_s_pyx_state;
static PyObject *__pyx_n_s_reduce_cython;
static PyObject *__pyx_kp_u_regist;
static PyObject *__pyx_n_s_reload;
static PyObject *__pyx_n_s_result;
static PyObject *__pyx_kp_u_s_s;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_server;
static PyObject *__pyx_n_s_setstate_cython;
static PyObject *__pyx_n_s_sleep;
static PyObject *__pyx_n_s_staticmethod;
static PyObject *__pyx_kp_u_step_Infra_Init_4_of_4_step;
static PyObject *__pyx_kp_u_step_RegisterFront_3_of_4_step;
static PyObject *__pyx_kp_u_step_RegisterSpi_1_of_4_step;
static PyObject *__pyx_kp_u_step_SubscribeTopic_2_of_4_step;
static PyObject *__pyx_kp_s_stringsource;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_time;
static PyObject *__pyx_n_s_trader_server;
static int __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper___cinit__(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_2Inc_RequestID(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self); /* proto */
static void __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_4__dealloc__(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_6GetApiVersion(); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_8Release(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_10Init_Base(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_12Init_Net(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_14Join(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_16GetTradingDay(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_18RegisterFront(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, char *__pyx_v_pszFrontAddress); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_20RegisterNameServer(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, char *__pyx_v_pszNsAddress); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_22RegisterFensUserInfo(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pFensUserInfo); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_24SubscribePrivateTopic(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, enum THOST_TE_RESUME_TYPE __pyx_v_nResumeType); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_26SubscribePublicTopic(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, enum THOST_TE_RESUME_TYPE __pyx_v_nResumeType); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_28ReqAuthenticate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pReqAuthenticateField, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_30ReqUserLogin(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pReqUserLoginField, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_32ReqUserLogout(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pUserLogout, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_34ReqUserPasswordUpdate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pUserPasswordUpdate, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_36ReqTradingAccountPasswordUpdate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pTradingAccountPasswordUpdate, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_38ReqUserLogin2(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pReqUserLogin, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_40ReqUserPasswordUpdate2(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pUserPasswordUpdate, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_42ReqOrderInsert(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputOrder, int __pyx_v_nRequestID, CYTHON_UNUSED PyObject *__pyx_v_express, CYTHON_UNUSED PyObject *__pyx_v_md_lastPrice); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_44ReqParkedOrderInsert(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pParkedOrder, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_46ReqParkedOrderAction(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pParkedOrderAction, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_48ReqOrderAction(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputOrderAction, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_50ReqQueryMaxOrderVolume(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQueryMaxOrderVolume, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_52ReqSettlementInfoConfirm(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pSettlementInfoConfirm, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_54ReqRemoveParkedOrder(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pRemoveParkedOrder, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_56ReqRemoveParkedOrderAction(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pRemoveParkedOrderAction, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_58ReqExecOrderInsert(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputExecOrder, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_60ReqExecOrderAction(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputExecOrderAction, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_62ReqForQuoteInsert(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputForQuote, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_64ReqQuoteInsert(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputQuote, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_66ReqQuoteAction(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputQuoteAction, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_68ReqBatchOrderAction(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputBatchOrderAction, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_70ReqOptionSelfCloseInsert(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputOptionSelfClose, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_72ReqOptionSelfCloseAction(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputOptionSelfCloseAction, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_74ReqCombActionInsert(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputCombAction, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_76ReqQryOrder(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryOrder, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_78ReqQryTrade(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryTrade, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_80ReqQryInvestorPosition(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryInvestorPosition, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_82ReqQryTradingAccount(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryTradingAccount, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_84ReqQryInvestor(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryInvestor, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_86ReqQryTradingCode(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryTradingCode, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_88ReqQryInstrumentMarginRate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryInstrumentMarginRate, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_90ReqQryInstrumentCommissionRate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryInstrumentCommissionRate, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_92ReqQryExchange(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryExchange, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_94ReqQryProduct(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryProduct, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_96ReqQryInstrument(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryInstrument, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_98ReqQryDepthMarketData(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryDepthMarketData, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_100ReqQrySettlementInfo(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQrySettlementInfo, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_102ReqQryTransferBank(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryTransferBank, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_104ReqQryInvestorPositionDetail(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryInvestorPositionDetail, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_106ReqQryNotice(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryNotice, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_108ReqQrySettlementInfoConfirm(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQrySettlementInfoConfirm, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_110ReqQryInvestorPositionCombineDetail(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryInvestorPositionCombineDetail, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_112ReqQryCFMMCTradingAccountKey(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryCFMMCTradingAccountKey, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_114ReqQryEWarrantOffset(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryEWarrantOffset, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_116ReqQryInvestorProductGroupMargin(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryInvestorProductGroupMargin, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_118ReqQryExchangeMarginRate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryExchangeMarginRate, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_120ReqQryExchangeMarginRateAdjust(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryExchangeMarginRateAdjust, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_122ReqQryExchangeRate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryExchangeRate, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_124ReqQrySecAgentACIDMap(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQrySecAgentACIDMap, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_126ReqQryProductExchRate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryProductExchRate, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_128ReqQryProductGroup(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryProductGroup, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_130ReqQryMMInstrumentCommissionRate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryMMInstrumentCommissionRate, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_132ReqQryMMOptionInstrCommRate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryMMOptionInstrCommRate, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_134ReqQryInstrumentOrderCommRate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryInstrumentOrderCommRate, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_136ReqQrySecAgentTradingAccount(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryTradingAccount, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_138ReqQrySecAgentCheckMode(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQrySecAgentCheckMode, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_140ReqQryOptionInstrTradeCost(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryOptionInstrTradeCost, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_142ReqQryOptionInstrCommRate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryOptionInstrCommRate, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_144ReqQryExecOrder(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryExecOrder, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_146ReqQryForQuote(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryForQuote, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_148ReqQryQuote(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryQuote, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_150ReqQryOptionSelfClose(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryOptionSelfClose, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_152ReqQryInvestUnit(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryInvestUnit, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_154ReqQryCombInstrumentGuard(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryCombInstrumentGuard, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_156ReqQryCombAction(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryCombAction, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_158ReqQryTransferSerial(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryTransferSerial, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_160ReqQryAccountregister(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryAccountregister, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_162ReqQryContractBank(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryContractBank, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_164ReqQryParkedOrder(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryParkedOrder, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_166ReqQryParkedOrderAction(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryParkedOrderAction, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_168ReqQryTradingNotice(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryTradingNotice, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_170ReqQryBrokerTradingParams(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryBrokerTradingParams, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_172ReqQryBrokerTradingAlgos(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryBrokerTradingAlgos, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_174ReqQueryCFMMCTradingAccountToken(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQueryCFMMCTradingAccountToken, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_176ReqFromBankToFutureByFuture(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pReqTransfer, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_178ReqFromFutureToBankByFuture(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pReqTransfer, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_180ReqQueryBankAccountMoneyByFuture(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pReqQueryAccount, int __pyx_v_nRequestID); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_182__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_184__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_3ptp_9TraderApi_TraderApiWrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__57;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_tuple__70;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__74;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__77;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__79;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__83;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_tuple__85;
static PyObject *__pyx_tuple__86;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__89;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__91;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__94;
static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_tuple__99;
static PyObject *__pyx_tuple__100;
static PyObject *__pyx_tuple__101;
static PyObject *__pyx_tuple__102;
static PyObject *__pyx_tuple__103;
static PyObject *__pyx_tuple__104;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__106;
static PyObject *__pyx_tuple__107;
static PyObject *__pyx_tuple__108;
static PyObject *__pyx_tuple__109;
static PyObject *__pyx_tuple__110;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__112;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__115;
static PyObject *__pyx_tuple__116;
static PyObject *__pyx_tuple__117;
static PyObject *__pyx_tuple__118;
static PyObject *__pyx_tuple__119;
static PyObject *__pyx_tuple__120;
static PyObject *__pyx_tuple__121;
static PyObject *__pyx_tuple__122;
static PyObject *__pyx_tuple__123;
static PyObject *__pyx_tuple__124;
static PyObject *__pyx_tuple__125;
static PyObject *__pyx_tuple__126;
static PyObject *__pyx_tuple__127;
static PyObject *__pyx_tuple__128;
static PyObject *__pyx_tuple__129;
static PyObject *__pyx_tuple__130;
static PyObject *__pyx_tuple__131;
static PyObject *__pyx_tuple__132;
static PyObject *__pyx_tuple__133;
static PyObject *__pyx_tuple__134;
static PyObject *__pyx_tuple__135;
static PyObject *__pyx_tuple__136;
static PyObject *__pyx_tuple__137;
static PyObject *__pyx_tuple__138;
static PyObject *__pyx_tuple__139;
static PyObject *__pyx_tuple__140;
static PyObject *__pyx_tuple__141;
static PyObject *__pyx_tuple__142;
static PyObject *__pyx_tuple__143;
static PyObject *__pyx_tuple__144;
static PyObject *__pyx_tuple__145;
static PyObject *__pyx_tuple__146;
static PyObject *__pyx_tuple__147;
static PyObject *__pyx_tuple__148;
static PyObject *__pyx_tuple__149;
static PyObject *__pyx_tuple__150;
static PyObject *__pyx_tuple__151;
static PyObject *__pyx_tuple__152;
static PyObject *__pyx_tuple__153;
static PyObject *__pyx_tuple__154;
static PyObject *__pyx_tuple__155;
static PyObject *__pyx_tuple__156;
static PyObject *__pyx_tuple__157;
static PyObject *__pyx_tuple__158;
static PyObject *__pyx_tuple__159;
static PyObject *__pyx_tuple__160;
static PyObject *__pyx_tuple__161;
static PyObject *__pyx_tuple__162;
static PyObject *__pyx_tuple__163;
static PyObject *__pyx_tuple__164;
static PyObject *__pyx_tuple__165;
static PyObject *__pyx_tuple__166;
static PyObject *__pyx_tuple__167;
static PyObject *__pyx_tuple__168;
static PyObject *__pyx_tuple__169;
static PyObject *__pyx_tuple__170;
static PyObject *__pyx_tuple__171;
static PyObject *__pyx_tuple__172;
static PyObject *__pyx_tuple__173;
static PyObject *__pyx_tuple__174;
static PyObject *__pyx_tuple__175;
static PyObject *__pyx_tuple__176;
static PyObject *__pyx_tuple__177;
static PyObject *__pyx_tuple__178;
static PyObject *__pyx_tuple__179;
static PyObject *__pyx_tuple__180;
static PyObject *__pyx_tuple__181;
static PyObject *__pyx_tuple__182;
static PyObject *__pyx_tuple__183;
static PyObject *__pyx_tuple__184;
static PyObject *__pyx_tuple__185;
static PyObject *__pyx_tuple__186;
static PyObject *__pyx_tuple__187;
static PyObject *__pyx_tuple__188;
static PyObject *__pyx_tuple__189;
static PyObject *__pyx_tuple__190;
static PyObject *__pyx_tuple__191;
static PyObject *__pyx_tuple__192;
static PyObject *__pyx_tuple__193;
static PyObject *__pyx_tuple__194;
static PyObject *__pyx_tuple__195;
static PyObject *__pyx_tuple__196;
static PyObject *__pyx_tuple__197;
static PyObject *__pyx_tuple__198;
static PyObject *__pyx_tuple__199;
static PyObject *__pyx_tuple__200;
static PyObject *__pyx_tuple__201;
static PyObject *__pyx_tuple__202;
static PyObject *__pyx_tuple__203;
static PyObject *__pyx_tuple__204;
static PyObject *__pyx_tuple__205;
static PyObject *__pyx_tuple__206;
static PyObject *__pyx_tuple__207;
static PyObject *__pyx_tuple__208;
static PyObject *__pyx_tuple__209;
static PyObject *__pyx_tuple__210;
static PyObject *__pyx_tuple__211;
static PyObject *__pyx_tuple__212;
static PyObject *__pyx_tuple__213;
static PyObject *__pyx_tuple__215;
static PyObject *__pyx_tuple__217;
static PyObject *__pyx_tuple__219;
static PyObject *__pyx_tuple__221;
static PyObject *__pyx_tuple__223;
static PyObject *__pyx_tuple__225;
static PyObject *__pyx_tuple__227;
static PyObject *__pyx_tuple__229;
static PyObject *__pyx_tuple__231;
static PyObject *__pyx_tuple__233;
static PyObject *__pyx_tuple__235;
static PyObject *__pyx_tuple__237;
static PyObject *__pyx_tuple__239;
static PyObject *__pyx_tuple__241;
static PyObject *__pyx_tuple__243;
static PyObject *__pyx_tuple__245;
static PyObject *__pyx_tuple__247;
static PyObject *__pyx_tuple__249;
static PyObject *__pyx_tuple__251;
static PyObject *__pyx_tuple__253;
static PyObject *__pyx_tuple__255;
static PyObject *__pyx_tuple__257;
static PyObject *__pyx_tuple__259;
static PyObject *__pyx_tuple__261;
static PyObject *__pyx_tuple__263;
static PyObject *__pyx_tuple__265;
static PyObject *__pyx_tuple__267;
static PyObject *__pyx_tuple__269;
static PyObject *__pyx_tuple__271;
static PyObject *__pyx_tuple__273;
static PyObject *__pyx_tuple__275;
static PyObject *__pyx_tuple__277;
static PyObject *__pyx_tuple__279;
static PyObject *__pyx_tuple__281;
static PyObject *__pyx_tuple__283;
static PyObject *__pyx_tuple__285;
static PyObject *__pyx_tuple__287;
static PyObject *__pyx_tuple__289;
static PyObject *__pyx_tuple__291;
static PyObject *__pyx_tuple__293;
static PyObject *__pyx_tuple__295;
static PyObject *__pyx_tuple__297;
static PyObject *__pyx_tuple__299;
static PyObject *__pyx_tuple__301;
static PyObject *__pyx_tuple__303;
static PyObject *__pyx_tuple__305;
static PyObject *__pyx_tuple__307;
static PyObject *__pyx_tuple__309;
static PyObject *__pyx_tuple__311;
static PyObject *__pyx_tuple__313;
static PyObject *__pyx_tuple__315;
static PyObject *__pyx_tuple__317;
static PyObject *__pyx_tuple__319;
static PyObject *__pyx_tuple__321;
static PyObject *__pyx_tuple__323;
static PyObject *__pyx_tuple__325;
static PyObject *__pyx_tuple__327;
static PyObject *__pyx_tuple__329;
static PyObject *__pyx_tuple__331;
static PyObject *__pyx_tuple__333;
static PyObject *__pyx_tuple__335;
static PyObject *__pyx_tuple__337;
static PyObject *__pyx_tuple__339;
static PyObject *__pyx_tuple__341;
static PyObject *__pyx_tuple__343;
static PyObject *__pyx_tuple__345;
static PyObject *__pyx_tuple__347;
static PyObject *__pyx_tuple__349;
static PyObject *__pyx_tuple__351;
static PyObject *__pyx_tuple__353;
static PyObject *__pyx_tuple__355;
static PyObject *__pyx_tuple__357;
static PyObject *__pyx_tuple__359;
static PyObject *__pyx_tuple__361;
static PyObject *__pyx_tuple__363;
static PyObject *__pyx_tuple__365;
static PyObject *__pyx_tuple__367;
static PyObject *__pyx_tuple__369;
static PyObject *__pyx_tuple__371;
static PyObject *__pyx_tuple__373;
static PyObject *__pyx_tuple__375;
static PyObject *__pyx_tuple__377;
static PyObject *__pyx_tuple__379;
static PyObject *__pyx_tuple__381;
static PyObject *__pyx_tuple__383;
static PyObject *__pyx_tuple__385;
static PyObject *__pyx_tuple__387;
static PyObject *__pyx_tuple__389;
static PyObject *__pyx_tuple__391;
static PyObject *__pyx_tuple__393;
static PyObject *__pyx_tuple__395;
static PyObject *__pyx_codeobj__216;
static PyObject *__pyx_codeobj__218;
static PyObject *__pyx_codeobj__220;
static PyObject *__pyx_codeobj__222;
static PyObject *__pyx_codeobj__224;
static PyObject *__pyx_codeobj__226;
static PyObject *__pyx_codeobj__228;
static PyObject *__pyx_codeobj__230;
static PyObject *__pyx_codeobj__232;
static PyObject *__pyx_codeobj__234;
static PyObject *__pyx_codeobj__236;
static PyObject *__pyx_codeobj__238;
static PyObject *__pyx_codeobj__240;
static PyObject *__pyx_codeobj__242;
static PyObject *__pyx_codeobj__244;
static PyObject *__pyx_codeobj__246;
static PyObject *__pyx_codeobj__248;
static PyObject *__pyx_codeobj__250;
static PyObject *__pyx_codeobj__252;
static PyObject *__pyx_codeobj__254;
static PyObject *__pyx_codeobj__256;
static PyObject *__pyx_codeobj__258;
static PyObject *__pyx_codeobj__260;
static PyObject *__pyx_codeobj__262;
static PyObject *__pyx_codeobj__264;
static PyObject *__pyx_codeobj__266;
static PyObject *__pyx_codeobj__268;
static PyObject *__pyx_codeobj__270;
static PyObject *__pyx_codeobj__272;
static PyObject *__pyx_codeobj__274;
static PyObject *__pyx_codeobj__276;
static PyObject *__pyx_codeobj__278;
static PyObject *__pyx_codeobj__280;
static PyObject *__pyx_codeobj__282;
static PyObject *__pyx_codeobj__284;
static PyObject *__pyx_codeobj__286;
static PyObject *__pyx_codeobj__288;
static PyObject *__pyx_codeobj__290;
static PyObject *__pyx_codeobj__292;
static PyObject *__pyx_codeobj__294;
static PyObject *__pyx_codeobj__296;
static PyObject *__pyx_codeobj__298;
static PyObject *__pyx_codeobj__300;
static PyObject *__pyx_codeobj__302;
static PyObject *__pyx_codeobj__304;
static PyObject *__pyx_codeobj__306;
static PyObject *__pyx_codeobj__308;
static PyObject *__pyx_codeobj__310;
static PyObject *__pyx_codeobj__312;
static PyObject *__pyx_codeobj__314;
static PyObject *__pyx_codeobj__316;
static PyObject *__pyx_codeobj__318;
static PyObject *__pyx_codeobj__320;
static PyObject *__pyx_codeobj__322;
static PyObject *__pyx_codeobj__324;
static PyObject *__pyx_codeobj__326;
static PyObject *__pyx_codeobj__328;
static PyObject *__pyx_codeobj__330;
static PyObject *__pyx_codeobj__332;
static PyObject *__pyx_codeobj__334;
static PyObject *__pyx_codeobj__336;
static PyObject *__pyx_codeobj__338;
static PyObject *__pyx_codeobj__340;
static PyObject *__pyx_codeobj__342;
static PyObject *__pyx_codeobj__344;
static PyObject *__pyx_codeobj__346;
static PyObject *__pyx_codeobj__348;
static PyObject *__pyx_codeobj__350;
static PyObject *__pyx_codeobj__352;
static PyObject *__pyx_codeobj__354;
static PyObject *__pyx_codeobj__356;
static PyObject *__pyx_codeobj__358;
static PyObject *__pyx_codeobj__360;
static PyObject *__pyx_codeobj__362;
static PyObject *__pyx_codeobj__364;
static PyObject *__pyx_codeobj__366;
static PyObject *__pyx_codeobj__368;
static PyObject *__pyx_codeobj__370;
static PyObject *__pyx_codeobj__372;
static PyObject *__pyx_codeobj__374;
static PyObject *__pyx_codeobj__376;
static PyObject *__pyx_codeobj__378;
static PyObject *__pyx_codeobj__380;
static PyObject *__pyx_codeobj__382;
static PyObject *__pyx_codeobj__384;
static PyObject *__pyx_codeobj__386;
static PyObject *__pyx_codeobj__388;
static PyObject *__pyx_codeobj__390;
static PyObject *__pyx_codeobj__392;
static PyObject *__pyx_codeobj__394;
static PyObject *__pyx_codeobj__396;

/* "ptp/TraderApi.pyx":33
 *   cdef CTraderSpi *_spi
 * 
 *   def __cinit__(self):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % ("TraderApiWrapper", "__cinit__")
 *     printString("TraderApicall_stack","call->",funName)
 */

/* Python wrapper */
static int __pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper___cinit__(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper___cinit__(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self) {
  PyObject *__pyx_v_funName = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "ptp/TraderApi.pyx":34
 * 
 *   def __cinit__(self):
 *     funName = "%s.%s" % ("TraderApiWrapper", "__cinit__")             # <<<<<<<<<<<<<<
 *     printString("TraderApicall_stack","call->",funName)
 *     self._api = NULL
 */
  __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_tuple_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_funName = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":35
 *   def __cinit__(self):
 *     funName = "%s.%s" % ("TraderApiWrapper", "__cinit__")
 *     printString("TraderApicall_stack","call->",funName)             # <<<<<<<<<<<<<<
 *     self._api = NULL
 *     self._spi = NULL
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
    __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_n_u_TraderApicall_stack);
    __Pyx_INCREF(__pyx_kp_u_call);
    __Pyx_GIVEREF(__pyx_kp_u_call);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_kp_u_call);
    __Pyx_INCREF(__pyx_v_funName);
    __Pyx_GIVEREF(__pyx_v_funName);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_funName);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":36
 *     funName = "%s.%s" % ("TraderApiWrapper", "__cinit__")
 *     printString("TraderApicall_stack","call->",funName)
 *     self._api = NULL             # <<<<<<<<<<<<<<
 *     self._spi = NULL
 * 
 */
  __pyx_v_self->_api = NULL;

  /* "ptp/TraderApi.pyx":37
 *     printString("TraderApicall_stack","call->",funName)
 *     self._api = NULL
 *     self._spi = NULL             # <<<<<<<<<<<<<<
 * 
 *     self.RequestID = 1
 */
  __pyx_v_self->_spi = NULL;

  /* "ptp/TraderApi.pyx":39
 *     self._spi = NULL
 * 
 *     self.RequestID = 1             # <<<<<<<<<<<<<<
 *     printString("TraderApicall_stack","call-<",funName)
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_RequestID, __pyx_int_1) < 0) __PYX_ERR(0, 39, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":40
 * 
 *     self.RequestID = 1
 *     printString("TraderApicall_stack","call-<",funName)             # <<<<<<<<<<<<<<
 * 
 *   def Inc_RequestID(self):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
    __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_n_u_TraderApicall_stack);
    __Pyx_INCREF(__pyx_kp_u_call_2);
    __Pyx_GIVEREF(__pyx_kp_u_call_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_kp_u_call_2);
    __Pyx_INCREF(__pyx_v_funName);
    __Pyx_GIVEREF(__pyx_v_funName);
    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_4, __pyx_v_funName);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":33
 *   cdef CTraderSpi *_spi
 * 
 *   def __cinit__(self):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % ("TraderApiWrapper", "__cinit__")
 *     printString("TraderApicall_stack","call->",funName)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":42
 *     printString("TraderApicall_stack","call-<",funName)
 * 
 *   def Inc_RequestID(self):             # <<<<<<<<<<<<<<
 *     self.RequestID = self.RequestID + 1
 *     return self.RequestID
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_3Inc_RequestID(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_3Inc_RequestID = {"Inc_RequestID", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_3Inc_RequestID, METH_NOARGS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_3Inc_RequestID(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Inc_RequestID (wrapper)", 0);
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_2Inc_RequestID(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_2Inc_RequestID(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("Inc_RequestID", 0);

  /* "ptp/TraderApi.pyx":43
 * 
 *   def Inc_RequestID(self):
 *     self.RequestID = self.RequestID + 1             # <<<<<<<<<<<<<<
 *     return self.RequestID
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_RequestID); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_RequestID, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ptp/TraderApi.pyx":44
 *   def Inc_RequestID(self):
 *     self.RequestID = self.RequestID + 1
 *     return self.RequestID             # <<<<<<<<<<<<<<
 * 
 *   def __dealloc__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_RequestID); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":42
 *     printString("TraderApicall_stack","call-<",funName)
 * 
 *   def Inc_RequestID(self):             # <<<<<<<<<<<<<<
 *     self.RequestID = self.RequestID + 1
 *     return self.RequestID
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.Inc_RequestID", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":46
 *     return self.RequestID
 * 
 *   def __dealloc__(self):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */

/* Python wrapper */
static void __pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_5__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_4__dealloc__(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_4__dealloc__(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self) {
  PyObject *__pyx_v_funName = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "ptp/TraderApi.pyx":47
 * 
 *   def __dealloc__(self):
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *     printString("TraderApicall_stack","call->",funName)
 *     self.Release()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getframe); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_co_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_funName = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":48
 *   def __dealloc__(self):
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)             # <<<<<<<<<<<<<<
 *     self.Release()
 *     printString("TraderApicall_stack","call-<",funName)
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
    __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_n_u_TraderApicall_stack);
    __Pyx_INCREF(__pyx_kp_u_call);
    __Pyx_GIVEREF(__pyx_kp_u_call);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_kp_u_call);
    __Pyx_INCREF(__pyx_v_funName);
    __Pyx_GIVEREF(__pyx_v_funName);
    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_5, __pyx_v_funName);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":49
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 *     self.Release()             # <<<<<<<<<<<<<<
 *     printString("TraderApicall_stack","call-<",funName)
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Release); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":50
 *     printString("TraderApicall_stack","call->",funName)
 *     self.Release()
 *     printString("TraderApicall_stack","call-<",funName)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_2 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
    __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
    PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_5, __pyx_n_u_TraderApicall_stack);
    __Pyx_INCREF(__pyx_kp_u_call_2);
    __Pyx_GIVEREF(__pyx_kp_u_call_2);
    PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_5, __pyx_kp_u_call_2);
    __Pyx_INCREF(__pyx_v_funName);
    __Pyx_GIVEREF(__pyx_v_funName);
    PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_5, __pyx_v_funName);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":46
 *     return self.RequestID
 * 
 *   def __dealloc__(self):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("ptp.TraderApi.TraderApiWrapper.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_RefNannyFinishContext();
}

/* "ptp/TraderApi.pyx":74
 * 
 *   @staticmethod
 *   def GetApiVersion():             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % ("Trader", "GetApiVersion")
 *     printString("TraderApicall_stack","call->",funName)
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_7GetApiVersion(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_7GetApiVersion = {"GetApiVersion", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_7GetApiVersion, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_7GetApiVersion(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetApiVersion (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("GetApiVersion", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "GetApiVersion", 0))) return NULL;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_6GetApiVersion();

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_6GetApiVersion() {
  PyObject *__pyx_v_funName = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("GetApiVersion", 0);

  /* "ptp/TraderApi.pyx":75
 *   @staticmethod
 *   def GetApiVersion():
 *     funName = "%s.%s" % ("Trader", "GetApiVersion")             # <<<<<<<<<<<<<<
 *     printString("TraderApicall_stack","call->",funName)
 *     return CTraderApi.GetApiVersion()
 */
  __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_tuple__2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_funName = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":76
 *   def GetApiVersion():
 *     funName = "%s.%s" % ("Trader", "GetApiVersion")
 *     printString("TraderApicall_stack","call->",funName)             # <<<<<<<<<<<<<<
 *     return CTraderApi.GetApiVersion()
 *     printString("TraderApicall_stack","call-<",funName)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
    __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_n_u_TraderApicall_stack);
    __Pyx_INCREF(__pyx_kp_u_call);
    __Pyx_GIVEREF(__pyx_kp_u_call);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_kp_u_call);
    __Pyx_INCREF(__pyx_v_funName);
    __Pyx_GIVEREF(__pyx_v_funName);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_funName);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":77
 *     funName = "%s.%s" % ("Trader", "GetApiVersion")
 *     printString("TraderApicall_stack","call->",funName)
 *     return CTraderApi.GetApiVersion()             # <<<<<<<<<<<<<<
 *     printString("TraderApicall_stack","call-<",funName)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(CThostFtdcTraderApi::GetApiVersion()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":74
 * 
 *   @staticmethod
 *   def GetApiVersion():             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % ("Trader", "GetApiVersion")
 *     printString("TraderApicall_stack","call->",funName)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.GetApiVersion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":80
 *     printString("TraderApicall_stack","call-<",funName)
 * 
 *   def Release(self):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_9Release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_9Release = {"Release", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_9Release, METH_NOARGS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_9Release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Release (wrapper)", 0);
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_8Release(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_8Release(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self) {
  PyObject *__pyx_v_funName = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("Release", 0);

  /* "ptp/TraderApi.pyx":81
 * 
 *   def Release(self):
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *     printString("TraderApicall_stack","call->",funName)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getframe); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_co_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_funName = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":82
 *   def Release(self):
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)             # <<<<<<<<<<<<<<
 * 
 *     if self._api is not NULL:
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
    __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_n_u_TraderApicall_stack);
    __Pyx_INCREF(__pyx_kp_u_call);
    __Pyx_GIVEREF(__pyx_kp_u_call);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_kp_u_call);
    __Pyx_INCREF(__pyx_v_funName);
    __Pyx_GIVEREF(__pyx_v_funName);
    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_5, __pyx_v_funName);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":84
 *     printString("TraderApicall_stack","call->",funName)
 * 
 *     if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         self._api.RegisterSpi(NULL)
 *         self._api.Release()
 */
  __pyx_t_6 = ((__pyx_v_self->_api != NULL) != 0);
  if (__pyx_t_6) {

    /* "ptp/TraderApi.pyx":85
 * 
 *     if self._api is not NULL:
 *         self._api.RegisterSpi(NULL)             # <<<<<<<<<<<<<<
 *         self._api.Release()
 *         self._api = NULL
 */
    try {
      __pyx_v_self->_api->RegisterSpi(NULL);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 85, __pyx_L1_error)
    }

    /* "ptp/TraderApi.pyx":86
 *     if self._api is not NULL:
 *         self._api.RegisterSpi(NULL)
 *         self._api.Release()             # <<<<<<<<<<<<<<
 *         self._api = NULL
 *         self._spi = NULL
 */
    __pyx_v_self->_api->Release();

    /* "ptp/TraderApi.pyx":87
 *         self._api.RegisterSpi(NULL)
 *         self._api.Release()
 *         self._api = NULL             # <<<<<<<<<<<<<<
 *         self._spi = NULL
 * 
 */
    __pyx_v_self->_api = NULL;

    /* "ptp/TraderApi.pyx":88
 *         self._api.Release()
 *         self._api = NULL
 *         self._spi = NULL             # <<<<<<<<<<<<<<
 * 
 *     printString("TraderApicall_stack","call-<",funName)
 */
    __pyx_v_self->_spi = NULL;

    /* "ptp/TraderApi.pyx":84
 *     printString("TraderApicall_stack","call->",funName)
 * 
 *     if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         self._api.RegisterSpi(NULL)
 *         self._api.Release()
 */
  }

  /* "ptp/TraderApi.pyx":90
 *         self._spi = NULL
 * 
 *     printString("TraderApicall_stack","call-<",funName)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_2 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
    __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
    PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_5, __pyx_n_u_TraderApicall_stack);
    __Pyx_INCREF(__pyx_kp_u_call_2);
    __Pyx_GIVEREF(__pyx_kp_u_call_2);
    PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_5, __pyx_kp_u_call_2);
    __Pyx_INCREF(__pyx_v_funName);
    __Pyx_GIVEREF(__pyx_v_funName);
    PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_5, __pyx_v_funName);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":80
 *     printString("TraderApicall_stack","call-<",funName)
 * 
 *   def Release(self):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.Release", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":94
 * 
 * 
 *   def Init_Base(self):             # <<<<<<<<<<<<<<
 *     bInit=-1
 *     try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_11Init_Base(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_11Init_Base = {"Init_Base", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_11Init_Base, METH_NOARGS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_11Init_Base(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Init_Base (wrapper)", 0);
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_10Init_Base(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_10Init_Base(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self) {
  long __pyx_v_bInit;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  const char *__pyx_t_7;
  CThostFtdcTraderApi *__pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("Init_Base", 0);

  /* "ptp/TraderApi.pyx":95
 * 
 *   def Init_Base(self):
 *     bInit=-1             # <<<<<<<<<<<<<<
 *     try:
 *       self._api = CreateFtdcTraderApi(self.pszFlowPath.encode())
 */
  __pyx_v_bInit = -1L;

  /* "ptp/TraderApi.pyx":96
 *   def Init_Base(self):
 *     bInit=-1
 *     try:             # <<<<<<<<<<<<<<
 *       self._api = CreateFtdcTraderApi(self.pszFlowPath.encode())
 *       if not self._api:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":97
 *     bInit=-1
 *     try:
 *       self._api = CreateFtdcTraderApi(self.pszFlowPath.encode())             # <<<<<<<<<<<<<<
 *       if not self._api:
 *           raise MemoryError()
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pszFlowPath); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 97, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (__pyx_t_5) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L3_error)
      try {
        __pyx_t_8 = CThostFtdcTraderApi::CreateFtdcTraderApi(__pyx_t_7);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 97, __pyx_L3_error)
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_self->_api = __pyx_t_8;

      /* "ptp/TraderApi.pyx":98
 *     try:
 *       self._api = CreateFtdcTraderApi(self.pszFlowPath.encode())
 *       if not self._api:             # <<<<<<<<<<<<<<
 *           raise MemoryError()
 * 
 */
      __pyx_t_9 = ((!(__pyx_v_self->_api != 0)) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":99
 *       self._api = CreateFtdcTraderApi(self.pszFlowPath.encode())
 *       if not self._api:
 *           raise MemoryError()             # <<<<<<<<<<<<<<
 * 
 *       self._spi = new CTraderSpi(<PyObject *> self)
 */
        PyErr_NoMemory(); __PYX_ERR(0, 99, __pyx_L3_error)

        /* "ptp/TraderApi.pyx":98
 *     try:
 *       self._api = CreateFtdcTraderApi(self.pszFlowPath.encode())
 *       if not self._api:             # <<<<<<<<<<<<<<
 *           raise MemoryError()
 * 
 */
      }

      /* "ptp/TraderApi.pyx":101
 *           raise MemoryError()
 * 
 *       self._spi = new CTraderSpi(<PyObject *> self)             # <<<<<<<<<<<<<<
 *       if not self._spi:
 *         raise MemoryError()
 */
      __pyx_v_self->_spi = new CTraderSpi(((PyObject *)__pyx_v_self));

      /* "ptp/TraderApi.pyx":102
 * 
 *       self._spi = new CTraderSpi(<PyObject *> self)
 *       if not self._spi:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 * 
 */
      __pyx_t_9 = ((!(__pyx_v_self->_spi != 0)) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":103
 *       self._spi = new CTraderSpi(<PyObject *> self)
 *       if not self._spi:
 *         raise MemoryError()             # <<<<<<<<<<<<<<
 * 
 *       bInit=0
 */
        PyErr_NoMemory(); __PYX_ERR(0, 103, __pyx_L3_error)

        /* "ptp/TraderApi.pyx":102
 * 
 *       self._spi = new CTraderSpi(<PyObject *> self)
 *       if not self._spi:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 * 
 */
      }

      /* "ptp/TraderApi.pyx":105
 *         raise MemoryError()
 * 
 *       bInit=0             # <<<<<<<<<<<<<<
 * 
 *     except Exception as err:
 */
      __pyx_v_bInit = 0;

      /* "ptp/TraderApi.pyx":96
 *   def Init_Base(self):
 *     bInit=-1
 *     try:             # <<<<<<<<<<<<<<
 *       self._api = CreateFtdcTraderApi(self.pszFlowPath.encode())
 *       if not self._api:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":107
 *       bInit=0
 * 
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error("Init_Base", exc_info=True)
 * 
 */
    __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_10) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.Init_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 107, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":108
 * 
 *     except Exception as err:
 *       myEnv.logger.error("Init_Base", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return bInit
 */
        __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 108, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_logger); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 108, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_error); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 108, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 108, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 108, __pyx_L16_error)
        __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__3, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 108, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }

      /* "ptp/TraderApi.pyx":107
 *       bInit=0
 * 
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error("Init_Base", exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L17;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L16_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_10 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L17:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":96
 *   def Init_Base(self):
 *     bInit=-1
 *     try:             # <<<<<<<<<<<<<<
 *       self._api = CreateFtdcTraderApi(self.pszFlowPath.encode())
 *       if not self._api:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":110
 *       myEnv.logger.error("Init_Base", exc_info=True)
 * 
 *     return bInit             # <<<<<<<<<<<<<<
 * 
 *   def Init_Net(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_bInit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":94
 * 
 * 
 *   def Init_Base(self):             # <<<<<<<<<<<<<<
 *     bInit=-1
 *     try:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.Init_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":112
 *     return bInit
 * 
 *   def Init_Net(self):             # <<<<<<<<<<<<<<
 *     try:
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_13Init_Net(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_13Init_Net = {"Init_Net", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_13Init_Net, METH_NOARGS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_13Init_Net(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Init_Net (wrapper)", 0);
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_12Init_Net(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_12Init_Net(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self) {
  PyObject *__pyx_v_funName = NULL;
  long __pyx_v_bInit;
  PyObject *__pyx_v_logDes = NULL;
  PyObject *__pyx_v_server = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("Init_Net", 0);

  /* "ptp/TraderApi.pyx":113
 * 
 *   def Init_Net(self):
 *     try:             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":114
 *   def Init_Net(self):
 *     try:
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 114, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 114, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 114, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 114, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":115
 *     try:
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName)             # <<<<<<<<<<<<<<
 * 
 *       bInit=-1
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 115, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 115, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":117
 *       printString("TraderApicall_stack","call->",funName)
 * 
 *       bInit=-1             # <<<<<<<<<<<<<<
 *       if self._api is not NULL and self._spi  is not NULL:
 * 
 */
      __pyx_v_bInit = -1L;

      /* "ptp/TraderApi.pyx":118
 * 
 *       bInit=-1
 *       if self._api is not NULL and self._spi  is not NULL:             # <<<<<<<<<<<<<<
 * 
 *         self._api.RegisterSpi(self._spi)
 */
      __pyx_t_10 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_10) {
      } else {
        __pyx_t_9 = __pyx_t_10;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_10 = ((__pyx_v_self->_spi != NULL) != 0);
      __pyx_t_9 = __pyx_t_10;
      __pyx_L10_bool_binop_done:;
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":120
 *       if self._api is not NULL and self._spi  is not NULL:
 * 
 *         self._api.RegisterSpi(self._spi)             # <<<<<<<<<<<<<<
 *         logDes="step(RegisterSpi) 1(of 4 step)"
 *         myEnv.logger.info(logDes)
 */
        try {
          __pyx_v_self->_api->RegisterSpi(__pyx_v_self->_spi);
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 120, __pyx_L3_error)
        }

        /* "ptp/TraderApi.pyx":121
 * 
 *         self._api.RegisterSpi(self._spi)
 *         logDes="step(RegisterSpi) 1(of 4 step)"             # <<<<<<<<<<<<<<
 *         myEnv.logger.info(logDes)
 * 
 */
        __Pyx_INCREF(__pyx_kp_u_step_RegisterSpi_1_of_4_step);
        __pyx_v_logDes = __pyx_kp_u_step_RegisterSpi_1_of_4_step;

        /* "ptp/TraderApi.pyx":122
 *         self._api.RegisterSpi(self._spi)
 *         logDes="step(RegisterSpi) 1(of 4 step)"
 *         myEnv.logger.info(logDes)             # <<<<<<<<<<<<<<
 * 
 *         self.SubscribePrivateTopic(self.PrivateSubscribeTopic)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 122, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_info); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 122, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        if (!__pyx_t_6) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_logDes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_logDes};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_logDes};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
            __Pyx_INCREF(__pyx_v_logDes);
            __Pyx_GIVEREF(__pyx_v_logDes);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_logDes);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "ptp/TraderApi.pyx":124
 *         myEnv.logger.info(logDes)
 * 
 *         self.SubscribePrivateTopic(self.PrivateSubscribeTopic)             # <<<<<<<<<<<<<<
 *         self.SubscribePublicTopic( self.PublicSubscribeTopic)
 *         logDes="step(SubscribeTopic) 2(of 4 step)"
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_SubscribePrivateTopic); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 124, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_PrivateSubscribeTopic); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        if (!__pyx_t_6) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          } else
          #endif
          {
            __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 124, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL;
            __Pyx_GIVEREF(__pyx_t_5);
            PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_5);
            __pyx_t_5 = 0;
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "ptp/TraderApi.pyx":125
 * 
 *         self.SubscribePrivateTopic(self.PrivateSubscribeTopic)
 *         self.SubscribePublicTopic( self.PublicSubscribeTopic)             # <<<<<<<<<<<<<<
 *         logDes="step(SubscribeTopic) 2(of 4 step)"
 *         myEnv.logger.info(logDes)
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_SubscribePublicTopic); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 125, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_PublicSubscribeTopic); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 125, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        if (!__pyx_t_5) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_11};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_11};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          } else
          #endif
          {
            __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_11);
            __pyx_t_11 = 0;
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "ptp/TraderApi.pyx":126
 *         self.SubscribePrivateTopic(self.PrivateSubscribeTopic)
 *         self.SubscribePublicTopic( self.PublicSubscribeTopic)
 *         logDes="step(SubscribeTopic) 2(of 4 step)"             # <<<<<<<<<<<<<<
 *         myEnv.logger.info(logDes)
 * 
 */
        __Pyx_INCREF(__pyx_kp_u_step_SubscribeTopic_2_of_4_step);
        __Pyx_DECREF_SET(__pyx_v_logDes, __pyx_kp_u_step_SubscribeTopic_2_of_4_step);

        /* "ptp/TraderApi.pyx":127
 *         self.SubscribePublicTopic( self.PublicSubscribeTopic)
 *         logDes="step(SubscribeTopic) 2(of 4 step)"
 *         myEnv.logger.info(logDes)             # <<<<<<<<<<<<<<
 * 
 *         #SSLssl://192.168.0.1:41205
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 127, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_info); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        if (!__pyx_t_6) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_logDes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_logDes};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_logDes};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 127, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL;
            __Pyx_INCREF(__pyx_v_logDes);
            __Pyx_GIVEREF(__pyx_v_logDes);
            PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_logDes);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "ptp/TraderApi.pyx":134
 *         #pUserMdApi->RegisterFront(tcp://192.168.0.1:41213);
 *         #pUserMdApi->RegisterFront(tcp://192.168.0.2:41213);
 *         for server in self.trader_server:             # <<<<<<<<<<<<<<
 *           #server = "tcp://" + self.md_server + ":" + str(self.md_port)
 *           myEnv.logger.info("regist " + server)
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trader_server); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
          __pyx_t_7 = __pyx_t_4; __Pyx_INCREF(__pyx_t_7); __pyx_t_12 = 0;
          __pyx_t_13 = NULL;
        } else {
          __pyx_t_12 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 134, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_13 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 134, __pyx_L3_error)
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        for (;;) {
          if (likely(!__pyx_t_13)) {
            if (likely(PyList_CheckExact(__pyx_t_7))) {
              if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_7)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 134, __pyx_L3_error)
              #else
              __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_4);
              #endif
            } else {
              if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 134, __pyx_L3_error)
              #else
              __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_4);
              #endif
            }
          } else {
            __pyx_t_4 = __pyx_t_13(__pyx_t_7);
            if (unlikely(!__pyx_t_4)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 134, __pyx_L3_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_4);
          }
          __Pyx_XDECREF_SET(__pyx_v_server, __pyx_t_4);
          __pyx_t_4 = 0;

          /* "ptp/TraderApi.pyx":136
 *         for server in self.trader_server:
 *           #server = "tcp://" + self.md_server + ":" + str(self.md_port)
 *           myEnv.logger.info("regist " + server)             # <<<<<<<<<<<<<<
 *           self.RegisterFront(server.encode())
 *         logDes="step(RegisterFront) 3(of 4 step)"
 */
          __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 136, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_logger); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 136, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_info); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 136, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = PyNumber_Add(__pyx_kp_u_regist, __pyx_v_server); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 136, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_5 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11);
            if (likely(__pyx_t_5)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
              __Pyx_INCREF(__pyx_t_5);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_11, function);
            }
          }
          if (!__pyx_t_5) {
            __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_11)) {
              PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
              __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
              PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
              __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            } else
            #endif
            {
              __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 136, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_14);
              __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_5); __pyx_t_5 = NULL;
              __Pyx_GIVEREF(__pyx_t_6);
              PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_6);
              __pyx_t_6 = 0;
              __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "ptp/TraderApi.pyx":137
 *           #server = "tcp://" + self.md_server + ":" + str(self.md_port)
 *           myEnv.logger.info("regist " + server)
 *           self.RegisterFront(server.encode())             # <<<<<<<<<<<<<<
 *         logDes="step(RegisterFront) 3(of 4 step)"
 *         myEnv.logger.info(logDes)
 */
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_RegisterFront); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 137, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_server, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 137, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_5 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
            if (likely(__pyx_t_5)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_5);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_6, function);
            }
          }
          if (__pyx_t_5) {
            __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 137, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          } else {
            __pyx_t_14 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 137, __pyx_L3_error)
          }
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_11);
            if (likely(__pyx_t_6)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
              __Pyx_INCREF(__pyx_t_6);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_11, function);
            }
          }
          if (!__pyx_t_6) {
            __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_11)) {
              PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_14};
              __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
              PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_14};
              __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            } else
            #endif
            {
              __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
              __Pyx_GIVEREF(__pyx_t_14);
              PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_14);
              __pyx_t_14 = 0;
              __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "ptp/TraderApi.pyx":134
 *         #pUserMdApi->RegisterFront(tcp://192.168.0.1:41213);
 *         #pUserMdApi->RegisterFront(tcp://192.168.0.2:41213);
 *         for server in self.trader_server:             # <<<<<<<<<<<<<<
 *           #server = "tcp://" + self.md_server + ":" + str(self.md_port)
 *           myEnv.logger.info("regist " + server)
 */
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "ptp/TraderApi.pyx":138
 *           myEnv.logger.info("regist " + server)
 *           self.RegisterFront(server.encode())
 *         logDes="step(RegisterFront) 3(of 4 step)"             # <<<<<<<<<<<<<<
 *         myEnv.logger.info(logDes)
 * 
 */
        __Pyx_INCREF(__pyx_kp_u_step_RegisterFront_3_of_4_step);
        __Pyx_DECREF_SET(__pyx_v_logDes, __pyx_kp_u_step_RegisterFront_3_of_4_step);

        /* "ptp/TraderApi.pyx":139
 *           self.RegisterFront(server.encode())
 *         logDes="step(RegisterFront) 3(of 4 step)"
 *         myEnv.logger.info(logDes)             # <<<<<<<<<<<<<<
 * 
 *         time.sleep(1)
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 139, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        if (!__pyx_t_11) {
          __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_logDes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 139, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_7);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_4)) {
            PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_v_logDes};
            __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 139, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_GOTREF(__pyx_t_7);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
            PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_v_logDes};
            __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 139, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_GOTREF(__pyx_t_7);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_11); __pyx_t_11 = NULL;
            __Pyx_INCREF(__pyx_v_logDes);
            __Pyx_GIVEREF(__pyx_v_logDes);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_logDes);
            __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 139, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "ptp/TraderApi.pyx":141
 *         myEnv.logger.info(logDes)
 * 
 *         time.sleep(1)             # <<<<<<<<<<<<<<
 * 
 *         self._api.Init()
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 141, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sleep); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 141, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "ptp/TraderApi.pyx":143
 *         time.sleep(1)
 * 
 *         self._api.Init()             # <<<<<<<<<<<<<<
 *         logDes="step(Infra_Init) 4(of 4 step)"
 *         myEnv.logger.info(logDes)
 */
        __pyx_v_self->_api->Init();

        /* "ptp/TraderApi.pyx":144
 * 
 *         self._api.Init()
 *         logDes="step(Infra_Init) 4(of 4 step)"             # <<<<<<<<<<<<<<
 *         myEnv.logger.info(logDes)
 *       else:
 */
        __Pyx_INCREF(__pyx_kp_u_step_Infra_Init_4_of_4_step);
        __Pyx_DECREF_SET(__pyx_v_logDes, __pyx_kp_u_step_Infra_Init_4_of_4_step);

        /* "ptp/TraderApi.pyx":145
 *         self._api.Init()
 *         logDes="step(Infra_Init) 4(of 4 step)"
 *         myEnv.logger.info(logDes)             # <<<<<<<<<<<<<<
 *       else:
 *         myEnv.logger.error("BaseEnv has not been inited")
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_logger); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 145, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        if (!__pyx_t_5) {
          __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_logDes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 145, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_7);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_4)) {
            PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_logDes};
            __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 145, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_GOTREF(__pyx_t_7);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
            PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_logDes};
            __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 145, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_GOTREF(__pyx_t_7);
          } else
          #endif
          {
            __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 145, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL;
            __Pyx_INCREF(__pyx_v_logDes);
            __Pyx_GIVEREF(__pyx_v_logDes);
            PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_logDes);
            __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 145, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "ptp/TraderApi.pyx":118
 * 
 *       bInit=-1
 *       if self._api is not NULL and self._spi  is not NULL:             # <<<<<<<<<<<<<<
 * 
 *         self._api.RegisterSpi(self._spi)
 */
        goto __pyx_L9;
      }

      /* "ptp/TraderApi.pyx":147
 *         myEnv.logger.info(logDes)
 *       else:
 *         myEnv.logger.error("BaseEnv has not been inited")             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName)
 */
      /*else*/ {
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 147, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 147, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_L9:;

      /* "ptp/TraderApi.pyx":149
 *         myEnv.logger.error("BaseEnv has not been inited")
 * 
 *       printString("TraderApicall_stack","call-<",funName)             # <<<<<<<<<<<<<<
 *       bInit=0
 *     except Exception as err:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[4] = {__pyx_t_11, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[4] = {__pyx_t_11, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (__pyx_t_11) {
          __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_11); __pyx_t_11 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_8, __pyx_v_funName);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":150
 * 
 *       printString("TraderApicall_stack","call-<",funName)
 *       bInit=0             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error("Tader.Init", exc_info=True)
 */
      __pyx_v_bInit = 0;

      /* "ptp/TraderApi.pyx":113
 * 
 *   def Init_Net(self):
 *     try:             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":151
 *       printString("TraderApicall_stack","call-<",funName)
 *       bInit=0
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error("Tader.Init", exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.Init_Net", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_5) < 0) __PYX_ERR(0, 151, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_v_err = __pyx_t_7;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":152
 *       bInit=0
 *     except Exception as err:
 *       myEnv.logger.error("Tader.Init", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return bInit
 */
        __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 152, __pyx_L19_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_logger); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 152, __pyx_L19_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_error); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 152, __pyx_L19_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 152, __pyx_L19_error)
        __Pyx_GOTREF(__pyx_t_14);
        if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 152, __pyx_L19_error)
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__6, __pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 152, __pyx_L19_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }

      /* "ptp/TraderApi.pyx":151
 *       printString("TraderApicall_stack","call-<",funName)
 *       bInit=0
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error("Tader.Init", exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L20;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L19_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_8 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L20:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":113
 * 
 *   def Init_Net(self):
 *     try:             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":154
 *       myEnv.logger.error("Tader.Init", exc_info=True)
 * 
 *     return bInit             # <<<<<<<<<<<<<<
 * 
 *   def Join(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_bInit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":112
 *     return bInit
 * 
 *   def Init_Net(self):             # <<<<<<<<<<<<<<
 *     try:
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.Init_Net", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_logDes);
  __Pyx_XDECREF(__pyx_v_server);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":156
 *     return bInit
 * 
 *   def Join(self):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_15Join(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_15Join = {"Join", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_15Join, METH_NOARGS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_15Join(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Join (wrapper)", 0);
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_14Join(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_14Join(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self) {
  PyObject *__pyx_v_funName = NULL;
  int __pyx_v_result;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  char const *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  __Pyx_RefNannySetupContext("Join", 0);

  /* "ptp/TraderApi.pyx":157
 * 
 *   def Join(self):
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *     printString("TraderApicall_stack","call->",funName)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getframe); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_co_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_funName = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":158
 *   def Join(self):
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)             # <<<<<<<<<<<<<<
 * 
 *     cdef int result
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
    __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_n_u_TraderApicall_stack);
    __Pyx_INCREF(__pyx_kp_u_call);
    __Pyx_GIVEREF(__pyx_kp_u_call);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_kp_u_call);
    __Pyx_INCREF(__pyx_v_funName);
    __Pyx_GIVEREF(__pyx_v_funName);
    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_5, __pyx_v_funName);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":161
 * 
 *     cdef int result
 *     try:             # <<<<<<<<<<<<<<
 *       if self._api is not NULL:
 *         with nogil:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":162
 *     cdef int result
 *     try:
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.Join()
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":163
 *     try:
 *       if self._api is not NULL:
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.Join()
 *         return result
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":164
 *       if self._api is not NULL:
 *         with nogil:
 *           result = self._api.Join()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
              __pyx_v_result = __pyx_v_self->_api->Join();
            }

            /* "ptp/TraderApi.pyx":163
 *     try:
 *       if self._api is not NULL:
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.Join()
 *         return result
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":165
 *         with nogil:
 *           result = self._api.Join()
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     except Exception as err:
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_r = __pyx_t_1;
        __pyx_t_1 = 0;
        goto __pyx_L7_try_return;

        /* "ptp/TraderApi.pyx":162
 *     cdef int result
 *     try:
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.Join()
 */
      }

      /* "ptp/TraderApi.pyx":161
 * 
 *     cdef int result
 *     try:             # <<<<<<<<<<<<<<
 *       if self._api is not NULL:
 *         with nogil:
 */
    }
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ptp/TraderApi.pyx":167
 *         return result
 * 
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         myEnv.logger.error("Join", exc_info=True)
 * 
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_5) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.Join", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 167, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_v_err = __pyx_t_4;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":168
 * 
 *     except Exception as err:
 *         myEnv.logger.error("Join", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     printString("TraderApicall_stack","call-<",funName)
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 168, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 168, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 168, __pyx_L18_error)
        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 168, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }

      /* "ptp/TraderApi.pyx":167
 *         return result
 * 
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         myEnv.logger.error("Join", exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_5 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          }
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":161
 * 
 *     cdef int result
 *     try:             # <<<<<<<<<<<<<<
 *       if self._api is not NULL:
 *         with nogil:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":170
 *         myEnv.logger.error("Join", exc_info=True)
 * 
 *     printString("TraderApicall_stack","call-<",funName)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = NULL;
  __pyx_t_12 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_12 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_11 = PyTuple_New(3+__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
    __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
    PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_12, __pyx_n_u_TraderApicall_stack);
    __Pyx_INCREF(__pyx_kp_u_call_2);
    __Pyx_GIVEREF(__pyx_kp_u_call_2);
    PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_12, __pyx_kp_u_call_2);
    __Pyx_INCREF(__pyx_v_funName);
    __Pyx_GIVEREF(__pyx_v_funName);
    PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_12, __pyx_v_funName);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ptp/TraderApi.pyx":156
 *     return bInit
 * 
 *   def Join(self):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.Join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":173
 * 
 * 
 *   def GetTradingDay(self):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_17GetTradingDay(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_17GetTradingDay = {"GetTradingDay", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_17GetTradingDay, METH_NOARGS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_17GetTradingDay(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetTradingDay (wrapper)", 0);
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_16GetTradingDay(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_16GetTradingDay(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self) {
  PyObject *__pyx_v_funName = NULL;
  const char *__pyx_v_result;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  const char *__pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("GetTradingDay", 0);

  /* "ptp/TraderApi.pyx":174
 * 
 *   def GetTradingDay(self):
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *     printString("TraderApicall_stack","call->",funName)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getframe); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_co_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_funName = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":175
 *   def GetTradingDay(self):
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)             # <<<<<<<<<<<<<<
 * 
 *     cdef const_char *result
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
    __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_n_u_TraderApicall_stack);
    __Pyx_INCREF(__pyx_kp_u_call);
    __Pyx_GIVEREF(__pyx_kp_u_call);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_kp_u_call);
    __Pyx_INCREF(__pyx_v_funName);
    __Pyx_GIVEREF(__pyx_v_funName);
    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_5, __pyx_v_funName);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":179
 *     cdef const_char *result
 * 
 *     try:             # <<<<<<<<<<<<<<
 *       if self._api is not NULL:
 *         with nogil:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":180
 * 
 *     try:
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.GetTradingDay()
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":181
 *     try:
 *       if self._api is not NULL:
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.GetTradingDay()
 *         return result
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":182
 *       if self._api is not NULL:
 *         with nogil:
 *           result = self._api.GetTradingDay()             # <<<<<<<<<<<<<<
 *         return result
 *     except Exception as err:
 */
              try {
                __pyx_t_10 = __pyx_v_self->_api->GetTradingDay();
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 182, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_10;
            }

            /* "ptp/TraderApi.pyx":181
 *     try:
 *       if self._api is not NULL:
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.GetTradingDay()
 *         return result
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":183
 *         with nogil:
 *           result = self._api.GetTradingDay()
 *         return result             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         myEnv.logger.error("GetTradingDay", exc_info=True)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_r = __pyx_t_1;
        __pyx_t_1 = 0;
        goto __pyx_L7_try_return;

        /* "ptp/TraderApi.pyx":180
 * 
 *     try:
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.GetTradingDay()
 */
      }

      /* "ptp/TraderApi.pyx":179
 *     cdef const_char *result
 * 
 *     try:             # <<<<<<<<<<<<<<
 *       if self._api is not NULL:
 *         with nogil:
 */
    }
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ptp/TraderApi.pyx":184
 *           result = self._api.GetTradingDay()
 *         return result
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         myEnv.logger.error("GetTradingDay", exc_info=True)
 * 
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_5) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.GetTradingDay", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 184, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_v_err = __pyx_t_4;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":185
 *         return result
 *     except Exception as err:
 *         myEnv.logger.error("GetTradingDay", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     printString("TraderApicall_stack","call-<",funName)
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 185, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 185, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 185, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 185, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":184
 *           result = self._api.GetTradingDay()
 *         return result
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         myEnv.logger.error("GetTradingDay", exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_5 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":179
 *     cdef const_char *result
 * 
 *     try:             # <<<<<<<<<<<<<<
 *       if self._api is not NULL:
 *         with nogil:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":187
 *         myEnv.logger.error("GetTradingDay", exc_info=True)
 * 
 *     printString("TraderApicall_stack","call-<",funName)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = NULL;
  __pyx_t_13 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_13 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_12 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
    __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
    PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_13, __pyx_n_u_TraderApicall_stack);
    __Pyx_INCREF(__pyx_kp_u_call_2);
    __Pyx_GIVEREF(__pyx_kp_u_call_2);
    PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_13, __pyx_kp_u_call_2);
    __Pyx_INCREF(__pyx_v_funName);
    __Pyx_GIVEREF(__pyx_v_funName);
    PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_13, __pyx_v_funName);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ptp/TraderApi.pyx":173
 * 
 * 
 *   def GetTradingDay(self):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.GetTradingDay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":191
 * 
 * 
 *   def RegisterFront(self, char *pszFrontAddress):             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName)
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_19RegisterFront(PyObject *__pyx_v_self, PyObject *__pyx_arg_pszFrontAddress); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_19RegisterFront = {"RegisterFront", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_19RegisterFront, METH_O, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_19RegisterFront(PyObject *__pyx_v_self, PyObject *__pyx_arg_pszFrontAddress) {
  char *__pyx_v_pszFrontAddress;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("RegisterFront (wrapper)", 0);
  assert(__pyx_arg_pszFrontAddress); {
    __pyx_v_pszFrontAddress = __Pyx_PyObject_AsWritableString(__pyx_arg_pszFrontAddress); if (unlikely((!__pyx_v_pszFrontAddress) && PyErr_Occurred())) __PYX_ERR(0, 191, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.RegisterFront", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_18RegisterFront(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), ((char *)__pyx_v_pszFrontAddress));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_18RegisterFront(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, char *__pyx_v_pszFrontAddress) {
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  char const *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  __Pyx_RefNannySetupContext("RegisterFront", 0);

  /* "ptp/TraderApi.pyx":192
 * 
 *   def RegisterFront(self, char *pszFrontAddress):
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getframe); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_co_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_funName = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":193
 *   def RegisterFront(self, char *pszFrontAddress):
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName)             # <<<<<<<<<<<<<<
 * 
 *       try:
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
    __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_n_u_TraderApicall_stack);
    __Pyx_INCREF(__pyx_kp_u_call);
    __Pyx_GIVEREF(__pyx_kp_u_call);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_kp_u_call);
    __Pyx_INCREF(__pyx_v_funName);
    __Pyx_GIVEREF(__pyx_v_funName);
    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_5, __pyx_v_funName);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":195
 *       printString("TraderApicall_stack","call->",funName)
 * 
 *       try:             # <<<<<<<<<<<<<<
 *         if self._api is not NULL:
 *           self._api.RegisterFront(pszFrontAddress)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":196
 * 
 *       try:
 *         if self._api is not NULL:             # <<<<<<<<<<<<<<
 *           self._api.RegisterFront(pszFrontAddress)
 *       except Exception as err:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":197
 *       try:
 *         if self._api is not NULL:
 *           self._api.RegisterFront(pszFrontAddress)             # <<<<<<<<<<<<<<
 *       except Exception as err:
 *         myEnv.logger.error("RegisterFront", exc_info=True)
 */
        try {
          __pyx_v_self->_api->RegisterFront(__pyx_v_pszFrontAddress);
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 197, __pyx_L3_error)
        }

        /* "ptp/TraderApi.pyx":196
 * 
 *       try:
 *         if self._api is not NULL:             # <<<<<<<<<<<<<<
 *           self._api.RegisterFront(pszFrontAddress)
 *       except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":195
 *       printString("TraderApicall_stack","call->",funName)
 * 
 *       try:             # <<<<<<<<<<<<<<
 *         if self._api is not NULL:
 *           self._api.RegisterFront(pszFrontAddress)
 */
    }
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ptp/TraderApi.pyx":198
 *         if self._api is not NULL:
 *           self._api.RegisterFront(pszFrontAddress)
 *       except Exception as err:             # <<<<<<<<<<<<<<
 *         myEnv.logger.error("RegisterFront", exc_info=True)
 * 
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_5) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.RegisterFront", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 198, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_v_err = __pyx_t_4;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":199
 *           self._api.RegisterFront(pszFrontAddress)
 *       except Exception as err:
 *         myEnv.logger.error("RegisterFront", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName)
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 199, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 199, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 199, __pyx_L15_error)
        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }

      /* "ptp/TraderApi.pyx":198
 *         if self._api is not NULL:
 *           self._api.RegisterFront(pszFrontAddress)
 *       except Exception as err:             # <<<<<<<<<<<<<<
 *         myEnv.logger.error("RegisterFront", exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_5 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          }
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":195
 *       printString("TraderApicall_stack","call->",funName)
 * 
 *       try:             # <<<<<<<<<<<<<<
 *         if self._api is not NULL:
 *           self._api.RegisterFront(pszFrontAddress)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":201
 *         myEnv.logger.error("RegisterFront", exc_info=True)
 * 
 *       printString("TraderApicall_stack","call-<",funName)             # <<<<<<<<<<<<<<
 * 
 *   def RegisterNameServer(self, char *pszNsAddress):
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = NULL;
  __pyx_t_12 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_12 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_11 = PyTuple_New(3+__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
    __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
    PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_12, __pyx_n_u_TraderApicall_stack);
    __Pyx_INCREF(__pyx_kp_u_call_2);
    __Pyx_GIVEREF(__pyx_kp_u_call_2);
    PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_12, __pyx_kp_u_call_2);
    __Pyx_INCREF(__pyx_v_funName);
    __Pyx_GIVEREF(__pyx_v_funName);
    PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_12, __pyx_v_funName);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ptp/TraderApi.pyx":191
 * 
 * 
 *   def RegisterFront(self, char *pszFrontAddress):             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.RegisterFront", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":203
 *       printString("TraderApicall_stack","call-<",funName)
 * 
 *   def RegisterNameServer(self, char *pszNsAddress):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_21RegisterNameServer(PyObject *__pyx_v_self, PyObject *__pyx_arg_pszNsAddress); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_21RegisterNameServer = {"RegisterNameServer", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_21RegisterNameServer, METH_O, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_21RegisterNameServer(PyObject *__pyx_v_self, PyObject *__pyx_arg_pszNsAddress) {
  char *__pyx_v_pszNsAddress;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("RegisterNameServer (wrapper)", 0);
  assert(__pyx_arg_pszNsAddress); {
    __pyx_v_pszNsAddress = __Pyx_PyObject_AsWritableString(__pyx_arg_pszNsAddress); if (unlikely((!__pyx_v_pszNsAddress) && PyErr_Occurred())) __PYX_ERR(0, 203, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.RegisterNameServer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_20RegisterNameServer(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), ((char *)__pyx_v_pszNsAddress));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_20RegisterNameServer(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, char *__pyx_v_pszNsAddress) {
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  char const *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  __Pyx_RefNannySetupContext("RegisterNameServer", 0);

  /* "ptp/TraderApi.pyx":204
 * 
 *   def RegisterNameServer(self, char *pszNsAddress):
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *     printString("TraderApicall_stack","call->",funName)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getframe); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_co_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_funName = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":205
 *   def RegisterNameServer(self, char *pszNsAddress):
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
    __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_n_u_TraderApicall_stack);
    __Pyx_INCREF(__pyx_kp_u_call);
    __Pyx_GIVEREF(__pyx_kp_u_call);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_kp_u_call);
    __Pyx_INCREF(__pyx_v_funName);
    __Pyx_GIVEREF(__pyx_v_funName);
    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_5, __pyx_v_funName);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":207
 *     printString("TraderApicall_stack","call->",funName)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *       if self._api is not NULL:
 *         self._api.RegisterNameServer(pszNsAddress)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":208
 * 
 *     try:
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         self._api.RegisterNameServer(pszNsAddress)
 *     except Exception as err:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":209
 *     try:
 *       if self._api is not NULL:
 *         self._api.RegisterNameServer(pszNsAddress)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error("RegisterNameServer", exc_info=True)
 */
        try {
          __pyx_v_self->_api->RegisterNameServer(__pyx_v_pszNsAddress);
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 209, __pyx_L3_error)
        }

        /* "ptp/TraderApi.pyx":208
 * 
 *     try:
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         self._api.RegisterNameServer(pszNsAddress)
 *     except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":207
 *     printString("TraderApicall_stack","call->",funName)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *       if self._api is not NULL:
 *         self._api.RegisterNameServer(pszNsAddress)
 */
    }
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ptp/TraderApi.pyx":210
 *       if self._api is not NULL:
 *         self._api.RegisterNameServer(pszNsAddress)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error("RegisterNameServer", exc_info=True)
 * 
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_5) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.RegisterNameServer", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 210, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_v_err = __pyx_t_4;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":211
 *         self._api.RegisterNameServer(pszNsAddress)
 *     except Exception as err:
 *       myEnv.logger.error("RegisterNameServer", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     printString("TraderApicall_stack","call-<",funName)
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 211, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 211, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 211, __pyx_L15_error)
        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 211, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }

      /* "ptp/TraderApi.pyx":210
 *       if self._api is not NULL:
 *         self._api.RegisterNameServer(pszNsAddress)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error("RegisterNameServer", exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_5 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          }
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":207
 *     printString("TraderApicall_stack","call->",funName)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *       if self._api is not NULL:
 *         self._api.RegisterNameServer(pszNsAddress)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":213
 *       myEnv.logger.error("RegisterNameServer", exc_info=True)
 * 
 *     printString("TraderApicall_stack","call-<",funName)             # <<<<<<<<<<<<<<
 * 
 *   def RegisterFensUserInfo(self, pFensUserInfo):
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = NULL;
  __pyx_t_12 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_12 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_11 = PyTuple_New(3+__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
    __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
    PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_12, __pyx_n_u_TraderApicall_stack);
    __Pyx_INCREF(__pyx_kp_u_call_2);
    __Pyx_GIVEREF(__pyx_kp_u_call_2);
    PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_12, __pyx_kp_u_call_2);
    __Pyx_INCREF(__pyx_v_funName);
    __Pyx_GIVEREF(__pyx_v_funName);
    PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_12, __pyx_v_funName);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ptp/TraderApi.pyx":203
 *       printString("TraderApicall_stack","call-<",funName)
 * 
 *   def RegisterNameServer(self, char *pszNsAddress):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.RegisterNameServer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":215
 *     printString("TraderApicall_stack","call-<",funName)
 * 
 *   def RegisterFensUserInfo(self, pFensUserInfo):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_23RegisterFensUserInfo(PyObject *__pyx_v_self, PyObject *__pyx_v_pFensUserInfo); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_23RegisterFensUserInfo = {"RegisterFensUserInfo", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_23RegisterFensUserInfo, METH_O, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_23RegisterFensUserInfo(PyObject *__pyx_v_self, PyObject *__pyx_v_pFensUserInfo) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("RegisterFensUserInfo (wrapper)", 0);
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_22RegisterFensUserInfo(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_pFensUserInfo));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_22RegisterFensUserInfo(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pFensUserInfo) {
  PyObject *__pyx_v_funName = NULL;
  size_t __pyx_v_address;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("RegisterFensUserInfo", 0);

  /* "ptp/TraderApi.pyx":216
 * 
 *   def RegisterFensUserInfo(self, pFensUserInfo):
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *     printString("TraderApicall_stack","call->",funName)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getframe); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_co_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_funName = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":217
 *   def RegisterFensUserInfo(self, pFensUserInfo):
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)             # <<<<<<<<<<<<<<
 * 
 *     cdef size_t address
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
    __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_n_u_TraderApicall_stack);
    __Pyx_INCREF(__pyx_kp_u_call);
    __Pyx_GIVEREF(__pyx_kp_u_call);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_kp_u_call);
    __Pyx_INCREF(__pyx_v_funName);
    __Pyx_GIVEREF(__pyx_v_funName);
    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_5, __pyx_v_funName);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":220
 * 
 *     cdef size_t address
 *     try:             # <<<<<<<<<<<<<<
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pFensUserInfo)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":221
 *     cdef size_t address
 *     try:
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pFensUserInfo)
 * 
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":222
 *     try:
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pFensUserInfo)             # <<<<<<<<<<<<<<
 * 
 *         self._api.RegisterFensUserInfo(<CThostFtdcFensUserInfoField *> address)
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_addressof); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_4) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pFensUserInfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_1);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pFensUserInfo};
            __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_1);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pFensUserInfo};
            __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_1);
          } else
          #endif
          {
            __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL;
            __Pyx_INCREF(__pyx_v_pFensUserInfo);
            __Pyx_GIVEREF(__pyx_v_pFensUserInfo);
            PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_pFensUserInfo);
            __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":224
 *         address = ctypes.addressof(pFensUserInfo)
 * 
 *         self._api.RegisterFensUserInfo(<CThostFtdcFensUserInfoField *> address)             # <<<<<<<<<<<<<<
 * 
 *     except Exception as err:
 */
        try {
          __pyx_v_self->_api->RegisterFensUserInfo(((struct CThostFtdcFensUserInfoField *)__pyx_v_address));
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 224, __pyx_L3_error)
        }

        /* "ptp/TraderApi.pyx":221
 *     cdef size_t address
 *     try:
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pFensUserInfo)
 * 
 */
      }

      /* "ptp/TraderApi.pyx":220
 * 
 *     cdef size_t address
 *     try:             # <<<<<<<<<<<<<<
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pFensUserInfo)
 */
    }
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ptp/TraderApi.pyx":226
 *         self._api.RegisterFensUserInfo(<CThostFtdcFensUserInfoField *> address)
 * 
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error("RegisterFensUserInfo", exc_info=True)
 * 
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_5) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.RegisterFensUserInfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 226, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_v_err = __pyx_t_3;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":227
 * 
 *     except Exception as err:
 *       myEnv.logger.error("RegisterFensUserInfo", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     printString("TraderApicall_stack","call-<",funName)
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 227, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 227, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 227, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__11, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 227, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":226
 *         self._api.RegisterFensUserInfo(<CThostFtdcFensUserInfoField *> address)
 * 
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error("RegisterFensUserInfo", exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_5 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":220
 * 
 *     cdef size_t address
 *     try:             # <<<<<<<<<<<<<<
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pFensUserInfo)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":229
 *       myEnv.logger.error("RegisterFensUserInfo", exc_info=True)
 * 
 *     printString("TraderApicall_stack","call-<",funName)             # <<<<<<<<<<<<<<
 * 
 *   def SubscribePrivateTopic(self, THOST_TE_RESUME_TYPE nResumeType):
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  __pyx_t_13 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_13 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_12 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
    __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
    PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_13, __pyx_n_u_TraderApicall_stack);
    __Pyx_INCREF(__pyx_kp_u_call_2);
    __Pyx_GIVEREF(__pyx_kp_u_call_2);
    PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_13, __pyx_kp_u_call_2);
    __Pyx_INCREF(__pyx_v_funName);
    __Pyx_GIVEREF(__pyx_v_funName);
    PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_13, __pyx_v_funName);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ptp/TraderApi.pyx":215
 *     printString("TraderApicall_stack","call-<",funName)
 * 
 *   def RegisterFensUserInfo(self, pFensUserInfo):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.RegisterFensUserInfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":231
 *     printString("TraderApicall_stack","call-<",funName)
 * 
 *   def SubscribePrivateTopic(self, THOST_TE_RESUME_TYPE nResumeType):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_25SubscribePrivateTopic(PyObject *__pyx_v_self, PyObject *__pyx_arg_nResumeType); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_25SubscribePrivateTopic = {"SubscribePrivateTopic", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_25SubscribePrivateTopic, METH_O, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_25SubscribePrivateTopic(PyObject *__pyx_v_self, PyObject *__pyx_arg_nResumeType) {
  enum THOST_TE_RESUME_TYPE __pyx_v_nResumeType;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SubscribePrivateTopic (wrapper)", 0);
  assert(__pyx_arg_nResumeType); {
    __pyx_v_nResumeType = ((enum THOST_TE_RESUME_TYPE)__Pyx_PyInt_As_enum__THOST_TE_RESUME_TYPE(__pyx_arg_nResumeType)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.SubscribePrivateTopic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_24SubscribePrivateTopic(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), ((enum THOST_TE_RESUME_TYPE)__pyx_v_nResumeType));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_24SubscribePrivateTopic(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, enum THOST_TE_RESUME_TYPE __pyx_v_nResumeType) {
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  char const *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  __Pyx_RefNannySetupContext("SubscribePrivateTopic", 0);

  /* "ptp/TraderApi.pyx":232
 * 
 *   def SubscribePrivateTopic(self, THOST_TE_RESUME_TYPE nResumeType):
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *     printString("TraderApicall_stack","call->",funName)
 *     try:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getframe); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_co_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_funName = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":233
 *   def SubscribePrivateTopic(self, THOST_TE_RESUME_TYPE nResumeType):
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)             # <<<<<<<<<<<<<<
 *     try:
 *       if self._api is not NULL:
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
    __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_n_u_TraderApicall_stack);
    __Pyx_INCREF(__pyx_kp_u_call);
    __Pyx_GIVEREF(__pyx_kp_u_call);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_kp_u_call);
    __Pyx_INCREF(__pyx_v_funName);
    __Pyx_GIVEREF(__pyx_v_funName);
    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_5, __pyx_v_funName);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":234
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 *     try:             # <<<<<<<<<<<<<<
 *       if self._api is not NULL:
 *         self._api.SubscribePrivateTopic(nResumeType)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":235
 *     printString("TraderApicall_stack","call->",funName)
 *     try:
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         self._api.SubscribePrivateTopic(nResumeType)
 *     except Exception as err:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":236
 *     try:
 *       if self._api is not NULL:
 *         self._api.SubscribePrivateTopic(nResumeType)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error("SubscribePrivateTopic", exc_info=True)
 */
        try {
          __pyx_v_self->_api->SubscribePrivateTopic(__pyx_v_nResumeType);
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 236, __pyx_L3_error)
        }

        /* "ptp/TraderApi.pyx":235
 *     printString("TraderApicall_stack","call->",funName)
 *     try:
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         self._api.SubscribePrivateTopic(nResumeType)
 *     except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":234
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 *     try:             # <<<<<<<<<<<<<<
 *       if self._api is not NULL:
 *         self._api.SubscribePrivateTopic(nResumeType)
 */
    }
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ptp/TraderApi.pyx":237
 *       if self._api is not NULL:
 *         self._api.SubscribePrivateTopic(nResumeType)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error("SubscribePrivateTopic", exc_info=True)
 *     printString("TraderApicall_stack","call-<",funName)
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_5) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.SubscribePrivateTopic", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 237, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_v_err = __pyx_t_4;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":238
 *         self._api.SubscribePrivateTopic(nResumeType)
 *     except Exception as err:
 *       myEnv.logger.error("SubscribePrivateTopic", exc_info=True)             # <<<<<<<<<<<<<<
 *     printString("TraderApicall_stack","call-<",funName)
 * 
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 238, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 238, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 238, __pyx_L15_error)
        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__12, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 238, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }

      /* "ptp/TraderApi.pyx":237
 *       if self._api is not NULL:
 *         self._api.SubscribePrivateTopic(nResumeType)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error("SubscribePrivateTopic", exc_info=True)
 *     printString("TraderApicall_stack","call-<",funName)
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_5 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          }
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":234
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 *     try:             # <<<<<<<<<<<<<<
 *       if self._api is not NULL:
 *         self._api.SubscribePrivateTopic(nResumeType)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":239
 *     except Exception as err:
 *       myEnv.logger.error("SubscribePrivateTopic", exc_info=True)
 *     printString("TraderApicall_stack","call-<",funName)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = NULL;
  __pyx_t_12 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_12 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_11 = PyTuple_New(3+__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
    __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
    PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_12, __pyx_n_u_TraderApicall_stack);
    __Pyx_INCREF(__pyx_kp_u_call_2);
    __Pyx_GIVEREF(__pyx_kp_u_call_2);
    PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_12, __pyx_kp_u_call_2);
    __Pyx_INCREF(__pyx_v_funName);
    __Pyx_GIVEREF(__pyx_v_funName);
    PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_12, __pyx_v_funName);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ptp/TraderApi.pyx":231
 *     printString("TraderApicall_stack","call-<",funName)
 * 
 *   def SubscribePrivateTopic(self, THOST_TE_RESUME_TYPE nResumeType):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.SubscribePrivateTopic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":249
 *   #        THOST_TERT_QUICK:
 *   #@remark Init
 *   def SubscribePublicTopic(self, THOST_TE_RESUME_TYPE nResumeType):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_27SubscribePublicTopic(PyObject *__pyx_v_self, PyObject *__pyx_arg_nResumeType); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_27SubscribePublicTopic = {"SubscribePublicTopic", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_27SubscribePublicTopic, METH_O, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_27SubscribePublicTopic(PyObject *__pyx_v_self, PyObject *__pyx_arg_nResumeType) {
  enum THOST_TE_RESUME_TYPE __pyx_v_nResumeType;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SubscribePublicTopic (wrapper)", 0);
  assert(__pyx_arg_nResumeType); {
    __pyx_v_nResumeType = ((enum THOST_TE_RESUME_TYPE)__Pyx_PyInt_As_enum__THOST_TE_RESUME_TYPE(__pyx_arg_nResumeType)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 249, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.SubscribePublicTopic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_26SubscribePublicTopic(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), ((enum THOST_TE_RESUME_TYPE)__pyx_v_nResumeType));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_26SubscribePublicTopic(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, enum THOST_TE_RESUME_TYPE __pyx_v_nResumeType) {
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  char const *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  __Pyx_RefNannySetupContext("SubscribePublicTopic", 0);

  /* "ptp/TraderApi.pyx":250
 *   #@remark Init
 *   def SubscribePublicTopic(self, THOST_TE_RESUME_TYPE nResumeType):
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *     printString("TraderApicall_stack","call->",funName)
 *     try:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getframe); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_co_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_funName = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":251
 *   def SubscribePublicTopic(self, THOST_TE_RESUME_TYPE nResumeType):
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)             # <<<<<<<<<<<<<<
 *     try:
 *       if self._api is not NULL:
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
    __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_n_u_TraderApicall_stack);
    __Pyx_INCREF(__pyx_kp_u_call);
    __Pyx_GIVEREF(__pyx_kp_u_call);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_kp_u_call);
    __Pyx_INCREF(__pyx_v_funName);
    __Pyx_GIVEREF(__pyx_v_funName);
    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_5, __pyx_v_funName);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":252
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 *     try:             # <<<<<<<<<<<<<<
 *       if self._api is not NULL:
 *         self._api.SubscribePublicTopic(nResumeType)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":253
 *     printString("TraderApicall_stack","call->",funName)
 *     try:
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         self._api.SubscribePublicTopic(nResumeType)
 *     except Exception as err:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":254
 *     try:
 *       if self._api is not NULL:
 *         self._api.SubscribePublicTopic(nResumeType)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error("SubscribePublicTopic", exc_info=True)
 */
        try {
          __pyx_v_self->_api->SubscribePublicTopic(__pyx_v_nResumeType);
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 254, __pyx_L3_error)
        }

        /* "ptp/TraderApi.pyx":253
 *     printString("TraderApicall_stack","call->",funName)
 *     try:
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         self._api.SubscribePublicTopic(nResumeType)
 *     except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":252
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 *     try:             # <<<<<<<<<<<<<<
 *       if self._api is not NULL:
 *         self._api.SubscribePublicTopic(nResumeType)
 */
    }
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ptp/TraderApi.pyx":255
 *       if self._api is not NULL:
 *         self._api.SubscribePublicTopic(nResumeType)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error("SubscribePublicTopic", exc_info=True)
 * 
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_5) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.SubscribePublicTopic", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 255, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_v_err = __pyx_t_4;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":256
 *         self._api.SubscribePublicTopic(nResumeType)
 *     except Exception as err:
 *       myEnv.logger.error("SubscribePublicTopic", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     printString("TraderApicall_stack","call-<",funName)
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 256, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 256, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 256, __pyx_L15_error)
        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__13, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 256, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }

      /* "ptp/TraderApi.pyx":255
 *       if self._api is not NULL:
 *         self._api.SubscribePublicTopic(nResumeType)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error("SubscribePublicTopic", exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_5 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          }
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":252
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 *     try:             # <<<<<<<<<<<<<<
 *       if self._api is not NULL:
 *         self._api.SubscribePublicTopic(nResumeType)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":258
 *       myEnv.logger.error("SubscribePublicTopic", exc_info=True)
 * 
 *     printString("TraderApicall_stack","call-<",funName)             # <<<<<<<<<<<<<<
 * 
 *   #
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = NULL;
  __pyx_t_12 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_12 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_11 = PyTuple_New(3+__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
    __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
    PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_12, __pyx_n_u_TraderApicall_stack);
    __Pyx_INCREF(__pyx_kp_u_call_2);
    __Pyx_GIVEREF(__pyx_kp_u_call_2);
    PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_12, __pyx_kp_u_call_2);
    __Pyx_INCREF(__pyx_v_funName);
    __Pyx_GIVEREF(__pyx_v_funName);
    PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_12, __pyx_v_funName);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ptp/TraderApi.pyx":249
 *   #        THOST_TERT_QUICK:
 *   #@remark Init
 *   def SubscribePublicTopic(self, THOST_TE_RESUME_TYPE nResumeType):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.SubscribePublicTopic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":261
 * 
 *   #
 *   def  ReqAuthenticate(self, pReqAuthenticateField, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_29ReqAuthenticate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_29ReqAuthenticate = {"ReqAuthenticate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_29ReqAuthenticate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_29ReqAuthenticate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pReqAuthenticateField = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqAuthenticate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pReqAuthenticateField,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pReqAuthenticateField)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqAuthenticate", 1, 2, 2, 1); __PYX_ERR(0, 261, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqAuthenticate") < 0)) __PYX_ERR(0, 261, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pReqAuthenticateField = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqAuthenticate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 261, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqAuthenticate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_28ReqAuthenticate(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pReqAuthenticateField, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_28ReqAuthenticate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pReqAuthenticateField, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqAuthenticate", 0);

  /* "ptp/TraderApi.pyx":263
 *   def  ReqAuthenticate(self, pReqAuthenticateField, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":264
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":265
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":266
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":267
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 267, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 267, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 267, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 267, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 267, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":268
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 268, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":271
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pReqAuthenticateField)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":272
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pReqAuthenticateField)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqAuthenticate(<CThostFtdcReqAuthenticateField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 272, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pReqAuthenticateField); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pReqAuthenticateField};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pReqAuthenticateField};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pReqAuthenticateField);
            __Pyx_GIVEREF(__pyx_v_pReqAuthenticateField);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pReqAuthenticateField);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":273
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pReqAuthenticateField)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqAuthenticate(<CThostFtdcReqAuthenticateField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":274
 *         address = ctypes.addressof(pReqAuthenticateField)
 *         with nogil:
 *           result = self._api.ReqAuthenticate(<CThostFtdcReqAuthenticateField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqAuthenticate(((struct CThostFtdcReqAuthenticateField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 274, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":273
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pReqAuthenticateField)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqAuthenticate(<CThostFtdcReqAuthenticateField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":271
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pReqAuthenticateField)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":276
 *           result = self._api.ReqAuthenticate(<CThostFtdcReqAuthenticateField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqAuthenticate', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 276, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":265
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":277
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqAuthenticate', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqAuthenticate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 277, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":278
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqAuthenticate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 278, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 278, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 278, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__14, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 278, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":277
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqAuthenticate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":265
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":280
 *       myEnv.logger.error('ReqAuthenticate', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":261
 * 
 *   #
 *   def  ReqAuthenticate(self, pReqAuthenticateField, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqAuthenticate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":284
 * 
 *   #
 *   def  ReqUserLogin(self, pReqUserLoginField, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_31ReqUserLogin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_31ReqUserLogin = {"ReqUserLogin", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_31ReqUserLogin, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_31ReqUserLogin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pReqUserLoginField = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqUserLogin (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pReqUserLoginField,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pReqUserLoginField)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqUserLogin", 1, 2, 2, 1); __PYX_ERR(0, 284, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqUserLogin") < 0)) __PYX_ERR(0, 284, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pReqUserLoginField = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 284, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqUserLogin", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 284, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqUserLogin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_30ReqUserLogin(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pReqUserLoginField, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_30ReqUserLogin(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pReqUserLoginField, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqUserLogin", 0);

  /* "ptp/TraderApi.pyx":286
 *   def  ReqUserLogin(self, pReqUserLoginField, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":287
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":288
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":289
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":290
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 290, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 290, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 290, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":291
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 291, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":294
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pReqUserLoginField)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":295
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pReqUserLoginField)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqUserLogin(<CThostFtdcReqUserLoginField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 295, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pReqUserLoginField); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pReqUserLoginField};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pReqUserLoginField};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 295, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pReqUserLoginField);
            __Pyx_GIVEREF(__pyx_v_pReqUserLoginField);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pReqUserLoginField);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 295, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":296
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pReqUserLoginField)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqUserLogin(<CThostFtdcReqUserLoginField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":297
 *         address = ctypes.addressof(pReqUserLoginField)
 *         with nogil:
 *           result = self._api.ReqUserLogin(<CThostFtdcReqUserLoginField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqUserLogin(((struct CThostFtdcReqUserLoginField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 297, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":296
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pReqUserLoginField)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqUserLogin(<CThostFtdcReqUserLoginField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":294
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pReqUserLoginField)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":299
 *           result = self._api.ReqUserLogin(<CThostFtdcReqUserLoginField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqUserLogin', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 299, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 299, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":288
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":300
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqUserLogin', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqUserLogin", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 300, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":301
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqUserLogin', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 301, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 301, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 301, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__15, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 301, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":300
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqUserLogin', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":288
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":303
 *       myEnv.logger.error('ReqUserLogin', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":284
 * 
 *   #
 *   def  ReqUserLogin(self, pReqUserLoginField, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqUserLogin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":307
 * 
 *   #
 *   def  ReqUserLogout(self, pUserLogout, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_33ReqUserLogout(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_33ReqUserLogout = {"ReqUserLogout", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_33ReqUserLogout, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_33ReqUserLogout(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pUserLogout = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqUserLogout (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pUserLogout,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pUserLogout)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqUserLogout", 1, 2, 2, 1); __PYX_ERR(0, 307, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqUserLogout") < 0)) __PYX_ERR(0, 307, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pUserLogout = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqUserLogout", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 307, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqUserLogout", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_32ReqUserLogout(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pUserLogout, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_32ReqUserLogout(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pUserLogout, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqUserLogout", 0);

  /* "ptp/TraderApi.pyx":309
 *   def  ReqUserLogout(self, pUserLogout, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":310
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":311
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":312
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 312, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":313
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 313, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 313, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 313, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":314
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 314, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":317
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pUserLogout)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":318
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pUserLogout)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqUserLogout(<CThostFtdcUserLogoutField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 318, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pUserLogout); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pUserLogout};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pUserLogout};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pUserLogout);
            __Pyx_GIVEREF(__pyx_v_pUserLogout);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pUserLogout);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":319
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pUserLogout)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqUserLogout(<CThostFtdcUserLogoutField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":320
 *         address = ctypes.addressof(pUserLogout)
 *         with nogil:
 *           result = self._api.ReqUserLogout(<CThostFtdcUserLogoutField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqUserLogout(((struct CThostFtdcUserLogoutField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 320, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":319
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pUserLogout)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqUserLogout(<CThostFtdcUserLogoutField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":317
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pUserLogout)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":322
 *           result = self._api.ReqUserLogout(<CThostFtdcUserLogoutField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqUserLogout', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 322, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 322, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":311
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":323
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqUserLogout', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqUserLogout", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 323, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":324
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqUserLogout', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 324, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 324, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 324, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 324, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 324, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__16, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 324, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":323
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqUserLogout', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":311
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":326
 *       myEnv.logger.error('ReqUserLogout', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":307
 * 
 *   #
 *   def  ReqUserLogout(self, pUserLogout, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqUserLogout", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":330
 * 
 *   #
 *   def  ReqUserPasswordUpdate(self, pUserPasswordUpdate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_35ReqUserPasswordUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_35ReqUserPasswordUpdate = {"ReqUserPasswordUpdate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_35ReqUserPasswordUpdate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_35ReqUserPasswordUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pUserPasswordUpdate = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqUserPasswordUpdate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pUserPasswordUpdate,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pUserPasswordUpdate)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqUserPasswordUpdate", 1, 2, 2, 1); __PYX_ERR(0, 330, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqUserPasswordUpdate") < 0)) __PYX_ERR(0, 330, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pUserPasswordUpdate = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqUserPasswordUpdate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 330, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqUserPasswordUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_34ReqUserPasswordUpdate(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pUserPasswordUpdate, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_34ReqUserPasswordUpdate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pUserPasswordUpdate, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqUserPasswordUpdate", 0);

  /* "ptp/TraderApi.pyx":332
 *   def  ReqUserPasswordUpdate(self, pUserPasswordUpdate, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":333
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":334
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":335
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 335, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":336
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 336, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 336, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 336, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":337
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":340
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pUserPasswordUpdate)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":341
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pUserPasswordUpdate)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqUserPasswordUpdate(<CThostFtdcUserPasswordUpdateField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 341, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pUserPasswordUpdate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pUserPasswordUpdate};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pUserPasswordUpdate};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 341, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pUserPasswordUpdate);
            __Pyx_GIVEREF(__pyx_v_pUserPasswordUpdate);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pUserPasswordUpdate);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 341, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":342
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pUserPasswordUpdate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqUserPasswordUpdate(<CThostFtdcUserPasswordUpdateField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":343
 *         address = ctypes.addressof(pUserPasswordUpdate)
 *         with nogil:
 *           result = self._api.ReqUserPasswordUpdate(<CThostFtdcUserPasswordUpdateField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqUserPasswordUpdate(((struct CThostFtdcUserPasswordUpdateField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 343, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":342
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pUserPasswordUpdate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqUserPasswordUpdate(<CThostFtdcUserPasswordUpdateField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":340
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pUserPasswordUpdate)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":345
 *           result = self._api.ReqUserPasswordUpdate(<CThostFtdcUserPasswordUpdateField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqUserPasswordUpdate', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 345, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 345, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 345, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 345, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 345, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":334
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":346
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqUserPasswordUpdate', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqUserPasswordUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 346, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":347
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqUserPasswordUpdate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 347, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 347, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 347, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 347, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 347, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__17, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 347, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":346
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqUserPasswordUpdate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":334
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":349
 *       myEnv.logger.error('ReqUserPasswordUpdate', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":330
 * 
 *   #
 *   def  ReqUserPasswordUpdate(self, pUserPasswordUpdate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqUserPasswordUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":353
 * 
 *   #
 *   def  ReqTradingAccountPasswordUpdate(self, pTradingAccountPasswordUpdate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_37ReqTradingAccountPasswordUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_37ReqTradingAccountPasswordUpdate = {"ReqTradingAccountPasswordUpdate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_37ReqTradingAccountPasswordUpdate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_37ReqTradingAccountPasswordUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pTradingAccountPasswordUpdate = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqTradingAccountPasswordUpdate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pTradingAccountPasswordUpdate,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pTradingAccountPasswordUpdate)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqTradingAccountPasswordUpdate", 1, 2, 2, 1); __PYX_ERR(0, 353, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqTradingAccountPasswordUpdate") < 0)) __PYX_ERR(0, 353, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pTradingAccountPasswordUpdate = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 353, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqTradingAccountPasswordUpdate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 353, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqTradingAccountPasswordUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_36ReqTradingAccountPasswordUpdate(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pTradingAccountPasswordUpdate, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_36ReqTradingAccountPasswordUpdate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pTradingAccountPasswordUpdate, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqTradingAccountPasswordUpdate", 0);

  /* "ptp/TraderApi.pyx":355
 *   def  ReqTradingAccountPasswordUpdate(self, pTradingAccountPasswordUpdate, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":356
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":357
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":358
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 358, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 358, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 358, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":359
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 359, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 359, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 359, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":360
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 360, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 360, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":363
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pTradingAccountPasswordUpdate)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":364
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pTradingAccountPasswordUpdate)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqTradingAccountPasswordUpdate(<CThostFtdcTradingAccountPasswordUpdateField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 364, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 364, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pTradingAccountPasswordUpdate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pTradingAccountPasswordUpdate};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pTradingAccountPasswordUpdate};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 364, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pTradingAccountPasswordUpdate);
            __Pyx_GIVEREF(__pyx_v_pTradingAccountPasswordUpdate);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pTradingAccountPasswordUpdate);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":365
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pTradingAccountPasswordUpdate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqTradingAccountPasswordUpdate(<CThostFtdcTradingAccountPasswordUpdateField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":366
 *         address = ctypes.addressof(pTradingAccountPasswordUpdate)
 *         with nogil:
 *           result = self._api.ReqTradingAccountPasswordUpdate(<CThostFtdcTradingAccountPasswordUpdateField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqTradingAccountPasswordUpdate(((struct CThostFtdcTradingAccountPasswordUpdateField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 366, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":365
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pTradingAccountPasswordUpdate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqTradingAccountPasswordUpdate(<CThostFtdcTradingAccountPasswordUpdateField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":363
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pTradingAccountPasswordUpdate)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":368
 *           result = self._api.ReqTradingAccountPasswordUpdate(<CThostFtdcTradingAccountPasswordUpdateField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqTradingAccountPasswordUpdate', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 368, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":357
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":369
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqTradingAccountPasswordUpdate', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqTradingAccountPasswordUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 369, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":370
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqTradingAccountPasswordUpdate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 370, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 370, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 370, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__18, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 370, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":369
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqTradingAccountPasswordUpdate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":357
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":372
 *       myEnv.logger.error('ReqTradingAccountPasswordUpdate', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":353
 * 
 *   #
 *   def  ReqTradingAccountPasswordUpdate(self, pTradingAccountPasswordUpdate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqTradingAccountPasswordUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":376
 * 
 *   #2
 *   def  ReqUserLogin2(self, pReqUserLogin, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_39ReqUserLogin2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_39ReqUserLogin2 = {"ReqUserLogin2", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_39ReqUserLogin2, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_39ReqUserLogin2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pReqUserLogin = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqUserLogin2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pReqUserLogin,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pReqUserLogin)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqUserLogin2", 1, 2, 2, 1); __PYX_ERR(0, 376, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqUserLogin2") < 0)) __PYX_ERR(0, 376, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pReqUserLogin = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 376, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqUserLogin2", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 376, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqUserLogin2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_38ReqUserLogin2(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pReqUserLogin, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_38ReqUserLogin2(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pReqUserLogin, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqUserLogin2", 0);

  /* "ptp/TraderApi.pyx":378
 *   def  ReqUserLogin2(self, pReqUserLogin, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":379
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":380
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":381
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 381, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":382
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 382, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 382, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 382, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 382, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":383
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 383, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":386
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pReqUserLogin)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":387
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pReqUserLogin)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqUserLogin2(<CThostFtdcReqUserLoginField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 387, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pReqUserLogin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pReqUserLogin};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pReqUserLogin};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 387, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pReqUserLogin);
            __Pyx_GIVEREF(__pyx_v_pReqUserLogin);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pReqUserLogin);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":388
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pReqUserLogin)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqUserLogin2(<CThostFtdcReqUserLoginField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":389
 *         address = ctypes.addressof(pReqUserLogin)
 *         with nogil:
 *           result = self._api.ReqUserLogin2(<CThostFtdcReqUserLoginField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqUserLogin2(((struct CThostFtdcReqUserLoginField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 389, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":388
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pReqUserLogin)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqUserLogin2(<CThostFtdcReqUserLoginField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":386
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pReqUserLogin)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":391
 *           result = self._api.ReqUserLogin2(<CThostFtdcReqUserLoginField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqUserLogin2', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 391, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 391, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":380
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":392
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqUserLogin2', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqUserLogin2", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 392, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":393
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqUserLogin2', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 393, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 393, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 393, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 393, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 393, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__19, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 393, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":392
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqUserLogin2', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":380
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":395
 *       myEnv.logger.error('ReqUserLogin2', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":376
 * 
 *   #2
 *   def  ReqUserLogin2(self, pReqUserLogin, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqUserLogin2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":399
 * 
 *   #2
 *   def  ReqUserPasswordUpdate2(self, pUserPasswordUpdate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_41ReqUserPasswordUpdate2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_41ReqUserPasswordUpdate2 = {"ReqUserPasswordUpdate2", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_41ReqUserPasswordUpdate2, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_41ReqUserPasswordUpdate2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pUserPasswordUpdate = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqUserPasswordUpdate2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pUserPasswordUpdate,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pUserPasswordUpdate)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqUserPasswordUpdate2", 1, 2, 2, 1); __PYX_ERR(0, 399, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqUserPasswordUpdate2") < 0)) __PYX_ERR(0, 399, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pUserPasswordUpdate = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 399, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqUserPasswordUpdate2", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 399, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqUserPasswordUpdate2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_40ReqUserPasswordUpdate2(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pUserPasswordUpdate, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_40ReqUserPasswordUpdate2(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pUserPasswordUpdate, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqUserPasswordUpdate2", 0);

  /* "ptp/TraderApi.pyx":401
 *   def  ReqUserPasswordUpdate2(self, pUserPasswordUpdate, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":402
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":403
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":404
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 404, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 404, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 404, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":405
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 405, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 405, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 405, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":406
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 406, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 406, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":409
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pUserPasswordUpdate)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":410
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pUserPasswordUpdate)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqUserPasswordUpdate2(<CThostFtdcUserPasswordUpdateField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 410, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 410, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pUserPasswordUpdate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 410, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pUserPasswordUpdate};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 410, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pUserPasswordUpdate};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 410, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 410, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pUserPasswordUpdate);
            __Pyx_GIVEREF(__pyx_v_pUserPasswordUpdate);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pUserPasswordUpdate);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 410, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":411
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pUserPasswordUpdate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqUserPasswordUpdate2(<CThostFtdcUserPasswordUpdateField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":412
 *         address = ctypes.addressof(pUserPasswordUpdate)
 *         with nogil:
 *           result = self._api.ReqUserPasswordUpdate2(<CThostFtdcUserPasswordUpdateField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqUserPasswordUpdate2(((struct CThostFtdcUserPasswordUpdateField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 412, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":411
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pUserPasswordUpdate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqUserPasswordUpdate2(<CThostFtdcUserPasswordUpdateField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":409
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pUserPasswordUpdate)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":414
 *           result = self._api.ReqUserPasswordUpdate2(<CThostFtdcUserPasswordUpdateField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqUserPasswordUpdate2', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 414, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 414, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":403
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":415
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqUserPasswordUpdate2', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqUserPasswordUpdate2", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 415, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":416
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqUserPasswordUpdate2', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 416, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 416, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 416, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 416, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 416, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__20, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 416, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":415
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqUserPasswordUpdate2', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":403
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":418
 *       myEnv.logger.error('ReqUserPasswordUpdate2', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":399
 * 
 *   #2
 *   def  ReqUserPasswordUpdate2(self, pUserPasswordUpdate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqUserPasswordUpdate2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":422
 * 
 *   #
 *   def  ReqOrderInsert(self, pInputOrder, int nRequestID, express="ctp", md_lastPrice=0):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_43ReqOrderInsert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_43ReqOrderInsert = {"ReqOrderInsert", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_43ReqOrderInsert, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_43ReqOrderInsert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pInputOrder = 0;
  int __pyx_v_nRequestID;
  CYTHON_UNUSED PyObject *__pyx_v_express = 0;
  CYTHON_UNUSED PyObject *__pyx_v_md_lastPrice = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqOrderInsert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pInputOrder,&__pyx_n_s_nRequestID,&__pyx_n_s_express,&__pyx_n_s_md_lastPrice,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)__pyx_n_u_ctp);
    values[3] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pInputOrder)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqOrderInsert", 0, 2, 4, 1); __PYX_ERR(0, 422, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_express);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_md_lastPrice);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqOrderInsert") < 0)) __PYX_ERR(0, 422, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_pInputOrder = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 422, __pyx_L3_error)
    __pyx_v_express = values[2];
    __pyx_v_md_lastPrice = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqOrderInsert", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 422, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqOrderInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_42ReqOrderInsert(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pInputOrder, __pyx_v_nRequestID, __pyx_v_express, __pyx_v_md_lastPrice);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_42ReqOrderInsert(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputOrder, int __pyx_v_nRequestID, CYTHON_UNUSED PyObject *__pyx_v_express, CYTHON_UNUSED PyObject *__pyx_v_md_lastPrice) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqOrderInsert", 0);

  /* "ptp/TraderApi.pyx":424
 *   def  ReqOrderInsert(self, pInputOrder, int nRequestID, express="ctp", md_lastPrice=0):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":425
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":426
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":427
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 427, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":428
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 428, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":429
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 429, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":432
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputOrder)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":433
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputOrder)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqOrderInsert(<CThostFtdcInputOrderField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 433, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 433, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pInputOrder); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 433, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputOrder};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 433, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputOrder};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 433, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 433, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pInputOrder);
            __Pyx_GIVEREF(__pyx_v_pInputOrder);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pInputOrder);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 433, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":434
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputOrder)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqOrderInsert(<CThostFtdcInputOrderField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":435
 *         address = ctypes.addressof(pInputOrder)
 *         with nogil:
 *           result = self._api.ReqOrderInsert(<CThostFtdcInputOrderField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqOrderInsert(((struct CThostFtdcInputOrderField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 435, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":434
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputOrder)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqOrderInsert(<CThostFtdcInputOrderField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":432
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputOrder)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":437
 *           result = self._api.ReqOrderInsert(<CThostFtdcInputOrderField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqOrderInsert', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 437, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 437, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":426
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":438
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqOrderInsert', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqOrderInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 438, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":439
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqOrderInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 439, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 439, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 439, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 439, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 439, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__21, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 439, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":438
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqOrderInsert', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":426
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":441
 *       myEnv.logger.error('ReqOrderInsert', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":422
 * 
 *   #
 *   def  ReqOrderInsert(self, pInputOrder, int nRequestID, express="ctp", md_lastPrice=0):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqOrderInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":445
 * 
 *   #
 *   def  ReqParkedOrderInsert(self, pParkedOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_45ReqParkedOrderInsert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_45ReqParkedOrderInsert = {"ReqParkedOrderInsert", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_45ReqParkedOrderInsert, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_45ReqParkedOrderInsert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pParkedOrder = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqParkedOrderInsert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pParkedOrder,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pParkedOrder)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqParkedOrderInsert", 1, 2, 2, 1); __PYX_ERR(0, 445, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqParkedOrderInsert") < 0)) __PYX_ERR(0, 445, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pParkedOrder = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 445, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqParkedOrderInsert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 445, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqParkedOrderInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_44ReqParkedOrderInsert(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pParkedOrder, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_44ReqParkedOrderInsert(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pParkedOrder, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqParkedOrderInsert", 0);

  /* "ptp/TraderApi.pyx":447
 *   def  ReqParkedOrderInsert(self, pParkedOrder, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":448
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":449
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":450
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 450, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":451
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 451, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 451, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 451, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 451, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 451, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":452
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 452, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 452, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":455
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pParkedOrder)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":456
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pParkedOrder)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqParkedOrderInsert(<CThostFtdcParkedOrderField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 456, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pParkedOrder); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 456, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pParkedOrder};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 456, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pParkedOrder};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 456, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 456, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pParkedOrder);
            __Pyx_GIVEREF(__pyx_v_pParkedOrder);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pParkedOrder);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 456, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":457
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pParkedOrder)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqParkedOrderInsert(<CThostFtdcParkedOrderField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":458
 *         address = ctypes.addressof(pParkedOrder)
 *         with nogil:
 *           result = self._api.ReqParkedOrderInsert(<CThostFtdcParkedOrderField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqParkedOrderInsert(((struct CThostFtdcParkedOrderField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 458, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":457
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pParkedOrder)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqParkedOrderInsert(<CThostFtdcParkedOrderField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":455
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pParkedOrder)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":460
 *           result = self._api.ReqParkedOrderInsert(<CThostFtdcParkedOrderField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqParkedOrderInsert', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 460, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 460, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 460, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 460, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 460, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":449
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":461
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqParkedOrderInsert', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqParkedOrderInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 461, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":462
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqParkedOrderInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 462, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 462, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 462, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__22, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 462, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":461
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqParkedOrderInsert', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":449
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":464
 *       myEnv.logger.error('ReqParkedOrderInsert', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":445
 * 
 *   #
 *   def  ReqParkedOrderInsert(self, pParkedOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqParkedOrderInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":468
 * 
 *   #
 *   def  ReqParkedOrderAction(self, pParkedOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_47ReqParkedOrderAction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_47ReqParkedOrderAction = {"ReqParkedOrderAction", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_47ReqParkedOrderAction, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_47ReqParkedOrderAction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pParkedOrderAction = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqParkedOrderAction (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pParkedOrderAction,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pParkedOrderAction)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqParkedOrderAction", 1, 2, 2, 1); __PYX_ERR(0, 468, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqParkedOrderAction") < 0)) __PYX_ERR(0, 468, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pParkedOrderAction = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 468, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqParkedOrderAction", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 468, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqParkedOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_46ReqParkedOrderAction(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pParkedOrderAction, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_46ReqParkedOrderAction(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pParkedOrderAction, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqParkedOrderAction", 0);

  /* "ptp/TraderApi.pyx":470
 *   def  ReqParkedOrderAction(self, pParkedOrderAction, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":471
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":472
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":473
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 473, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":474
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 474, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 474, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 474, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 474, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":475
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 475, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 475, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":478
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pParkedOrderAction)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":479
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pParkedOrderAction)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqParkedOrderAction(<CThostFtdcParkedOrderActionField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 479, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 479, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pParkedOrderAction); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pParkedOrderAction};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pParkedOrderAction};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 479, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pParkedOrderAction);
            __Pyx_GIVEREF(__pyx_v_pParkedOrderAction);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pParkedOrderAction);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":480
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pParkedOrderAction)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqParkedOrderAction(<CThostFtdcParkedOrderActionField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":481
 *         address = ctypes.addressof(pParkedOrderAction)
 *         with nogil:
 *           result = self._api.ReqParkedOrderAction(<CThostFtdcParkedOrderActionField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqParkedOrderAction(((struct CThostFtdcParkedOrderActionField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 481, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":480
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pParkedOrderAction)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqParkedOrderAction(<CThostFtdcParkedOrderActionField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":478
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pParkedOrderAction)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":483
 *           result = self._api.ReqParkedOrderAction(<CThostFtdcParkedOrderActionField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqParkedOrderAction', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 483, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 483, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":472
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":484
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqParkedOrderAction', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqParkedOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 484, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":485
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqParkedOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 485, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 485, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 485, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 485, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 485, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__23, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 485, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":484
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqParkedOrderAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":472
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":487
 *       myEnv.logger.error('ReqParkedOrderAction', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":468
 * 
 *   #
 *   def  ReqParkedOrderAction(self, pParkedOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqParkedOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":491
 * 
 *   #
 *   def  ReqOrderAction(self, pInputOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_49ReqOrderAction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_49ReqOrderAction = {"ReqOrderAction", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_49ReqOrderAction, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_49ReqOrderAction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pInputOrderAction = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqOrderAction (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pInputOrderAction,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pInputOrderAction)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqOrderAction", 1, 2, 2, 1); __PYX_ERR(0, 491, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqOrderAction") < 0)) __PYX_ERR(0, 491, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pInputOrderAction = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 491, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqOrderAction", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 491, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_48ReqOrderAction(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pInputOrderAction, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_48ReqOrderAction(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputOrderAction, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqOrderAction", 0);

  /* "ptp/TraderApi.pyx":493
 *   def  ReqOrderAction(self, pInputOrderAction, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":494
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":495
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":496
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":497
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 497, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 497, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 497, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 497, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 497, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":498
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 498, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 498, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 498, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 498, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 498, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":501
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputOrderAction)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":502
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputOrderAction)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqOrderAction(<CThostFtdcInputOrderActionField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 502, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 502, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pInputOrderAction); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputOrderAction};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputOrderAction};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pInputOrderAction);
            __Pyx_GIVEREF(__pyx_v_pInputOrderAction);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pInputOrderAction);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 502, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":503
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputOrderAction)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqOrderAction(<CThostFtdcInputOrderActionField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":504
 *         address = ctypes.addressof(pInputOrderAction)
 *         with nogil:
 *           result = self._api.ReqOrderAction(<CThostFtdcInputOrderActionField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqOrderAction(((struct CThostFtdcInputOrderActionField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 504, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":503
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputOrderAction)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqOrderAction(<CThostFtdcInputOrderActionField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":501
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputOrderAction)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":506
 *           result = self._api.ReqOrderAction(<CThostFtdcInputOrderActionField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqOrderAction', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 506, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 506, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 506, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 506, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 506, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":495
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":507
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqOrderAction', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 507, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":508
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 508, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 508, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 508, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__24, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 508, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":507
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqOrderAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":495
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":510
 *       myEnv.logger.error('ReqOrderAction', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":491
 * 
 *   #
 *   def  ReqOrderAction(self, pInputOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":514
 * 
 *   #
 *   def  ReqQueryMaxOrderVolume(self, pQueryMaxOrderVolume, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_51ReqQueryMaxOrderVolume(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_51ReqQueryMaxOrderVolume = {"ReqQueryMaxOrderVolume", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_51ReqQueryMaxOrderVolume, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_51ReqQueryMaxOrderVolume(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQueryMaxOrderVolume = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQueryMaxOrderVolume (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQueryMaxOrderVolume,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQueryMaxOrderVolume)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQueryMaxOrderVolume", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQueryMaxOrderVolume") < 0)) __PYX_ERR(0, 514, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQueryMaxOrderVolume = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQueryMaxOrderVolume", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQueryMaxOrderVolume", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_50ReqQueryMaxOrderVolume(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQueryMaxOrderVolume, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_50ReqQueryMaxOrderVolume(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQueryMaxOrderVolume, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQueryMaxOrderVolume", 0);

  /* "ptp/TraderApi.pyx":516
 *   def  ReqQueryMaxOrderVolume(self, pQueryMaxOrderVolume, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":517
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":518
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":519
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 519, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 519, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 519, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":520
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 520, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 520, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 520, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 520, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 520, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":521
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 521, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 521, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 521, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 521, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 521, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":523
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQueryMaxOrderVolume)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":524
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQueryMaxOrderVolume)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQueryMaxOrderVolume(<CThostFtdcQueryMaxOrderVolumeField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 524, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 524, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQueryMaxOrderVolume); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQueryMaxOrderVolume};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQueryMaxOrderVolume};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 524, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQueryMaxOrderVolume);
            __Pyx_GIVEREF(__pyx_v_pQueryMaxOrderVolume);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQueryMaxOrderVolume);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 524, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":525
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQueryMaxOrderVolume)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQueryMaxOrderVolume(<CThostFtdcQueryMaxOrderVolumeField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":526
 *         address = ctypes.addressof(pQueryMaxOrderVolume)
 *         with nogil:
 *           result = self._api.ReqQueryMaxOrderVolume(<CThostFtdcQueryMaxOrderVolumeField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQueryMaxOrderVolume(((struct CThostFtdcQueryMaxOrderVolumeField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 526, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":525
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQueryMaxOrderVolume)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQueryMaxOrderVolume(<CThostFtdcQueryMaxOrderVolumeField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":523
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQueryMaxOrderVolume)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":528
 *           result = self._api.ReqQueryMaxOrderVolume(<CThostFtdcQueryMaxOrderVolumeField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQueryMaxOrderVolume', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 528, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 528, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 528, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 528, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 528, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":518
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":529
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQueryMaxOrderVolume', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQueryMaxOrderVolume", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 529, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":530
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQueryMaxOrderVolume', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 530, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 530, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 530, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 530, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 530, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__25, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 530, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":529
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQueryMaxOrderVolume', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":518
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":532
 *       myEnv.logger.error('ReqQueryMaxOrderVolume', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":514
 * 
 *   #
 *   def  ReqQueryMaxOrderVolume(self, pQueryMaxOrderVolume, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQueryMaxOrderVolume", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":536
 * 
 *   #
 *   def  ReqSettlementInfoConfirm(self, pSettlementInfoConfirm, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_53ReqSettlementInfoConfirm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_53ReqSettlementInfoConfirm = {"ReqSettlementInfoConfirm", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_53ReqSettlementInfoConfirm, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_53ReqSettlementInfoConfirm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pSettlementInfoConfirm = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqSettlementInfoConfirm (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pSettlementInfoConfirm,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pSettlementInfoConfirm)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqSettlementInfoConfirm", 1, 2, 2, 1); __PYX_ERR(0, 536, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqSettlementInfoConfirm") < 0)) __PYX_ERR(0, 536, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pSettlementInfoConfirm = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 536, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqSettlementInfoConfirm", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 536, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqSettlementInfoConfirm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_52ReqSettlementInfoConfirm(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pSettlementInfoConfirm, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_52ReqSettlementInfoConfirm(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pSettlementInfoConfirm, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqSettlementInfoConfirm", 0);

  /* "ptp/TraderApi.pyx":538
 *   def  ReqSettlementInfoConfirm(self, pSettlementInfoConfirm, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":539
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":540
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":541
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":542
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 542, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 542, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 542, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 542, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":543
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 543, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 543, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":546
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pSettlementInfoConfirm)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":547
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pSettlementInfoConfirm)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqSettlementInfoConfirm(<CThostFtdcSettlementInfoConfirmField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 547, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 547, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pSettlementInfoConfirm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pSettlementInfoConfirm};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pSettlementInfoConfirm};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 547, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pSettlementInfoConfirm);
            __Pyx_GIVEREF(__pyx_v_pSettlementInfoConfirm);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pSettlementInfoConfirm);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":548
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pSettlementInfoConfirm)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqSettlementInfoConfirm(<CThostFtdcSettlementInfoConfirmField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":549
 *         address = ctypes.addressof(pSettlementInfoConfirm)
 *         with nogil:
 *           result = self._api.ReqSettlementInfoConfirm(<CThostFtdcSettlementInfoConfirmField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqSettlementInfoConfirm(((struct CThostFtdcSettlementInfoConfirmField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 549, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":548
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pSettlementInfoConfirm)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqSettlementInfoConfirm(<CThostFtdcSettlementInfoConfirmField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":546
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pSettlementInfoConfirm)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":551
 *           result = self._api.ReqSettlementInfoConfirm(<CThostFtdcSettlementInfoConfirmField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqSettlementInfoConfirm', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 551, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 551, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":540
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":552
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqSettlementInfoConfirm', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqSettlementInfoConfirm", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 552, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":553
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqSettlementInfoConfirm', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 553, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 553, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 553, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 553, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 553, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__26, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 553, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":552
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqSettlementInfoConfirm', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":540
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":555
 *       myEnv.logger.error('ReqSettlementInfoConfirm', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":536
 * 
 *   #
 *   def  ReqSettlementInfoConfirm(self, pSettlementInfoConfirm, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqSettlementInfoConfirm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":559
 * 
 *   #
 *   def  ReqRemoveParkedOrder(self, pRemoveParkedOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_55ReqRemoveParkedOrder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_55ReqRemoveParkedOrder = {"ReqRemoveParkedOrder", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_55ReqRemoveParkedOrder, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_55ReqRemoveParkedOrder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pRemoveParkedOrder = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqRemoveParkedOrder (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pRemoveParkedOrder,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pRemoveParkedOrder)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqRemoveParkedOrder", 1, 2, 2, 1); __PYX_ERR(0, 559, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqRemoveParkedOrder") < 0)) __PYX_ERR(0, 559, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pRemoveParkedOrder = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 559, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqRemoveParkedOrder", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 559, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqRemoveParkedOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_54ReqRemoveParkedOrder(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pRemoveParkedOrder, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_54ReqRemoveParkedOrder(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pRemoveParkedOrder, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqRemoveParkedOrder", 0);

  /* "ptp/TraderApi.pyx":561
 *   def  ReqRemoveParkedOrder(self, pRemoveParkedOrder, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":562
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":563
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":564
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 564, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 564, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":565
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 565, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 565, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 565, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 565, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 565, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 565, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 565, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 565, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 565, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 565, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":566
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 566, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 566, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 566, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 566, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 566, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":569
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pRemoveParkedOrder)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":570
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pRemoveParkedOrder)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqRemoveParkedOrder(<CThostFtdcRemoveParkedOrderField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 570, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 570, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pRemoveParkedOrder); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pRemoveParkedOrder};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pRemoveParkedOrder};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pRemoveParkedOrder);
            __Pyx_GIVEREF(__pyx_v_pRemoveParkedOrder);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pRemoveParkedOrder);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 570, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":571
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pRemoveParkedOrder)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqRemoveParkedOrder(<CThostFtdcRemoveParkedOrderField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":572
 *         address = ctypes.addressof(pRemoveParkedOrder)
 *         with nogil:
 *           result = self._api.ReqRemoveParkedOrder(<CThostFtdcRemoveParkedOrderField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqRemoveParkedOrder(((struct CThostFtdcRemoveParkedOrderField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 572, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":571
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pRemoveParkedOrder)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqRemoveParkedOrder(<CThostFtdcRemoveParkedOrderField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":569
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pRemoveParkedOrder)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":574
 *           result = self._api.ReqRemoveParkedOrder(<CThostFtdcRemoveParkedOrderField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqRemoveParkedOrder', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 574, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 574, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 574, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 574, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 574, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":563
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":575
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqRemoveParkedOrder', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqRemoveParkedOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 575, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":576
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqRemoveParkedOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 576, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 576, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 576, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 576, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 576, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__27, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 576, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":575
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqRemoveParkedOrder', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":563
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":578
 *       myEnv.logger.error('ReqRemoveParkedOrder', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":559
 * 
 *   #
 *   def  ReqRemoveParkedOrder(self, pRemoveParkedOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqRemoveParkedOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":582
 * 
 *   #
 *   def  ReqRemoveParkedOrderAction(self, pRemoveParkedOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_57ReqRemoveParkedOrderAction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_57ReqRemoveParkedOrderAction = {"ReqRemoveParkedOrderAction", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_57ReqRemoveParkedOrderAction, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_57ReqRemoveParkedOrderAction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pRemoveParkedOrderAction = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqRemoveParkedOrderAction (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pRemoveParkedOrderAction,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pRemoveParkedOrderAction)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqRemoveParkedOrderAction", 1, 2, 2, 1); __PYX_ERR(0, 582, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqRemoveParkedOrderAction") < 0)) __PYX_ERR(0, 582, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pRemoveParkedOrderAction = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqRemoveParkedOrderAction", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 582, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqRemoveParkedOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_56ReqRemoveParkedOrderAction(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pRemoveParkedOrderAction, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_56ReqRemoveParkedOrderAction(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pRemoveParkedOrderAction, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqRemoveParkedOrderAction", 0);

  /* "ptp/TraderApi.pyx":584
 *   def  ReqRemoveParkedOrderAction(self, pRemoveParkedOrderAction, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":585
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":586
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":587
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 587, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":588
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 588, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 588, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 588, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 588, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 588, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":589
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 589, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 589, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 589, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 589, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 589, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":592
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pRemoveParkedOrderAction)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":593
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pRemoveParkedOrderAction)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqRemoveParkedOrderAction(<CThostFtdcRemoveParkedOrderActionField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 593, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 593, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pRemoveParkedOrderAction); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pRemoveParkedOrderAction};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pRemoveParkedOrderAction};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 593, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pRemoveParkedOrderAction);
            __Pyx_GIVEREF(__pyx_v_pRemoveParkedOrderAction);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pRemoveParkedOrderAction);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 593, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":594
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pRemoveParkedOrderAction)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqRemoveParkedOrderAction(<CThostFtdcRemoveParkedOrderActionField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":595
 *         address = ctypes.addressof(pRemoveParkedOrderAction)
 *         with nogil:
 *           result = self._api.ReqRemoveParkedOrderAction(<CThostFtdcRemoveParkedOrderActionField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqRemoveParkedOrderAction(((struct CThostFtdcRemoveParkedOrderActionField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 595, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":594
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pRemoveParkedOrderAction)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqRemoveParkedOrderAction(<CThostFtdcRemoveParkedOrderActionField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":592
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pRemoveParkedOrderAction)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":597
 *           result = self._api.ReqRemoveParkedOrderAction(<CThostFtdcRemoveParkedOrderActionField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqRemoveParkedOrderAction', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 597, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 597, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 597, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 597, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":586
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":598
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqRemoveParkedOrderAction', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqRemoveParkedOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 598, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":599
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqRemoveParkedOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 599, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 599, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 599, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 599, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 599, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__28, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 599, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":598
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqRemoveParkedOrderAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":586
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":601
 *       myEnv.logger.error('ReqRemoveParkedOrderAction', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":582
 * 
 *   #
 *   def  ReqRemoveParkedOrderAction(self, pRemoveParkedOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqRemoveParkedOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":605
 * 
 *   #
 *   def  ReqExecOrderInsert(self, pInputExecOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_59ReqExecOrderInsert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_59ReqExecOrderInsert = {"ReqExecOrderInsert", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_59ReqExecOrderInsert, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_59ReqExecOrderInsert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pInputExecOrder = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqExecOrderInsert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pInputExecOrder,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pInputExecOrder)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqExecOrderInsert", 1, 2, 2, 1); __PYX_ERR(0, 605, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqExecOrderInsert") < 0)) __PYX_ERR(0, 605, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pInputExecOrder = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 605, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqExecOrderInsert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 605, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqExecOrderInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_58ReqExecOrderInsert(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pInputExecOrder, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_58ReqExecOrderInsert(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputExecOrder, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqExecOrderInsert", 0);

  /* "ptp/TraderApi.pyx":607
 *   def  ReqExecOrderInsert(self, pInputExecOrder, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":608
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":609
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":610
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 610, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 610, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 610, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":611
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 611, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 611, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 611, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 611, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 611, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 611, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 611, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 611, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 611, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 611, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":612
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 612, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 612, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":615
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputExecOrder)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":616
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputExecOrder)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqExecOrderInsert(<CThostFtdcInputExecOrderField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 616, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 616, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pInputExecOrder); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputExecOrder};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputExecOrder};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 616, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pInputExecOrder);
            __Pyx_GIVEREF(__pyx_v_pInputExecOrder);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pInputExecOrder);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 616, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":617
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputExecOrder)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqExecOrderInsert(<CThostFtdcInputExecOrderField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":618
 *         address = ctypes.addressof(pInputExecOrder)
 *         with nogil:
 *           result = self._api.ReqExecOrderInsert(<CThostFtdcInputExecOrderField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqExecOrderInsert(((struct CThostFtdcInputExecOrderField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 618, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":617
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputExecOrder)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqExecOrderInsert(<CThostFtdcInputExecOrderField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":615
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputExecOrder)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":620
 *           result = self._api.ReqExecOrderInsert(<CThostFtdcInputExecOrderField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqExecOrderInsert', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 620, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 620, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":609
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":621
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqExecOrderInsert', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqExecOrderInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 621, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":622
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqExecOrderInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 622, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 622, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 622, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 622, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 622, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__29, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 622, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":621
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqExecOrderInsert', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":609
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":624
 *       myEnv.logger.error('ReqExecOrderInsert', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":605
 * 
 *   #
 *   def  ReqExecOrderInsert(self, pInputExecOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqExecOrderInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":628
 * 
 *   #
 *   def  ReqExecOrderAction(self, pInputExecOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_61ReqExecOrderAction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_61ReqExecOrderAction = {"ReqExecOrderAction", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_61ReqExecOrderAction, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_61ReqExecOrderAction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pInputExecOrderAction = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqExecOrderAction (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pInputExecOrderAction,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pInputExecOrderAction)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqExecOrderAction", 1, 2, 2, 1); __PYX_ERR(0, 628, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqExecOrderAction") < 0)) __PYX_ERR(0, 628, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pInputExecOrderAction = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 628, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqExecOrderAction", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 628, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqExecOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_60ReqExecOrderAction(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pInputExecOrderAction, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_60ReqExecOrderAction(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputExecOrderAction, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqExecOrderAction", 0);

  /* "ptp/TraderApi.pyx":630
 *   def  ReqExecOrderAction(self, pInputExecOrderAction, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":631
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":632
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":633
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 633, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":634
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 634, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 634, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 634, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 634, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":635
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 635, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 635, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":638
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputExecOrderAction)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":639
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputExecOrderAction)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqExecOrderAction(<CThostFtdcInputExecOrderActionField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 639, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 639, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pInputExecOrderAction); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 639, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputExecOrderAction};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 639, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputExecOrderAction};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 639, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 639, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pInputExecOrderAction);
            __Pyx_GIVEREF(__pyx_v_pInputExecOrderAction);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pInputExecOrderAction);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 639, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 639, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":640
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputExecOrderAction)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqExecOrderAction(<CThostFtdcInputExecOrderActionField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":641
 *         address = ctypes.addressof(pInputExecOrderAction)
 *         with nogil:
 *           result = self._api.ReqExecOrderAction(<CThostFtdcInputExecOrderActionField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqExecOrderAction(((struct CThostFtdcInputExecOrderActionField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 641, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":640
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputExecOrderAction)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqExecOrderAction(<CThostFtdcInputExecOrderActionField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":638
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputExecOrderAction)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":643
 *           result = self._api.ReqExecOrderAction(<CThostFtdcInputExecOrderActionField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqExecOrderAction', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 643, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 643, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 643, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 643, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 643, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":632
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":644
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqExecOrderAction', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqExecOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 644, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":645
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqExecOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 645, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 645, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 645, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 645, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 645, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__30, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 645, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":644
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqExecOrderAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":632
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":647
 *       myEnv.logger.error('ReqExecOrderAction', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":628
 * 
 *   #
 *   def  ReqExecOrderAction(self, pInputExecOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqExecOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":651
 * 
 *   #
 *   def  ReqForQuoteInsert(self, pInputForQuote, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_63ReqForQuoteInsert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_63ReqForQuoteInsert = {"ReqForQuoteInsert", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_63ReqForQuoteInsert, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_63ReqForQuoteInsert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pInputForQuote = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqForQuoteInsert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pInputForQuote,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pInputForQuote)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqForQuoteInsert", 1, 2, 2, 1); __PYX_ERR(0, 651, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqForQuoteInsert") < 0)) __PYX_ERR(0, 651, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pInputForQuote = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 651, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqForQuoteInsert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 651, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqForQuoteInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_62ReqForQuoteInsert(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pInputForQuote, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_62ReqForQuoteInsert(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputForQuote, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqForQuoteInsert", 0);

  /* "ptp/TraderApi.pyx":653
 *   def  ReqForQuoteInsert(self, pInputForQuote, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":654
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":655
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":656
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 656, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 656, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 656, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":657
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 657, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 657, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 657, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 657, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 657, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":658
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 658, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 658, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 658, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 658, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 658, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":661
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputForQuote)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":662
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputForQuote)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqForQuoteInsert(<CThostFtdcInputForQuoteField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 662, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 662, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pInputForQuote); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 662, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputForQuote};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 662, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputForQuote};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 662, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 662, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pInputForQuote);
            __Pyx_GIVEREF(__pyx_v_pInputForQuote);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pInputForQuote);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 662, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 662, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":663
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputForQuote)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqForQuoteInsert(<CThostFtdcInputForQuoteField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":664
 *         address = ctypes.addressof(pInputForQuote)
 *         with nogil:
 *           result = self._api.ReqForQuoteInsert(<CThostFtdcInputForQuoteField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqForQuoteInsert(((struct CThostFtdcInputForQuoteField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 664, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":663
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputForQuote)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqForQuoteInsert(<CThostFtdcInputForQuoteField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":661
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputForQuote)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":666
 *           result = self._api.ReqForQuoteInsert(<CThostFtdcInputForQuoteField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqForQuoteInsert', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 666, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 666, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":655
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":667
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqForQuoteInsert', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqForQuoteInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 667, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":668
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqForQuoteInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 668, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 668, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 668, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 668, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 668, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__31, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 668, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":667
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqForQuoteInsert', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":655
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":670
 *       myEnv.logger.error('ReqForQuoteInsert', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":651
 * 
 *   #
 *   def  ReqForQuoteInsert(self, pInputForQuote, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqForQuoteInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":674
 * 
 *   #
 *   def  ReqQuoteInsert(self, pInputQuote, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_65ReqQuoteInsert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_65ReqQuoteInsert = {"ReqQuoteInsert", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_65ReqQuoteInsert, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_65ReqQuoteInsert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pInputQuote = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQuoteInsert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pInputQuote,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pInputQuote)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQuoteInsert", 1, 2, 2, 1); __PYX_ERR(0, 674, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQuoteInsert") < 0)) __PYX_ERR(0, 674, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pInputQuote = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 674, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQuoteInsert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 674, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQuoteInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_64ReqQuoteInsert(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pInputQuote, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_64ReqQuoteInsert(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputQuote, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQuoteInsert", 0);

  /* "ptp/TraderApi.pyx":676
 *   def  ReqQuoteInsert(self, pInputQuote, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":677
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":678
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":679
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 679, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":680
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 680, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 680, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 680, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 680, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":681
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 681, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 681, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 681, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 681, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 681, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":684
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputQuote)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":685
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputQuote)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQuoteInsert(<CThostFtdcInputQuoteField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 685, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pInputQuote); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputQuote};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputQuote};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 685, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pInputQuote);
            __Pyx_GIVEREF(__pyx_v_pInputQuote);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pInputQuote);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 685, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":686
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputQuote)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQuoteInsert(<CThostFtdcInputQuoteField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":687
 *         address = ctypes.addressof(pInputQuote)
 *         with nogil:
 *           result = self._api.ReqQuoteInsert(<CThostFtdcInputQuoteField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQuoteInsert(((struct CThostFtdcInputQuoteField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 687, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":686
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputQuote)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQuoteInsert(<CThostFtdcInputQuoteField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":684
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputQuote)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":689
 *           result = self._api.ReqQuoteInsert(<CThostFtdcInputQuoteField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQuoteInsert', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 689, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 689, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 689, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 689, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 689, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":678
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":690
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQuoteInsert', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQuoteInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 690, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":691
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQuoteInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 691, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 691, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 691, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 691, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 691, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__32, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 691, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":690
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQuoteInsert', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":678
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":693
 *       myEnv.logger.error('ReqQuoteInsert', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":674
 * 
 *   #
 *   def  ReqQuoteInsert(self, pInputQuote, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQuoteInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":697
 * 
 *   #
 *   def  ReqQuoteAction(self, pInputQuoteAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_67ReqQuoteAction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_67ReqQuoteAction = {"ReqQuoteAction", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_67ReqQuoteAction, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_67ReqQuoteAction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pInputQuoteAction = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQuoteAction (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pInputQuoteAction,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pInputQuoteAction)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQuoteAction", 1, 2, 2, 1); __PYX_ERR(0, 697, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQuoteAction") < 0)) __PYX_ERR(0, 697, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pInputQuoteAction = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 697, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQuoteAction", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 697, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQuoteAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_66ReqQuoteAction(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pInputQuoteAction, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_66ReqQuoteAction(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputQuoteAction, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQuoteAction", 0);

  /* "ptp/TraderApi.pyx":699
 *   def  ReqQuoteAction(self, pInputQuoteAction, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":700
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":701
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":702
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":703
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 703, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 703, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 703, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 703, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":704
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 704, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 704, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":707
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputQuoteAction)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":708
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputQuoteAction)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQuoteAction(<CThostFtdcInputQuoteActionField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 708, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 708, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pInputQuoteAction); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 708, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputQuoteAction};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 708, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputQuoteAction};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 708, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 708, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pInputQuoteAction);
            __Pyx_GIVEREF(__pyx_v_pInputQuoteAction);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pInputQuoteAction);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 708, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 708, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":709
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputQuoteAction)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQuoteAction(<CThostFtdcInputQuoteActionField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":710
 *         address = ctypes.addressof(pInputQuoteAction)
 *         with nogil:
 *           result = self._api.ReqQuoteAction(<CThostFtdcInputQuoteActionField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQuoteAction(((struct CThostFtdcInputQuoteActionField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 710, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":709
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputQuoteAction)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQuoteAction(<CThostFtdcInputQuoteActionField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":707
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputQuoteAction)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":712
 *           result = self._api.ReqQuoteAction(<CThostFtdcInputQuoteActionField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQuoteAction', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 712, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 712, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 712, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 712, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 712, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":701
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":713
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQuoteAction', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQuoteAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 713, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":714
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQuoteAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 714, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 714, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 714, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 714, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 714, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__33, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 714, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":713
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQuoteAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":701
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":716
 *       myEnv.logger.error('ReqQuoteAction', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":697
 * 
 *   #
 *   def  ReqQuoteAction(self, pInputQuoteAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQuoteAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":720
 * 
 *   #
 *   def  ReqBatchOrderAction(self, pInputBatchOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_69ReqBatchOrderAction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_69ReqBatchOrderAction = {"ReqBatchOrderAction", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_69ReqBatchOrderAction, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_69ReqBatchOrderAction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pInputBatchOrderAction = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqBatchOrderAction (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pInputBatchOrderAction,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pInputBatchOrderAction)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqBatchOrderAction", 1, 2, 2, 1); __PYX_ERR(0, 720, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqBatchOrderAction") < 0)) __PYX_ERR(0, 720, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pInputBatchOrderAction = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 720, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqBatchOrderAction", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 720, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqBatchOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_68ReqBatchOrderAction(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pInputBatchOrderAction, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_68ReqBatchOrderAction(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputBatchOrderAction, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqBatchOrderAction", 0);

  /* "ptp/TraderApi.pyx":722
 *   def  ReqBatchOrderAction(self, pInputBatchOrderAction, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":723
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":724
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":725
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 725, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":726
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 726, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 726, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 726, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 726, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 726, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 726, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 726, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 726, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 726, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 726, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":727
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 727, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 727, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 727, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 727, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 727, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":730
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputBatchOrderAction)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":731
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputBatchOrderAction)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqBatchOrderAction(<CThostFtdcInputBatchOrderActionField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 731, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 731, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pInputBatchOrderAction); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputBatchOrderAction};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputBatchOrderAction};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 731, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pInputBatchOrderAction);
            __Pyx_GIVEREF(__pyx_v_pInputBatchOrderAction);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pInputBatchOrderAction);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 731, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":732
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputBatchOrderAction)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqBatchOrderAction(<CThostFtdcInputBatchOrderActionField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":733
 *         address = ctypes.addressof(pInputBatchOrderAction)
 *         with nogil:
 *           result = self._api.ReqBatchOrderAction(<CThostFtdcInputBatchOrderActionField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqBatchOrderAction(((struct CThostFtdcInputBatchOrderActionField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 733, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":732
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputBatchOrderAction)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqBatchOrderAction(<CThostFtdcInputBatchOrderActionField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":730
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputBatchOrderAction)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":735
 *           result = self._api.ReqBatchOrderAction(<CThostFtdcInputBatchOrderActionField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqBatchOrderAction', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 735, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 735, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":724
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":736
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqBatchOrderAction', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqBatchOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 736, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":737
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqBatchOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 737, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 737, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 737, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 737, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 737, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__34, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 737, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":736
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqBatchOrderAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":724
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":739
 *       myEnv.logger.error('ReqBatchOrderAction', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":720
 * 
 *   #
 *   def  ReqBatchOrderAction(self, pInputBatchOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqBatchOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":743
 * 
 *   #
 *   def  ReqOptionSelfCloseInsert(self, pInputOptionSelfClose, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_71ReqOptionSelfCloseInsert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_71ReqOptionSelfCloseInsert = {"ReqOptionSelfCloseInsert", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_71ReqOptionSelfCloseInsert, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_71ReqOptionSelfCloseInsert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pInputOptionSelfClose = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqOptionSelfCloseInsert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pInputOptionSelfClose,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pInputOptionSelfClose)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqOptionSelfCloseInsert", 1, 2, 2, 1); __PYX_ERR(0, 743, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqOptionSelfCloseInsert") < 0)) __PYX_ERR(0, 743, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pInputOptionSelfClose = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 743, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqOptionSelfCloseInsert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 743, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqOptionSelfCloseInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_70ReqOptionSelfCloseInsert(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pInputOptionSelfClose, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_70ReqOptionSelfCloseInsert(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputOptionSelfClose, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqOptionSelfCloseInsert", 0);

  /* "ptp/TraderApi.pyx":745
 *   def  ReqOptionSelfCloseInsert(self, pInputOptionSelfClose, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":746
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":747
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":748
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 748, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 748, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":749
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 749, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 749, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 749, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 749, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 749, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 749, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 749, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 749, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 749, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 749, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":750
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 750, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 750, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 750, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 750, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 750, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":753
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputOptionSelfClose)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":754
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputOptionSelfClose)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqOptionSelfCloseInsert(<CThostFtdcInputOptionSelfCloseField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 754, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 754, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pInputOptionSelfClose); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 754, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputOptionSelfClose};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 754, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputOptionSelfClose};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 754, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 754, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pInputOptionSelfClose);
            __Pyx_GIVEREF(__pyx_v_pInputOptionSelfClose);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pInputOptionSelfClose);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 754, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 754, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":755
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputOptionSelfClose)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqOptionSelfCloseInsert(<CThostFtdcInputOptionSelfCloseField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":756
 *         address = ctypes.addressof(pInputOptionSelfClose)
 *         with nogil:
 *           result = self._api.ReqOptionSelfCloseInsert(<CThostFtdcInputOptionSelfCloseField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqOptionSelfCloseInsert(((struct CThostFtdcInputOptionSelfCloseField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 756, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":755
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputOptionSelfClose)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqOptionSelfCloseInsert(<CThostFtdcInputOptionSelfCloseField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":753
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputOptionSelfClose)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":758
 *           result = self._api.ReqOptionSelfCloseInsert(<CThostFtdcInputOptionSelfCloseField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqOptionSelfCloseInsert', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 758, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 758, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 758, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 758, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 758, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":747
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":759
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqOptionSelfCloseInsert', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqOptionSelfCloseInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 759, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":760
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqOptionSelfCloseInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 760, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 760, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 760, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 760, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 760, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__35, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 760, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":759
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqOptionSelfCloseInsert', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":747
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":762
 *       myEnv.logger.error('ReqOptionSelfCloseInsert', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":743
 * 
 *   #
 *   def  ReqOptionSelfCloseInsert(self, pInputOptionSelfClose, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqOptionSelfCloseInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":766
 * 
 *   #
 *   def  ReqOptionSelfCloseAction(self, pInputOptionSelfCloseAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_73ReqOptionSelfCloseAction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_73ReqOptionSelfCloseAction = {"ReqOptionSelfCloseAction", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_73ReqOptionSelfCloseAction, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_73ReqOptionSelfCloseAction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pInputOptionSelfCloseAction = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqOptionSelfCloseAction (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pInputOptionSelfCloseAction,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pInputOptionSelfCloseAction)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqOptionSelfCloseAction", 1, 2, 2, 1); __PYX_ERR(0, 766, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqOptionSelfCloseAction") < 0)) __PYX_ERR(0, 766, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pInputOptionSelfCloseAction = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 766, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqOptionSelfCloseAction", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 766, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqOptionSelfCloseAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_72ReqOptionSelfCloseAction(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pInputOptionSelfCloseAction, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_72ReqOptionSelfCloseAction(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputOptionSelfCloseAction, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqOptionSelfCloseAction", 0);

  /* "ptp/TraderApi.pyx":768
 *   def  ReqOptionSelfCloseAction(self, pInputOptionSelfCloseAction, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":769
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":770
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":771
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 771, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 771, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 771, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":772
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 772, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 772, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 772, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 772, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 772, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 772, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 772, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 772, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 772, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":773
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 773, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 773, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 773, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 773, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 773, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":776
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputOptionSelfCloseAction)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":777
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputOptionSelfCloseAction)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqOptionSelfCloseAction(<CThostFtdcInputOptionSelfCloseActionField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 777, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 777, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pInputOptionSelfCloseAction); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 777, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputOptionSelfCloseAction};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 777, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputOptionSelfCloseAction};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 777, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 777, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pInputOptionSelfCloseAction);
            __Pyx_GIVEREF(__pyx_v_pInputOptionSelfCloseAction);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pInputOptionSelfCloseAction);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 777, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 777, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":778
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputOptionSelfCloseAction)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqOptionSelfCloseAction(<CThostFtdcInputOptionSelfCloseActionField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":779
 *         address = ctypes.addressof(pInputOptionSelfCloseAction)
 *         with nogil:
 *           result = self._api.ReqOptionSelfCloseAction(<CThostFtdcInputOptionSelfCloseActionField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqOptionSelfCloseAction(((struct CThostFtdcInputOptionSelfCloseActionField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 779, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":778
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputOptionSelfCloseAction)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqOptionSelfCloseAction(<CThostFtdcInputOptionSelfCloseActionField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":776
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputOptionSelfCloseAction)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":781
 *           result = self._api.ReqOptionSelfCloseAction(<CThostFtdcInputOptionSelfCloseActionField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqOptionSelfCloseAction', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 781, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 781, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 781, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 781, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 781, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":770
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":782
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqOptionSelfCloseAction', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqOptionSelfCloseAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 782, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":783
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqOptionSelfCloseAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 783, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 783, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 783, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 783, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 783, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__36, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 783, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":782
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqOptionSelfCloseAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":770
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":785
 *       myEnv.logger.error('ReqOptionSelfCloseAction', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":766
 * 
 *   #
 *   def  ReqOptionSelfCloseAction(self, pInputOptionSelfCloseAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqOptionSelfCloseAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":789
 * 
 *   #
 *   def  ReqCombActionInsert(self, pInputCombAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_75ReqCombActionInsert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_75ReqCombActionInsert = {"ReqCombActionInsert", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_75ReqCombActionInsert, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_75ReqCombActionInsert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pInputCombAction = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqCombActionInsert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pInputCombAction,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pInputCombAction)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqCombActionInsert", 1, 2, 2, 1); __PYX_ERR(0, 789, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqCombActionInsert") < 0)) __PYX_ERR(0, 789, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pInputCombAction = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 789, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqCombActionInsert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 789, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqCombActionInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_74ReqCombActionInsert(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pInputCombAction, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_74ReqCombActionInsert(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pInputCombAction, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqCombActionInsert", 0);

  /* "ptp/TraderApi.pyx":791
 *   def  ReqCombActionInsert(self, pInputCombAction, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":792
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":793
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":794
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 794, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 794, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 794, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":795
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 795, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 795, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 795, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 795, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 795, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 795, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 795, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 795, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 795, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 795, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":796
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 796, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 796, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 796, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 796, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 796, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":799
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputCombAction)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":800
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputCombAction)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqCombActionInsert(<CThostFtdcInputCombActionField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 800, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 800, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pInputCombAction); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 800, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputCombAction};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 800, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pInputCombAction};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 800, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 800, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pInputCombAction);
            __Pyx_GIVEREF(__pyx_v_pInputCombAction);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pInputCombAction);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 800, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 800, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":801
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputCombAction)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqCombActionInsert(<CThostFtdcInputCombActionField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":802
 *         address = ctypes.addressof(pInputCombAction)
 *         with nogil:
 *           result = self._api.ReqCombActionInsert(<CThostFtdcInputCombActionField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqCombActionInsert(((struct CThostFtdcInputCombActionField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 802, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":801
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pInputCombAction)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqCombActionInsert(<CThostFtdcInputCombActionField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":799
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pInputCombAction)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":804
 *           result = self._api.ReqCombActionInsert(<CThostFtdcInputCombActionField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqCombActionInsert', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 804, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 804, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 804, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 804, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 804, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":793
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":805
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqCombActionInsert', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqCombActionInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 805, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":806
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqCombActionInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 806, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 806, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 806, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 806, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 806, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__37, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 806, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":805
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqCombActionInsert', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":793
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":808
 *       myEnv.logger.error('ReqCombActionInsert', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":789
 * 
 *   #
 *   def  ReqCombActionInsert(self, pInputCombAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqCombActionInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":812
 * 
 *   #
 *   def  ReqQryOrder(self, pQryOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_77ReqQryOrder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_77ReqQryOrder = {"ReqQryOrder", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_77ReqQryOrder, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_77ReqQryOrder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryOrder = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryOrder (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryOrder,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryOrder)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryOrder", 1, 2, 2, 1); __PYX_ERR(0, 812, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryOrder") < 0)) __PYX_ERR(0, 812, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryOrder = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 812, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryOrder", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 812, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_76ReqQryOrder(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryOrder, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_76ReqQryOrder(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryOrder, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryOrder", 0);

  /* "ptp/TraderApi.pyx":814
 *   def  ReqQryOrder(self, pQryOrder, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":815
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":816
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":817
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 817, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":818
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 818, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 818, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 818, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 818, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":819
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 819, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 819, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 819, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 819, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 819, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":821
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryOrder)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":822
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryOrder)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryOrder(<CThostFtdcQryOrderField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 822, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 822, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryOrder); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 822, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryOrder};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 822, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryOrder};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 822, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 822, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryOrder);
            __Pyx_GIVEREF(__pyx_v_pQryOrder);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryOrder);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 822, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 822, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":823
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryOrder)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryOrder(<CThostFtdcQryOrderField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":824
 *         address = ctypes.addressof(pQryOrder)
 *         with nogil:
 *           result = self._api.ReqQryOrder(<CThostFtdcQryOrderField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryOrder(((struct CThostFtdcQryOrderField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 824, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":823
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryOrder)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryOrder(<CThostFtdcQryOrderField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":821
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryOrder)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":826
 *           result = self._api.ReqQryOrder(<CThostFtdcQryOrderField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryOrder', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 826, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 826, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":816
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":827
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryOrder', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 827, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":828
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 828, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 828, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 828, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 828, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 828, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__38, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 828, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":827
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryOrder', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":816
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":830
 *       myEnv.logger.error('ReqQryOrder', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":812
 * 
 *   #
 *   def  ReqQryOrder(self, pQryOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":834
 * 
 *   #
 *   def  ReqQryTrade(self, pQryTrade, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_79ReqQryTrade(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_79ReqQryTrade = {"ReqQryTrade", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_79ReqQryTrade, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_79ReqQryTrade(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryTrade = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryTrade (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryTrade,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryTrade)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryTrade", 1, 2, 2, 1); __PYX_ERR(0, 834, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryTrade") < 0)) __PYX_ERR(0, 834, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryTrade = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 834, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryTrade", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 834, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryTrade", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_78ReqQryTrade(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryTrade, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_78ReqQryTrade(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryTrade, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryTrade", 0);

  /* "ptp/TraderApi.pyx":836
 *   def  ReqQryTrade(self, pQryTrade, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":837
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":838
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":839
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 839, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 839, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 839, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":840
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 840, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 840, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 840, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 840, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 840, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":841
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 841, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 841, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 841, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 841, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 841, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":843
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryTrade)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":844
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryTrade)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryTrade(<CThostFtdcQryTradeField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 844, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 844, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryTrade); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryTrade};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryTrade};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 844, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryTrade);
            __Pyx_GIVEREF(__pyx_v_pQryTrade);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryTrade);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 844, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":845
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryTrade)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryTrade(<CThostFtdcQryTradeField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":846
 *         address = ctypes.addressof(pQryTrade)
 *         with nogil:
 *           result = self._api.ReqQryTrade(<CThostFtdcQryTradeField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryTrade(((struct CThostFtdcQryTradeField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 846, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":845
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryTrade)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryTrade(<CThostFtdcQryTradeField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":843
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryTrade)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":848
 *           result = self._api.ReqQryTrade(<CThostFtdcQryTradeField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryTrade', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 848, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 848, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":838
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":849
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryTrade', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryTrade", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 849, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":850
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryTrade', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 850, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 850, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 850, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 850, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 850, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__39, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 850, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":849
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryTrade', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":838
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":852
 *       myEnv.logger.error('ReqQryTrade', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":834
 * 
 *   #
 *   def  ReqQryTrade(self, pQryTrade, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryTrade", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":856
 * 
 *   #
 *   def  ReqQryInvestorPosition(self, pQryInvestorPosition, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_81ReqQryInvestorPosition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_81ReqQryInvestorPosition = {"ReqQryInvestorPosition", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_81ReqQryInvestorPosition, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_81ReqQryInvestorPosition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryInvestorPosition = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryInvestorPosition (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryInvestorPosition,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryInvestorPosition)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryInvestorPosition", 1, 2, 2, 1); __PYX_ERR(0, 856, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryInvestorPosition") < 0)) __PYX_ERR(0, 856, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryInvestorPosition = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 856, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryInvestorPosition", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 856, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInvestorPosition", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_80ReqQryInvestorPosition(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryInvestorPosition, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_80ReqQryInvestorPosition(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryInvestorPosition, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryInvestorPosition", 0);

  /* "ptp/TraderApi.pyx":858
 *   def  ReqQryInvestorPosition(self, pQryInvestorPosition, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":859
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":860
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":861
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 861, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 861, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 861, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":862
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 862, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 862, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 862, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 862, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 862, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":863
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 863, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 863, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 863, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 863, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 863, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":865
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryInvestorPosition)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":866
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInvestorPosition)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryInvestorPosition(<CThostFtdcQryInvestorPositionField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 866, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 866, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryInvestorPosition); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 866, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryInvestorPosition};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 866, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryInvestorPosition};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 866, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 866, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryInvestorPosition);
            __Pyx_GIVEREF(__pyx_v_pQryInvestorPosition);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryInvestorPosition);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 866, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 866, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":867
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInvestorPosition)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryInvestorPosition(<CThostFtdcQryInvestorPositionField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":868
 *         address = ctypes.addressof(pQryInvestorPosition)
 *         with nogil:
 *           result = self._api.ReqQryInvestorPosition(<CThostFtdcQryInvestorPositionField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryInvestorPosition(((struct CThostFtdcQryInvestorPositionField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 868, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":867
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInvestorPosition)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryInvestorPosition(<CThostFtdcQryInvestorPositionField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":865
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryInvestorPosition)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":870
 *           result = self._api.ReqQryInvestorPosition(<CThostFtdcQryInvestorPositionField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInvestorPosition', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 870, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 870, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":860
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":871
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryInvestorPosition', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInvestorPosition", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 871, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":872
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInvestorPosition', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 872, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 872, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 872, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 872, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 872, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__40, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 872, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":871
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryInvestorPosition', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":860
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":874
 *       myEnv.logger.error('ReqQryInvestorPosition', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":856
 * 
 *   #
 *   def  ReqQryInvestorPosition(self, pQryInvestorPosition, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInvestorPosition", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":878
 * 
 *   #
 *   def  ReqQryTradingAccount(self, pQryTradingAccount, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_83ReqQryTradingAccount(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_83ReqQryTradingAccount = {"ReqQryTradingAccount", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_83ReqQryTradingAccount, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_83ReqQryTradingAccount(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryTradingAccount = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryTradingAccount (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryTradingAccount,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryTradingAccount)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryTradingAccount", 1, 2, 2, 1); __PYX_ERR(0, 878, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryTradingAccount") < 0)) __PYX_ERR(0, 878, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryTradingAccount = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 878, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryTradingAccount", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 878, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryTradingAccount", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_82ReqQryTradingAccount(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryTradingAccount, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_82ReqQryTradingAccount(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryTradingAccount, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryTradingAccount", 0);

  /* "ptp/TraderApi.pyx":880
 *   def  ReqQryTradingAccount(self, pQryTradingAccount, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":881
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":882
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":883
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 883, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 883, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 883, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":884
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 884, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 884, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 884, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 884, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 884, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 884, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 884, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 884, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 884, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 884, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":885
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 885, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 885, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 885, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 885, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 885, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":887
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryTradingAccount)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":888
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryTradingAccount)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryTradingAccount(<CThostFtdcQryTradingAccountField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 888, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 888, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryTradingAccount); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryTradingAccount};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryTradingAccount};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 888, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryTradingAccount);
            __Pyx_GIVEREF(__pyx_v_pQryTradingAccount);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryTradingAccount);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 888, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":889
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryTradingAccount)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryTradingAccount(<CThostFtdcQryTradingAccountField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":890
 *         address = ctypes.addressof(pQryTradingAccount)
 *         with nogil:
 *           result = self._api.ReqQryTradingAccount(<CThostFtdcQryTradingAccountField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryTradingAccount(((struct CThostFtdcQryTradingAccountField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 890, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":889
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryTradingAccount)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryTradingAccount(<CThostFtdcQryTradingAccountField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":887
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryTradingAccount)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":892
 *           result = self._api.ReqQryTradingAccount(<CThostFtdcQryTradingAccountField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryTradingAccount', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 892, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 892, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":882
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":893
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryTradingAccount', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryTradingAccount", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 893, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":894
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryTradingAccount', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 894, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 894, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 894, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 894, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 894, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__41, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 894, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":893
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryTradingAccount', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":882
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":896
 *       myEnv.logger.error('ReqQryTradingAccount', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":878
 * 
 *   #
 *   def  ReqQryTradingAccount(self, pQryTradingAccount, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryTradingAccount", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":900
 * 
 *   #
 *   def  ReqQryInvestor(self, pQryInvestor, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_85ReqQryInvestor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_85ReqQryInvestor = {"ReqQryInvestor", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_85ReqQryInvestor, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_85ReqQryInvestor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryInvestor = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryInvestor (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryInvestor,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryInvestor)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryInvestor", 1, 2, 2, 1); __PYX_ERR(0, 900, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryInvestor") < 0)) __PYX_ERR(0, 900, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryInvestor = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 900, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryInvestor", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 900, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInvestor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_84ReqQryInvestor(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryInvestor, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_84ReqQryInvestor(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryInvestor, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryInvestor", 0);

  /* "ptp/TraderApi.pyx":902
 *   def  ReqQryInvestor(self, pQryInvestor, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":903
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":904
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":905
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 905, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 905, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 905, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":906
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 906, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 906, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 906, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 906, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 906, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 906, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 906, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 906, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 906, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 906, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":907
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 907, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 907, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 907, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 907, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 907, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":909
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryInvestor)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":910
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInvestor)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryInvestor(<CThostFtdcQryInvestorField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 910, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 910, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryInvestor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 910, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryInvestor};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 910, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryInvestor};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 910, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 910, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryInvestor);
            __Pyx_GIVEREF(__pyx_v_pQryInvestor);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryInvestor);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 910, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 910, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":911
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInvestor)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryInvestor(<CThostFtdcQryInvestorField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":912
 *         address = ctypes.addressof(pQryInvestor)
 *         with nogil:
 *           result = self._api.ReqQryInvestor(<CThostFtdcQryInvestorField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryInvestor(((struct CThostFtdcQryInvestorField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 912, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":911
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInvestor)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryInvestor(<CThostFtdcQryInvestorField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":909
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryInvestor)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":914
 *           result = self._api.ReqQryInvestor(<CThostFtdcQryInvestorField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInvestor', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 914, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 914, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 914, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 914, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 914, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":904
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":915
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryInvestor', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInvestor", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 915, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":916
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInvestor', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 916, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 916, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 916, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 916, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 916, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__42, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 916, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":915
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryInvestor', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":904
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":918
 *       myEnv.logger.error('ReqQryInvestor', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":900
 * 
 *   #
 *   def  ReqQryInvestor(self, pQryInvestor, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInvestor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":922
 * 
 *   #
 *   def  ReqQryTradingCode(self, pQryTradingCode, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_87ReqQryTradingCode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_87ReqQryTradingCode = {"ReqQryTradingCode", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_87ReqQryTradingCode, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_87ReqQryTradingCode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryTradingCode = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryTradingCode (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryTradingCode,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryTradingCode)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryTradingCode", 1, 2, 2, 1); __PYX_ERR(0, 922, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryTradingCode") < 0)) __PYX_ERR(0, 922, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryTradingCode = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 922, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryTradingCode", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 922, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryTradingCode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_86ReqQryTradingCode(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryTradingCode, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_86ReqQryTradingCode(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryTradingCode, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryTradingCode", 0);

  /* "ptp/TraderApi.pyx":924
 *   def  ReqQryTradingCode(self, pQryTradingCode, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":925
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":926
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":927
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 927, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 927, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 927, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":928
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 928, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 928, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 928, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 928, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 928, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":929
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 929, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 929, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 929, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 929, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 929, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":931
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryTradingCode)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":932
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryTradingCode)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryTradingCode(<CThostFtdcQryTradingCodeField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 932, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 932, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryTradingCode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 932, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryTradingCode};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 932, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryTradingCode};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 932, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 932, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryTradingCode);
            __Pyx_GIVEREF(__pyx_v_pQryTradingCode);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryTradingCode);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 932, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 932, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":933
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryTradingCode)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryTradingCode(<CThostFtdcQryTradingCodeField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":934
 *         address = ctypes.addressof(pQryTradingCode)
 *         with nogil:
 *           result = self._api.ReqQryTradingCode(<CThostFtdcQryTradingCodeField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryTradingCode(((struct CThostFtdcQryTradingCodeField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 934, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":933
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryTradingCode)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryTradingCode(<CThostFtdcQryTradingCodeField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":931
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryTradingCode)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":936
 *           result = self._api.ReqQryTradingCode(<CThostFtdcQryTradingCodeField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryTradingCode', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 936, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 936, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 936, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 936, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 936, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":926
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":937
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryTradingCode', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryTradingCode", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 937, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":938
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryTradingCode', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 938, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 938, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 938, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 938, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 938, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__43, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 938, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":937
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryTradingCode', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":926
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":940
 *       myEnv.logger.error('ReqQryTradingCode', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":922
 * 
 *   #
 *   def  ReqQryTradingCode(self, pQryTradingCode, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryTradingCode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":944
 * 
 *   #
 *   def  ReqQryInstrumentMarginRate(self, pQryInstrumentMarginRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_89ReqQryInstrumentMarginRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_89ReqQryInstrumentMarginRate = {"ReqQryInstrumentMarginRate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_89ReqQryInstrumentMarginRate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_89ReqQryInstrumentMarginRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryInstrumentMarginRate = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryInstrumentMarginRate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryInstrumentMarginRate,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryInstrumentMarginRate)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryInstrumentMarginRate", 1, 2, 2, 1); __PYX_ERR(0, 944, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryInstrumentMarginRate") < 0)) __PYX_ERR(0, 944, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryInstrumentMarginRate = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 944, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryInstrumentMarginRate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 944, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInstrumentMarginRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_88ReqQryInstrumentMarginRate(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryInstrumentMarginRate, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_88ReqQryInstrumentMarginRate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryInstrumentMarginRate, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryInstrumentMarginRate", 0);

  /* "ptp/TraderApi.pyx":946
 *   def  ReqQryInstrumentMarginRate(self, pQryInstrumentMarginRate, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":947
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":948
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":949
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 949, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 949, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 949, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":950
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 950, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 950, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 950, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 950, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 950, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 950, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 950, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 950, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 950, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 950, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":951
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 951, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 951, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 951, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 951, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 951, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":953
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryInstrumentMarginRate)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":954
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInstrumentMarginRate)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryInstrumentMarginRate(<CThostFtdcQryInstrumentMarginRateField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 954, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 954, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryInstrumentMarginRate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 954, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryInstrumentMarginRate};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 954, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryInstrumentMarginRate};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 954, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 954, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryInstrumentMarginRate);
            __Pyx_GIVEREF(__pyx_v_pQryInstrumentMarginRate);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryInstrumentMarginRate);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 954, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 954, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":955
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInstrumentMarginRate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryInstrumentMarginRate(<CThostFtdcQryInstrumentMarginRateField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":956
 *         address = ctypes.addressof(pQryInstrumentMarginRate)
 *         with nogil:
 *           result = self._api.ReqQryInstrumentMarginRate(<CThostFtdcQryInstrumentMarginRateField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryInstrumentMarginRate(((struct CThostFtdcQryInstrumentMarginRateField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 956, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":955
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInstrumentMarginRate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryInstrumentMarginRate(<CThostFtdcQryInstrumentMarginRateField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":953
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryInstrumentMarginRate)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":958
 *           result = self._api.ReqQryInstrumentMarginRate(<CThostFtdcQryInstrumentMarginRateField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInstrumentMarginRate', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 958, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 958, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 958, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 958, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 958, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":948
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":959
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryInstrumentMarginRate', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInstrumentMarginRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 959, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":960
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInstrumentMarginRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 960, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 960, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 960, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 960, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 960, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__44, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 960, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":959
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryInstrumentMarginRate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":948
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":962
 *       myEnv.logger.error('ReqQryInstrumentMarginRate', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":944
 * 
 *   #
 *   def  ReqQryInstrumentMarginRate(self, pQryInstrumentMarginRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInstrumentMarginRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":966
 * 
 *   #
 *   def  ReqQryInstrumentCommissionRate(self, pQryInstrumentCommissionRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_91ReqQryInstrumentCommissionRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_91ReqQryInstrumentCommissionRate = {"ReqQryInstrumentCommissionRate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_91ReqQryInstrumentCommissionRate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_91ReqQryInstrumentCommissionRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryInstrumentCommissionRate = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryInstrumentCommissionRate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryInstrumentCommissionRate,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryInstrumentCommissionRate)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryInstrumentCommissionRate", 1, 2, 2, 1); __PYX_ERR(0, 966, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryInstrumentCommissionRate") < 0)) __PYX_ERR(0, 966, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryInstrumentCommissionRate = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 966, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryInstrumentCommissionRate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 966, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInstrumentCommissionRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_90ReqQryInstrumentCommissionRate(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryInstrumentCommissionRate, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_90ReqQryInstrumentCommissionRate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryInstrumentCommissionRate, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryInstrumentCommissionRate", 0);

  /* "ptp/TraderApi.pyx":968
 *   def  ReqQryInstrumentCommissionRate(self, pQryInstrumentCommissionRate, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":969
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":970
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":971
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 971, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 971, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 971, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":972
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 972, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 972, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 972, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 972, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 972, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 972, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 972, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 972, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 972, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 972, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":973
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 973, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 973, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 973, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 973, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 973, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":975
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryInstrumentCommissionRate)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":976
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInstrumentCommissionRate)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryInstrumentCommissionRate(<CThostFtdcQryInstrumentCommissionRateField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 976, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 976, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryInstrumentCommissionRate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryInstrumentCommissionRate};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryInstrumentCommissionRate};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 976, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryInstrumentCommissionRate);
            __Pyx_GIVEREF(__pyx_v_pQryInstrumentCommissionRate);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryInstrumentCommissionRate);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 976, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":977
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInstrumentCommissionRate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryInstrumentCommissionRate(<CThostFtdcQryInstrumentCommissionRateField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":978
 *         address = ctypes.addressof(pQryInstrumentCommissionRate)
 *         with nogil:
 *           result = self._api.ReqQryInstrumentCommissionRate(<CThostFtdcQryInstrumentCommissionRateField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryInstrumentCommissionRate(((struct CThostFtdcQryInstrumentCommissionRateField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 978, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":977
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInstrumentCommissionRate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryInstrumentCommissionRate(<CThostFtdcQryInstrumentCommissionRateField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":975
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryInstrumentCommissionRate)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":980
 *           result = self._api.ReqQryInstrumentCommissionRate(<CThostFtdcQryInstrumentCommissionRateField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInstrumentCommissionRate', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 980, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 980, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 980, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 980, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 980, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":970
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":981
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryInstrumentCommissionRate', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInstrumentCommissionRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 981, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":982
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInstrumentCommissionRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 982, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 982, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 982, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 982, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 982, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__45, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 982, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":981
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryInstrumentCommissionRate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":970
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":984
 *       myEnv.logger.error('ReqQryInstrumentCommissionRate', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":966
 * 
 *   #
 *   def  ReqQryInstrumentCommissionRate(self, pQryInstrumentCommissionRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInstrumentCommissionRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":988
 * 
 *   #
 *   def  ReqQryExchange(self, pQryExchange, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_93ReqQryExchange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_93ReqQryExchange = {"ReqQryExchange", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_93ReqQryExchange, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_93ReqQryExchange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryExchange = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryExchange (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryExchange,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryExchange)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryExchange", 1, 2, 2, 1); __PYX_ERR(0, 988, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryExchange") < 0)) __PYX_ERR(0, 988, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryExchange = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 988, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryExchange", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 988, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryExchange", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_92ReqQryExchange(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryExchange, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_92ReqQryExchange(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryExchange, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryExchange", 0);

  /* "ptp/TraderApi.pyx":990
 *   def  ReqQryExchange(self, pQryExchange, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":991
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":992
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":993
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 993, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 993, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 993, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":994
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 994, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 994, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 994, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 994, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 994, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 994, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 994, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 994, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 994, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 994, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":995
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 995, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 995, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 995, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 995, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 995, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":997
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryExchange)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":998
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryExchange)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryExchange(<CThostFtdcQryExchangeField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 998, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 998, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryExchange); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 998, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryExchange};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 998, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryExchange};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 998, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 998, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryExchange);
            __Pyx_GIVEREF(__pyx_v_pQryExchange);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryExchange);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 998, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 998, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":999
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryExchange)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryExchange(<CThostFtdcQryExchangeField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1000
 *         address = ctypes.addressof(pQryExchange)
 *         with nogil:
 *           result = self._api.ReqQryExchange(<CThostFtdcQryExchangeField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryExchange(((struct CThostFtdcQryExchangeField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1000, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":999
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryExchange)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryExchange(<CThostFtdcQryExchangeField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":997
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryExchange)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1002
 *           result = self._api.ReqQryExchange(<CThostFtdcQryExchangeField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryExchange', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1002, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1002, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1002, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1002, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1002, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":992
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1003
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryExchange', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryExchange", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1003, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1004
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryExchange', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1004, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1004, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1004, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1004, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1004, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__46, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1004, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1003
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryExchange', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":992
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1006
 *       myEnv.logger.error('ReqQryExchange', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":988
 * 
 *   #
 *   def  ReqQryExchange(self, pQryExchange, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryExchange", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1010
 * 
 *   #
 *   def  ReqQryProduct(self, pQryProduct, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_95ReqQryProduct(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_95ReqQryProduct = {"ReqQryProduct", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_95ReqQryProduct, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_95ReqQryProduct(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryProduct = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryProduct (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryProduct,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryProduct)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryProduct", 1, 2, 2, 1); __PYX_ERR(0, 1010, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryProduct") < 0)) __PYX_ERR(0, 1010, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryProduct = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1010, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryProduct", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1010, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryProduct", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_94ReqQryProduct(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryProduct, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_94ReqQryProduct(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryProduct, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryProduct", 0);

  /* "ptp/TraderApi.pyx":1012
 *   def  ReqQryProduct(self, pQryProduct, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1013
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1014
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1015
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1015, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1015, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1015, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1016
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1016, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1016, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1016, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1016, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1016, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1016, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1016, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1016, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1016, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1016, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1017
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1017, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1017, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1017, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1017, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1017, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1019
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryProduct)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1020
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryProduct)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryProduct(<CThostFtdcQryProductField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1020, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1020, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryProduct); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1020, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryProduct};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1020, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryProduct};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1020, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1020, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryProduct);
            __Pyx_GIVEREF(__pyx_v_pQryProduct);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryProduct);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1020, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1020, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1021
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryProduct)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryProduct(<CThostFtdcQryProductField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1022
 *         address = ctypes.addressof(pQryProduct)
 *         with nogil:
 *           result = self._api.ReqQryProduct(<CThostFtdcQryProductField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryProduct(((struct CThostFtdcQryProductField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1022, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1021
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryProduct)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryProduct(<CThostFtdcQryProductField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1019
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryProduct)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1024
 *           result = self._api.ReqQryProduct(<CThostFtdcQryProductField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryProduct', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1024, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1024, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1024, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1024, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1024, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1014
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1025
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryProduct', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryProduct", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1025, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1026
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryProduct', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1026, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1026, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1026, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1026, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1026, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__47, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1026, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1025
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryProduct', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1014
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1028
 *       myEnv.logger.error('ReqQryProduct', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1010
 * 
 *   #
 *   def  ReqQryProduct(self, pQryProduct, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryProduct", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1032
 * 
 *   #
 *   def  ReqQryInstrument(self, pQryInstrument, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_97ReqQryInstrument(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_97ReqQryInstrument = {"ReqQryInstrument", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_97ReqQryInstrument, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_97ReqQryInstrument(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryInstrument = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryInstrument (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryInstrument,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryInstrument)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryInstrument", 1, 2, 2, 1); __PYX_ERR(0, 1032, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryInstrument") < 0)) __PYX_ERR(0, 1032, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryInstrument = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1032, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryInstrument", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1032, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInstrument", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_96ReqQryInstrument(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryInstrument, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_96ReqQryInstrument(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryInstrument, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryInstrument", 0);

  /* "ptp/TraderApi.pyx":1034
 *   def  ReqQryInstrument(self, pQryInstrument, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1035
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1036
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1037
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1037, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1038
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1038, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1038, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1038, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1038, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1038, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1038, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1038, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1038, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1038, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1038, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1039
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1039, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1039, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1039, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1039, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1041
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryInstrument)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1042
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInstrument)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryInstrument(<CThostFtdcQryInstrumentField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1042, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1042, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryInstrument); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1042, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryInstrument};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1042, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryInstrument};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1042, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1042, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryInstrument);
            __Pyx_GIVEREF(__pyx_v_pQryInstrument);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryInstrument);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1042, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1042, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1043
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInstrument)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryInstrument(<CThostFtdcQryInstrumentField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1044
 *         address = ctypes.addressof(pQryInstrument)
 *         with nogil:
 *           result = self._api.ReqQryInstrument(<CThostFtdcQryInstrumentField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryInstrument(((struct CThostFtdcQryInstrumentField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1044, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1043
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInstrument)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryInstrument(<CThostFtdcQryInstrumentField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1041
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryInstrument)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1046
 *           result = self._api.ReqQryInstrument(<CThostFtdcQryInstrumentField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInstrument', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1046, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1046, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1046, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1046, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1046, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1036
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1047
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryInstrument', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInstrument", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1047, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1048
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInstrument', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1048, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1048, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1048, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1048, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1048, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__48, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1048, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1047
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryInstrument', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1036
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1050
 *       myEnv.logger.error('ReqQryInstrument', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1032
 * 
 *   #
 *   def  ReqQryInstrument(self, pQryInstrument, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInstrument", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1054
 * 
 *   #
 *   def  ReqQryDepthMarketData(self, pQryDepthMarketData, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_99ReqQryDepthMarketData(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_99ReqQryDepthMarketData = {"ReqQryDepthMarketData", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_99ReqQryDepthMarketData, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_99ReqQryDepthMarketData(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryDepthMarketData = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryDepthMarketData (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryDepthMarketData,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryDepthMarketData)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryDepthMarketData", 1, 2, 2, 1); __PYX_ERR(0, 1054, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryDepthMarketData") < 0)) __PYX_ERR(0, 1054, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryDepthMarketData = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1054, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryDepthMarketData", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1054, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryDepthMarketData", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_98ReqQryDepthMarketData(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryDepthMarketData, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_98ReqQryDepthMarketData(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryDepthMarketData, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryDepthMarketData", 0);

  /* "ptp/TraderApi.pyx":1056
 *   def  ReqQryDepthMarketData(self, pQryDepthMarketData, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1057
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1058
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1059
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1059, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1059, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1059, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1060
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1060, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1060, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1060, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1060, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1060, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1060, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1060, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1060, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1060, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1060, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1061
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1061, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1061, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1061, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1061, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1061, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1063
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryDepthMarketData)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1064
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryDepthMarketData)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryDepthMarketData(<CThostFtdcQryDepthMarketDataField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1064, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1064, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryDepthMarketData); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1064, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryDepthMarketData};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1064, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryDepthMarketData};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1064, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1064, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryDepthMarketData);
            __Pyx_GIVEREF(__pyx_v_pQryDepthMarketData);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryDepthMarketData);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1064, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1064, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1065
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryDepthMarketData)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryDepthMarketData(<CThostFtdcQryDepthMarketDataField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1066
 *         address = ctypes.addressof(pQryDepthMarketData)
 *         with nogil:
 *           result = self._api.ReqQryDepthMarketData(<CThostFtdcQryDepthMarketDataField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryDepthMarketData(((struct CThostFtdcQryDepthMarketDataField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1066, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1065
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryDepthMarketData)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryDepthMarketData(<CThostFtdcQryDepthMarketDataField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1063
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryDepthMarketData)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1068
 *           result = self._api.ReqQryDepthMarketData(<CThostFtdcQryDepthMarketDataField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryDepthMarketData', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1068, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1068, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1068, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1068, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1068, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1058
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1069
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryDepthMarketData', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryDepthMarketData", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1069, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1070
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryDepthMarketData', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1070, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1070, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1070, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1070, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1070, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__49, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1070, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1069
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryDepthMarketData', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1058
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1072
 *       myEnv.logger.error('ReqQryDepthMarketData', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1054
 * 
 *   #
 *   def  ReqQryDepthMarketData(self, pQryDepthMarketData, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryDepthMarketData", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1076
 * 
 *   #
 *   def  ReqQrySettlementInfo(self, pQrySettlementInfo, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_101ReqQrySettlementInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_101ReqQrySettlementInfo = {"ReqQrySettlementInfo", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_101ReqQrySettlementInfo, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_101ReqQrySettlementInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQrySettlementInfo = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQrySettlementInfo (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQrySettlementInfo,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQrySettlementInfo)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQrySettlementInfo", 1, 2, 2, 1); __PYX_ERR(0, 1076, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQrySettlementInfo") < 0)) __PYX_ERR(0, 1076, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQrySettlementInfo = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1076, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQrySettlementInfo", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1076, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQrySettlementInfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_100ReqQrySettlementInfo(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQrySettlementInfo, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_100ReqQrySettlementInfo(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQrySettlementInfo, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQrySettlementInfo", 0);

  /* "ptp/TraderApi.pyx":1078
 *   def  ReqQrySettlementInfo(self, pQrySettlementInfo, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1079
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1080
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1081
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1081, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1081, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1081, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1082
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1082, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1082, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1082, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1082, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1082, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1082, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1082, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1082, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1082, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1082, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1083
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1083, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1083, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1083, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1083, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1083, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1085
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQrySettlementInfo)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1086
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQrySettlementInfo)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQrySettlementInfo(<CThostFtdcQrySettlementInfoField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1086, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1086, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQrySettlementInfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1086, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQrySettlementInfo};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1086, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQrySettlementInfo};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1086, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1086, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQrySettlementInfo);
            __Pyx_GIVEREF(__pyx_v_pQrySettlementInfo);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQrySettlementInfo);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1086, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1086, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1087
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQrySettlementInfo)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQrySettlementInfo(<CThostFtdcQrySettlementInfoField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1088
 *         address = ctypes.addressof(pQrySettlementInfo)
 *         with nogil:
 *           result = self._api.ReqQrySettlementInfo(<CThostFtdcQrySettlementInfoField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQrySettlementInfo(((struct CThostFtdcQrySettlementInfoField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1088, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1087
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQrySettlementInfo)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQrySettlementInfo(<CThostFtdcQrySettlementInfoField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1085
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQrySettlementInfo)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1090
 *           result = self._api.ReqQrySettlementInfo(<CThostFtdcQrySettlementInfoField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQrySettlementInfo', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1090, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1090, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1090, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1090, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1090, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1080
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1091
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQrySettlementInfo', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQrySettlementInfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1091, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1092
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQrySettlementInfo', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1092, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1092, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1092, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1092, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1092, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__50, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1092, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1091
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQrySettlementInfo', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1080
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1094
 *       myEnv.logger.error('ReqQrySettlementInfo', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1076
 * 
 *   #
 *   def  ReqQrySettlementInfo(self, pQrySettlementInfo, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQrySettlementInfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1098
 * 
 *   #
 *   def  ReqQryTransferBank(self, pQryTransferBank, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_103ReqQryTransferBank(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_103ReqQryTransferBank = {"ReqQryTransferBank", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_103ReqQryTransferBank, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_103ReqQryTransferBank(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryTransferBank = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryTransferBank (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryTransferBank,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryTransferBank)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryTransferBank", 1, 2, 2, 1); __PYX_ERR(0, 1098, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryTransferBank") < 0)) __PYX_ERR(0, 1098, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryTransferBank = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1098, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryTransferBank", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1098, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryTransferBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_102ReqQryTransferBank(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryTransferBank, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_102ReqQryTransferBank(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryTransferBank, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryTransferBank", 0);

  /* "ptp/TraderApi.pyx":1100
 *   def  ReqQryTransferBank(self, pQryTransferBank, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1101
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1102
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1103
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1103, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1103, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1103, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1104
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1104, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1104, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1104, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1104, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1104, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1104, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1104, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1104, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1104, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1104, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1105
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1105, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1105, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1105, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1105, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1105, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1107
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryTransferBank)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1108
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryTransferBank)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryTransferBank(<CThostFtdcQryTransferBankField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1108, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1108, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryTransferBank); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1108, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryTransferBank};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1108, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryTransferBank};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1108, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1108, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryTransferBank);
            __Pyx_GIVEREF(__pyx_v_pQryTransferBank);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryTransferBank);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1108, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1108, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1109
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryTransferBank)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryTransferBank(<CThostFtdcQryTransferBankField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1110
 *         address = ctypes.addressof(pQryTransferBank)
 *         with nogil:
 *           result = self._api.ReqQryTransferBank(<CThostFtdcQryTransferBankField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryTransferBank(((struct CThostFtdcQryTransferBankField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1110, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1109
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryTransferBank)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryTransferBank(<CThostFtdcQryTransferBankField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1107
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryTransferBank)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1112
 *           result = self._api.ReqQryTransferBank(<CThostFtdcQryTransferBankField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryTransferBank', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1112, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1112, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1112, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1112, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1112, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1102
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1113
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryTransferBank', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryTransferBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1113, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1114
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryTransferBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1114, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1114, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1114, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1114, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1114, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__51, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1114, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1113
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryTransferBank', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1102
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1116
 *       myEnv.logger.error('ReqQryTransferBank', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1098
 * 
 *   #
 *   def  ReqQryTransferBank(self, pQryTransferBank, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryTransferBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1120
 * 
 *   #
 *   def  ReqQryInvestorPositionDetail(self, pQryInvestorPositionDetail, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_105ReqQryInvestorPositionDetail(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_105ReqQryInvestorPositionDetail = {"ReqQryInvestorPositionDetail", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_105ReqQryInvestorPositionDetail, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_105ReqQryInvestorPositionDetail(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryInvestorPositionDetail = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryInvestorPositionDetail (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryInvestorPositionDetail,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryInvestorPositionDetail)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryInvestorPositionDetail", 1, 2, 2, 1); __PYX_ERR(0, 1120, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryInvestorPositionDetail") < 0)) __PYX_ERR(0, 1120, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryInvestorPositionDetail = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1120, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryInvestorPositionDetail", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1120, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInvestorPositionDetail", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_104ReqQryInvestorPositionDetail(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryInvestorPositionDetail, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_104ReqQryInvestorPositionDetail(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryInvestorPositionDetail, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryInvestorPositionDetail", 0);

  /* "ptp/TraderApi.pyx":1122
 *   def  ReqQryInvestorPositionDetail(self, pQryInvestorPositionDetail, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1123
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1124
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1125
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1125, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1125, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1125, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1126
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1126, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1126, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1126, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1126, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1126, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1126, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1126, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1126, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1126, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1126, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1127
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1127, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1127, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1127, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1127, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1127, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1129
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryInvestorPositionDetail)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1130
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInvestorPositionDetail)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryInvestorPositionDetail(<CThostFtdcQryInvestorPositionDetailField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1130, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1130, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryInvestorPositionDetail); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1130, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryInvestorPositionDetail};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1130, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryInvestorPositionDetail};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1130, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1130, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryInvestorPositionDetail);
            __Pyx_GIVEREF(__pyx_v_pQryInvestorPositionDetail);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryInvestorPositionDetail);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1130, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1130, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1131
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInvestorPositionDetail)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryInvestorPositionDetail(<CThostFtdcQryInvestorPositionDetailField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1132
 *         address = ctypes.addressof(pQryInvestorPositionDetail)
 *         with nogil:
 *           result = self._api.ReqQryInvestorPositionDetail(<CThostFtdcQryInvestorPositionDetailField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryInvestorPositionDetail(((struct CThostFtdcQryInvestorPositionDetailField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1132, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1131
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInvestorPositionDetail)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryInvestorPositionDetail(<CThostFtdcQryInvestorPositionDetailField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1129
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryInvestorPositionDetail)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1134
 *           result = self._api.ReqQryInvestorPositionDetail(<CThostFtdcQryInvestorPositionDetailField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInvestorPositionDetail', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1134, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1134, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1134, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1134, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1134, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1124
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1135
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryInvestorPositionDetail', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInvestorPositionDetail", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1135, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1136
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInvestorPositionDetail', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1136, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1136, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1136, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1136, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1136, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__52, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1136, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1135
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryInvestorPositionDetail', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1124
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1138
 *       myEnv.logger.error('ReqQryInvestorPositionDetail', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1120
 * 
 *   #
 *   def  ReqQryInvestorPositionDetail(self, pQryInvestorPositionDetail, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInvestorPositionDetail", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1142
 * 
 *   #
 *   def  ReqQryNotice(self, pQryNotice, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_107ReqQryNotice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_107ReqQryNotice = {"ReqQryNotice", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_107ReqQryNotice, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_107ReqQryNotice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryNotice = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryNotice (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryNotice,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryNotice)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryNotice", 1, 2, 2, 1); __PYX_ERR(0, 1142, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryNotice") < 0)) __PYX_ERR(0, 1142, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryNotice = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1142, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryNotice", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1142, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryNotice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_106ReqQryNotice(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryNotice, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_106ReqQryNotice(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryNotice, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryNotice", 0);

  /* "ptp/TraderApi.pyx":1144
 *   def  ReqQryNotice(self, pQryNotice, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1145
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1146
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1147
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1147, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1147, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1147, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1148
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1148, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1148, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1148, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1148, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1148, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1148, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1148, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1148, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1148, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1148, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1149
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1149, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1149, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1149, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1149, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1149, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1151
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryNotice)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1152
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryNotice)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryNotice(<CThostFtdcQryNoticeField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1152, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1152, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryNotice); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1152, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryNotice};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1152, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryNotice};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1152, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1152, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryNotice);
            __Pyx_GIVEREF(__pyx_v_pQryNotice);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryNotice);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1152, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1152, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1153
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryNotice)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryNotice(<CThostFtdcQryNoticeField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1154
 *         address = ctypes.addressof(pQryNotice)
 *         with nogil:
 *           result = self._api.ReqQryNotice(<CThostFtdcQryNoticeField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryNotice(((struct CThostFtdcQryNoticeField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1154, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1153
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryNotice)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryNotice(<CThostFtdcQryNoticeField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1151
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryNotice)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1156
 *           result = self._api.ReqQryNotice(<CThostFtdcQryNoticeField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryNotice', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1156, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1156, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1156, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1156, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1156, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1146
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1157
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryNotice', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryNotice", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1157, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1158
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryNotice', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1158, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1158, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1158, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1158, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1158, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__53, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1158, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1157
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryNotice', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1146
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1160
 *       myEnv.logger.error('ReqQryNotice', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1142
 * 
 *   #
 *   def  ReqQryNotice(self, pQryNotice, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryNotice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1164
 * 
 *   #
 *   def  ReqQrySettlementInfoConfirm(self, pQrySettlementInfoConfirm, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_109ReqQrySettlementInfoConfirm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_109ReqQrySettlementInfoConfirm = {"ReqQrySettlementInfoConfirm", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_109ReqQrySettlementInfoConfirm, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_109ReqQrySettlementInfoConfirm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQrySettlementInfoConfirm = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQrySettlementInfoConfirm (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQrySettlementInfoConfirm,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQrySettlementInfoConfirm)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQrySettlementInfoConfirm", 1, 2, 2, 1); __PYX_ERR(0, 1164, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQrySettlementInfoConfirm") < 0)) __PYX_ERR(0, 1164, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQrySettlementInfoConfirm = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1164, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQrySettlementInfoConfirm", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1164, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQrySettlementInfoConfirm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_108ReqQrySettlementInfoConfirm(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQrySettlementInfoConfirm, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_108ReqQrySettlementInfoConfirm(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQrySettlementInfoConfirm, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQrySettlementInfoConfirm", 0);

  /* "ptp/TraderApi.pyx":1166
 *   def  ReqQrySettlementInfoConfirm(self, pQrySettlementInfoConfirm, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1167
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1168
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1169
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1169, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1169, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1169, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1170
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1170, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1170, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1170, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1170, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1170, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1170, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1170, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1170, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1170, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1170, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1171
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1171, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1171, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1171, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1171, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1171, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1173
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQrySettlementInfoConfirm)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1174
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQrySettlementInfoConfirm)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQrySettlementInfoConfirm(<CThostFtdcQrySettlementInfoConfirmField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1174, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1174, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQrySettlementInfoConfirm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1174, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQrySettlementInfoConfirm};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1174, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQrySettlementInfoConfirm};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1174, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1174, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQrySettlementInfoConfirm);
            __Pyx_GIVEREF(__pyx_v_pQrySettlementInfoConfirm);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQrySettlementInfoConfirm);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1174, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1174, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1175
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQrySettlementInfoConfirm)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQrySettlementInfoConfirm(<CThostFtdcQrySettlementInfoConfirmField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1176
 *         address = ctypes.addressof(pQrySettlementInfoConfirm)
 *         with nogil:
 *           result = self._api.ReqQrySettlementInfoConfirm(<CThostFtdcQrySettlementInfoConfirmField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQrySettlementInfoConfirm(((struct CThostFtdcQrySettlementInfoConfirmField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1176, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1175
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQrySettlementInfoConfirm)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQrySettlementInfoConfirm(<CThostFtdcQrySettlementInfoConfirmField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1173
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQrySettlementInfoConfirm)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1178
 *           result = self._api.ReqQrySettlementInfoConfirm(<CThostFtdcQrySettlementInfoConfirmField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQrySettlementInfoConfirm', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1178, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1178, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1178, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1178, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1178, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1168
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1179
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQrySettlementInfoConfirm', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQrySettlementInfoConfirm", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1179, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1180
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQrySettlementInfoConfirm', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1180, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1180, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1180, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1180, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1180, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__54, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1180, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1179
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQrySettlementInfoConfirm', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1168
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1182
 *       myEnv.logger.error('ReqQrySettlementInfoConfirm', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1164
 * 
 *   #
 *   def  ReqQrySettlementInfoConfirm(self, pQrySettlementInfoConfirm, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQrySettlementInfoConfirm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1186
 * 
 *   #
 *   def  ReqQryInvestorPositionCombineDetail(self, pQryInvestorPositionCombineDetail, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_111ReqQryInvestorPositionCombineDetail(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_111ReqQryInvestorPositionCombineDetail = {"ReqQryInvestorPositionCombineDetail", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_111ReqQryInvestorPositionCombineDetail, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_111ReqQryInvestorPositionCombineDetail(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryInvestorPositionCombineDetail = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryInvestorPositionCombineDetail (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryInvestorPositionCombineDetai,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryInvestorPositionCombineDetai)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryInvestorPositionCombineDetail", 1, 2, 2, 1); __PYX_ERR(0, 1186, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryInvestorPositionCombineDetail") < 0)) __PYX_ERR(0, 1186, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryInvestorPositionCombineDetail = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1186, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryInvestorPositionCombineDetail", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1186, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInvestorPositionCombineDetail", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_110ReqQryInvestorPositionCombineDetail(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryInvestorPositionCombineDetail, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_110ReqQryInvestorPositionCombineDetail(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryInvestorPositionCombineDetail, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryInvestorPositionCombineDetail", 0);

  /* "ptp/TraderApi.pyx":1188
 *   def  ReqQryInvestorPositionCombineDetail(self, pQryInvestorPositionCombineDetail, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1189
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1190
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1191
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1191, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1191, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1191, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1192
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1192, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1192, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1192, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1192, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1192, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1192, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1192, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1192, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1192, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1192, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1193
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1193, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1193, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1193, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1193, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1193, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1195
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryInvestorPositionCombineDetail)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1196
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInvestorPositionCombineDetail)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryInvestorPositionCombineDetail(<CThostFtdcQryInvestorPositionCombineDetailField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1196, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1196, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryInvestorPositionCombineDetail); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1196, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryInvestorPositionCombineDetail};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1196, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryInvestorPositionCombineDetail};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1196, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1196, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryInvestorPositionCombineDetail);
            __Pyx_GIVEREF(__pyx_v_pQryInvestorPositionCombineDetail);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryInvestorPositionCombineDetail);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1196, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1196, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1197
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInvestorPositionCombineDetail)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryInvestorPositionCombineDetail(<CThostFtdcQryInvestorPositionCombineDetailField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1198
 *         address = ctypes.addressof(pQryInvestorPositionCombineDetail)
 *         with nogil:
 *           result = self._api.ReqQryInvestorPositionCombineDetail(<CThostFtdcQryInvestorPositionCombineDetailField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryInvestorPositionCombineDetail(((struct CThostFtdcQryInvestorPositionCombineDetailField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1198, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1197
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInvestorPositionCombineDetail)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryInvestorPositionCombineDetail(<CThostFtdcQryInvestorPositionCombineDetailField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1195
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryInvestorPositionCombineDetail)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1200
 *           result = self._api.ReqQryInvestorPositionCombineDetail(<CThostFtdcQryInvestorPositionCombineDetailField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInvestorPositionCombineDetail', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1200, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1200, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1200, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1200, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1200, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1190
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1201
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryInvestorPositionCombineDetail', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInvestorPositionCombineDetail", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1201, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1202
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInvestorPositionCombineDetail', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1202, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1202, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1202, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1202, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1202, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__55, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1202, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1201
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryInvestorPositionCombineDetail', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1190
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1204
 *       myEnv.logger.error('ReqQryInvestorPositionCombineDetail', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1186
 * 
 *   #
 *   def  ReqQryInvestorPositionCombineDetail(self, pQryInvestorPositionCombineDetail, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInvestorPositionCombineDetail", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1208
 * 
 *   #
 *   def  ReqQryCFMMCTradingAccountKey(self, pQryCFMMCTradingAccountKey, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_113ReqQryCFMMCTradingAccountKey(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_113ReqQryCFMMCTradingAccountKey = {"ReqQryCFMMCTradingAccountKey", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_113ReqQryCFMMCTradingAccountKey, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_113ReqQryCFMMCTradingAccountKey(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryCFMMCTradingAccountKey = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryCFMMCTradingAccountKey (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryCFMMCTradingAccountKey,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryCFMMCTradingAccountKey)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryCFMMCTradingAccountKey", 1, 2, 2, 1); __PYX_ERR(0, 1208, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryCFMMCTradingAccountKey") < 0)) __PYX_ERR(0, 1208, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryCFMMCTradingAccountKey = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1208, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryCFMMCTradingAccountKey", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1208, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryCFMMCTradingAccountKey", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_112ReqQryCFMMCTradingAccountKey(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryCFMMCTradingAccountKey, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_112ReqQryCFMMCTradingAccountKey(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryCFMMCTradingAccountKey, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryCFMMCTradingAccountKey", 0);

  /* "ptp/TraderApi.pyx":1210
 *   def  ReqQryCFMMCTradingAccountKey(self, pQryCFMMCTradingAccountKey, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1211
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1212
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1213
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1213, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1213, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1213, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1214
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1214, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1214, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1214, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1214, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1214, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1214, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1214, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1214, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1214, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1214, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1215
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1215, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1215, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1215, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1215, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1215, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1217
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryCFMMCTradingAccountKey)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1218
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryCFMMCTradingAccountKey)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryCFMMCTradingAccountKey(<CThostFtdcQryCFMMCTradingAccountKeyField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1218, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1218, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryCFMMCTradingAccountKey); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1218, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryCFMMCTradingAccountKey};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1218, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryCFMMCTradingAccountKey};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1218, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1218, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryCFMMCTradingAccountKey);
            __Pyx_GIVEREF(__pyx_v_pQryCFMMCTradingAccountKey);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryCFMMCTradingAccountKey);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1218, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1218, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1219
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryCFMMCTradingAccountKey)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryCFMMCTradingAccountKey(<CThostFtdcQryCFMMCTradingAccountKeyField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1220
 *         address = ctypes.addressof(pQryCFMMCTradingAccountKey)
 *         with nogil:
 *           result = self._api.ReqQryCFMMCTradingAccountKey(<CThostFtdcQryCFMMCTradingAccountKeyField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryCFMMCTradingAccountKey(((struct CThostFtdcQryCFMMCTradingAccountKeyField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1220, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1219
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryCFMMCTradingAccountKey)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryCFMMCTradingAccountKey(<CThostFtdcQryCFMMCTradingAccountKeyField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1217
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryCFMMCTradingAccountKey)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1222
 *           result = self._api.ReqQryCFMMCTradingAccountKey(<CThostFtdcQryCFMMCTradingAccountKeyField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryCFMMCTradingAccountKey', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1222, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1222, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1222, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1222, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1222, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1212
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1223
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryCFMMCTradingAccountKey', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryCFMMCTradingAccountKey", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1223, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1224
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryCFMMCTradingAccountKey', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1224, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1224, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1224, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1224, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1224, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__56, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1224, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1223
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryCFMMCTradingAccountKey', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1212
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1226
 *       myEnv.logger.error('ReqQryCFMMCTradingAccountKey', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1208
 * 
 *   #
 *   def  ReqQryCFMMCTradingAccountKey(self, pQryCFMMCTradingAccountKey, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryCFMMCTradingAccountKey", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1230
 * 
 *   #
 *   def  ReqQryEWarrantOffset(self, pQryEWarrantOffset, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_115ReqQryEWarrantOffset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_115ReqQryEWarrantOffset = {"ReqQryEWarrantOffset", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_115ReqQryEWarrantOffset, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_115ReqQryEWarrantOffset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryEWarrantOffset = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryEWarrantOffset (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryEWarrantOffset,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryEWarrantOffset)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryEWarrantOffset", 1, 2, 2, 1); __PYX_ERR(0, 1230, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryEWarrantOffset") < 0)) __PYX_ERR(0, 1230, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryEWarrantOffset = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1230, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryEWarrantOffset", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1230, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryEWarrantOffset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_114ReqQryEWarrantOffset(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryEWarrantOffset, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_114ReqQryEWarrantOffset(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryEWarrantOffset, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryEWarrantOffset", 0);

  /* "ptp/TraderApi.pyx":1232
 *   def  ReqQryEWarrantOffset(self, pQryEWarrantOffset, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1233
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1234
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1235
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1235, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1235, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1235, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1236
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1236, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1236, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1236, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1236, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1236, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1236, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1236, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1236, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1236, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1236, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1237
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1237, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1237, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1237, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1237, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1237, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1239
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryEWarrantOffset)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1240
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryEWarrantOffset)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryEWarrantOffset(<CThostFtdcQryEWarrantOffsetField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1240, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1240, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryEWarrantOffset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1240, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryEWarrantOffset};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1240, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryEWarrantOffset};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1240, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1240, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryEWarrantOffset);
            __Pyx_GIVEREF(__pyx_v_pQryEWarrantOffset);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryEWarrantOffset);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1240, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1240, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1241
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryEWarrantOffset)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryEWarrantOffset(<CThostFtdcQryEWarrantOffsetField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1242
 *         address = ctypes.addressof(pQryEWarrantOffset)
 *         with nogil:
 *           result = self._api.ReqQryEWarrantOffset(<CThostFtdcQryEWarrantOffsetField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryEWarrantOffset(((struct CThostFtdcQryEWarrantOffsetField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1242, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1241
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryEWarrantOffset)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryEWarrantOffset(<CThostFtdcQryEWarrantOffsetField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1239
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryEWarrantOffset)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1244
 *           result = self._api.ReqQryEWarrantOffset(<CThostFtdcQryEWarrantOffsetField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryEWarrantOffset', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1244, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1244, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1244, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1244, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1244, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1234
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1245
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryEWarrantOffset', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryEWarrantOffset", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1245, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1246
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryEWarrantOffset', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1246, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1246, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1246, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1246, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1246, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__57, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1246, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1245
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryEWarrantOffset', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1234
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1248
 *       myEnv.logger.error('ReqQryEWarrantOffset', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1230
 * 
 *   #
 *   def  ReqQryEWarrantOffset(self, pQryEWarrantOffset, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryEWarrantOffset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1252
 * 
 *   #/
 *   def  ReqQryInvestorProductGroupMargin(self, pQryInvestorProductGroupMargin, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_117ReqQryInvestorProductGroupMargin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_117ReqQryInvestorProductGroupMargin = {"ReqQryInvestorProductGroupMargin", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_117ReqQryInvestorProductGroupMargin, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_117ReqQryInvestorProductGroupMargin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryInvestorProductGroupMargin = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryInvestorProductGroupMargin (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryInvestorProductGroupMargin,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryInvestorProductGroupMargin)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryInvestorProductGroupMargin", 1, 2, 2, 1); __PYX_ERR(0, 1252, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryInvestorProductGroupMargin") < 0)) __PYX_ERR(0, 1252, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryInvestorProductGroupMargin = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1252, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryInvestorProductGroupMargin", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1252, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInvestorProductGroupMargin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_116ReqQryInvestorProductGroupMargin(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryInvestorProductGroupMargin, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_116ReqQryInvestorProductGroupMargin(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryInvestorProductGroupMargin, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryInvestorProductGroupMargin", 0);

  /* "ptp/TraderApi.pyx":1254
 *   def  ReqQryInvestorProductGroupMargin(self, pQryInvestorProductGroupMargin, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1255
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1256
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1257
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1257, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1257, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1257, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1258
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1258, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1258, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1258, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1258, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1258, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1258, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1258, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1258, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1258, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1258, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1259
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1259, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1259, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1259, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1259, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1259, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1261
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryInvestorProductGroupMargin)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1262
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInvestorProductGroupMargin)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryInvestorProductGroupMargin(<CThostFtdcQryInvestorProductGroupMarginField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1262, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1262, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryInvestorProductGroupMargin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1262, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryInvestorProductGroupMargin};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1262, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryInvestorProductGroupMargin};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1262, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1262, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryInvestorProductGroupMargin);
            __Pyx_GIVEREF(__pyx_v_pQryInvestorProductGroupMargin);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryInvestorProductGroupMargin);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1262, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1262, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1263
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInvestorProductGroupMargin)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryInvestorProductGroupMargin(<CThostFtdcQryInvestorProductGroupMarginField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1264
 *         address = ctypes.addressof(pQryInvestorProductGroupMargin)
 *         with nogil:
 *           result = self._api.ReqQryInvestorProductGroupMargin(<CThostFtdcQryInvestorProductGroupMarginField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryInvestorProductGroupMargin(((struct CThostFtdcQryInvestorProductGroupMarginField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1264, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1263
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInvestorProductGroupMargin)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryInvestorProductGroupMargin(<CThostFtdcQryInvestorProductGroupMarginField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1261
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryInvestorProductGroupMargin)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1266
 *           result = self._api.ReqQryInvestorProductGroupMargin(<CThostFtdcQryInvestorProductGroupMarginField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInvestorProductGroupMargin', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1266, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1266, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1266, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1266, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1266, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1256
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1267
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryInvestorProductGroupMargin', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInvestorProductGroupMargin", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1267, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1268
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInvestorProductGroupMargin', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1268, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1268, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1268, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1268, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1268, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__58, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1268, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1267
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryInvestorProductGroupMargin', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1256
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1270
 *       myEnv.logger.error('ReqQryInvestorProductGroupMargin', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1252
 * 
 *   #/
 *   def  ReqQryInvestorProductGroupMargin(self, pQryInvestorProductGroupMargin, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInvestorProductGroupMargin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1274
 * 
 *   #
 *   def  ReqQryExchangeMarginRate(self, pQryExchangeMarginRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_119ReqQryExchangeMarginRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_119ReqQryExchangeMarginRate = {"ReqQryExchangeMarginRate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_119ReqQryExchangeMarginRate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_119ReqQryExchangeMarginRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryExchangeMarginRate = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryExchangeMarginRate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryExchangeMarginRate,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryExchangeMarginRate)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryExchangeMarginRate", 1, 2, 2, 1); __PYX_ERR(0, 1274, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryExchangeMarginRate") < 0)) __PYX_ERR(0, 1274, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryExchangeMarginRate = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1274, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryExchangeMarginRate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1274, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryExchangeMarginRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_118ReqQryExchangeMarginRate(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryExchangeMarginRate, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_118ReqQryExchangeMarginRate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryExchangeMarginRate, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryExchangeMarginRate", 0);

  /* "ptp/TraderApi.pyx":1276
 *   def  ReqQryExchangeMarginRate(self, pQryExchangeMarginRate, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1277
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1278
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1279
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1279, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1279, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1279, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1280
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1280, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1280, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1280, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1280, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1280, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1280, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1280, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1280, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1280, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1280, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1281
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1281, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1281, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1281, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1281, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1281, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1283
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryExchangeMarginRate)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1284
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryExchangeMarginRate)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryExchangeMarginRate(<CThostFtdcQryExchangeMarginRateField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1284, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1284, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryExchangeMarginRate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1284, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryExchangeMarginRate};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1284, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryExchangeMarginRate};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1284, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1284, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryExchangeMarginRate);
            __Pyx_GIVEREF(__pyx_v_pQryExchangeMarginRate);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryExchangeMarginRate);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1284, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1284, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1285
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryExchangeMarginRate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryExchangeMarginRate(<CThostFtdcQryExchangeMarginRateField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1286
 *         address = ctypes.addressof(pQryExchangeMarginRate)
 *         with nogil:
 *           result = self._api.ReqQryExchangeMarginRate(<CThostFtdcQryExchangeMarginRateField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryExchangeMarginRate(((struct CThostFtdcQryExchangeMarginRateField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1286, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1285
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryExchangeMarginRate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryExchangeMarginRate(<CThostFtdcQryExchangeMarginRateField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1283
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryExchangeMarginRate)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1288
 *           result = self._api.ReqQryExchangeMarginRate(<CThostFtdcQryExchangeMarginRateField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryExchangeMarginRate', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1288, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1288, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1288, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1288, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1288, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1278
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1289
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryExchangeMarginRate', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryExchangeMarginRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1289, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1290
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryExchangeMarginRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1290, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1290, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1290, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1290, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1290, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__59, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1290, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1289
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryExchangeMarginRate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1278
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1292
 *       myEnv.logger.error('ReqQryExchangeMarginRate', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1274
 * 
 *   #
 *   def  ReqQryExchangeMarginRate(self, pQryExchangeMarginRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryExchangeMarginRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1296
 * 
 *   #
 *   def  ReqQryExchangeMarginRateAdjust(self, pQryExchangeMarginRateAdjust, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_121ReqQryExchangeMarginRateAdjust(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_121ReqQryExchangeMarginRateAdjust = {"ReqQryExchangeMarginRateAdjust", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_121ReqQryExchangeMarginRateAdjust, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_121ReqQryExchangeMarginRateAdjust(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryExchangeMarginRateAdjust = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryExchangeMarginRateAdjust (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryExchangeMarginRateAdjust,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryExchangeMarginRateAdjust)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryExchangeMarginRateAdjust", 1, 2, 2, 1); __PYX_ERR(0, 1296, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryExchangeMarginRateAdjust") < 0)) __PYX_ERR(0, 1296, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryExchangeMarginRateAdjust = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1296, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryExchangeMarginRateAdjust", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1296, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryExchangeMarginRateAdjust", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_120ReqQryExchangeMarginRateAdjust(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryExchangeMarginRateAdjust, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_120ReqQryExchangeMarginRateAdjust(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryExchangeMarginRateAdjust, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryExchangeMarginRateAdjust", 0);

  /* "ptp/TraderApi.pyx":1298
 *   def  ReqQryExchangeMarginRateAdjust(self, pQryExchangeMarginRateAdjust, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1299
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1300
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1301
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1301, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1301, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1301, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1302
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1302, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1302, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1302, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1302, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1302, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1302, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1302, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1302, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1302, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1302, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1303
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1303, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1303, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1303, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1303, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1303, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1305
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryExchangeMarginRateAdjust)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1306
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryExchangeMarginRateAdjust)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryExchangeMarginRateAdjust(<CThostFtdcQryExchangeMarginRateAdjustField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1306, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1306, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryExchangeMarginRateAdjust); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1306, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryExchangeMarginRateAdjust};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1306, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryExchangeMarginRateAdjust};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1306, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1306, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryExchangeMarginRateAdjust);
            __Pyx_GIVEREF(__pyx_v_pQryExchangeMarginRateAdjust);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryExchangeMarginRateAdjust);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1306, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1306, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1307
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryExchangeMarginRateAdjust)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryExchangeMarginRateAdjust(<CThostFtdcQryExchangeMarginRateAdjustField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1308
 *         address = ctypes.addressof(pQryExchangeMarginRateAdjust)
 *         with nogil:
 *           result = self._api.ReqQryExchangeMarginRateAdjust(<CThostFtdcQryExchangeMarginRateAdjustField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryExchangeMarginRateAdjust(((struct CThostFtdcQryExchangeMarginRateAdjustField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1308, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1307
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryExchangeMarginRateAdjust)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryExchangeMarginRateAdjust(<CThostFtdcQryExchangeMarginRateAdjustField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1305
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryExchangeMarginRateAdjust)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1310
 *           result = self._api.ReqQryExchangeMarginRateAdjust(<CThostFtdcQryExchangeMarginRateAdjustField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryExchangeMarginRateAdjust', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1310, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1310, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1310, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1310, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1310, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1300
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1311
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryExchangeMarginRateAdjust', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryExchangeMarginRateAdjust", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1311, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1312
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryExchangeMarginRateAdjust', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1312, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1312, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1312, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1312, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1312, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__60, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1312, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1311
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryExchangeMarginRateAdjust', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1300
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1314
 *       myEnv.logger.error('ReqQryExchangeMarginRateAdjust', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1296
 * 
 *   #
 *   def  ReqQryExchangeMarginRateAdjust(self, pQryExchangeMarginRateAdjust, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryExchangeMarginRateAdjust", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1318
 * 
 *   #
 *   def  ReqQryExchangeRate(self, pQryExchangeRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_123ReqQryExchangeRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_123ReqQryExchangeRate = {"ReqQryExchangeRate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_123ReqQryExchangeRate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_123ReqQryExchangeRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryExchangeRate = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryExchangeRate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryExchangeRate,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryExchangeRate)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryExchangeRate", 1, 2, 2, 1); __PYX_ERR(0, 1318, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryExchangeRate") < 0)) __PYX_ERR(0, 1318, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryExchangeRate = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1318, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryExchangeRate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1318, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryExchangeRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_122ReqQryExchangeRate(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryExchangeRate, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_122ReqQryExchangeRate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryExchangeRate, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryExchangeRate", 0);

  /* "ptp/TraderApi.pyx":1320
 *   def  ReqQryExchangeRate(self, pQryExchangeRate, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1321
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1322
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1323
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1323, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1323, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1323, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1324
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1324, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1324, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1324, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1324, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1324, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1324, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1324, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1324, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1324, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1324, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1325
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1325, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1325, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1325, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1325, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1325, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1327
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryExchangeRate)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1328
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryExchangeRate)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryExchangeRate(<CThostFtdcQryExchangeRateField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1328, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1328, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryExchangeRate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1328, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryExchangeRate};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1328, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryExchangeRate};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1328, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1328, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryExchangeRate);
            __Pyx_GIVEREF(__pyx_v_pQryExchangeRate);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryExchangeRate);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1328, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1328, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1329
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryExchangeRate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryExchangeRate(<CThostFtdcQryExchangeRateField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1330
 *         address = ctypes.addressof(pQryExchangeRate)
 *         with nogil:
 *           result = self._api.ReqQryExchangeRate(<CThostFtdcQryExchangeRateField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryExchangeRate(((struct CThostFtdcQryExchangeRateField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1330, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1329
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryExchangeRate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryExchangeRate(<CThostFtdcQryExchangeRateField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1327
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryExchangeRate)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1332
 *           result = self._api.ReqQryExchangeRate(<CThostFtdcQryExchangeRateField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryExchangeRate', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1332, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1332, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1332, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1332, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1332, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1322
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1333
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryExchangeRate', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryExchangeRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1333, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1334
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryExchangeRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1334, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1334, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1334, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1334, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1334, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__61, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1334, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1333
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryExchangeRate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1322
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1336
 *       myEnv.logger.error('ReqQryExchangeRate', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1318
 * 
 *   #
 *   def  ReqQryExchangeRate(self, pQryExchangeRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryExchangeRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1340
 * 
 *   #
 *   def  ReqQrySecAgentACIDMap(self, pQrySecAgentACIDMap, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_125ReqQrySecAgentACIDMap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_125ReqQrySecAgentACIDMap = {"ReqQrySecAgentACIDMap", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_125ReqQrySecAgentACIDMap, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_125ReqQrySecAgentACIDMap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQrySecAgentACIDMap = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQrySecAgentACIDMap (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQrySecAgentACIDMap,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQrySecAgentACIDMap)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQrySecAgentACIDMap", 1, 2, 2, 1); __PYX_ERR(0, 1340, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQrySecAgentACIDMap") < 0)) __PYX_ERR(0, 1340, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQrySecAgentACIDMap = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1340, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQrySecAgentACIDMap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1340, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQrySecAgentACIDMap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_124ReqQrySecAgentACIDMap(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQrySecAgentACIDMap, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_124ReqQrySecAgentACIDMap(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQrySecAgentACIDMap, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQrySecAgentACIDMap", 0);

  /* "ptp/TraderApi.pyx":1342
 *   def  ReqQrySecAgentACIDMap(self, pQrySecAgentACIDMap, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1343
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1344
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1345
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1345, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1345, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1345, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1346
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1346, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1346, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1346, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1346, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1346, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1346, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1346, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1346, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1346, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1346, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1347
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1347, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1347, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1347, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1347, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1347, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1349
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQrySecAgentACIDMap)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1350
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQrySecAgentACIDMap)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQrySecAgentACIDMap(<CThostFtdcQrySecAgentACIDMapField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1350, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1350, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQrySecAgentACIDMap); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1350, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQrySecAgentACIDMap};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1350, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQrySecAgentACIDMap};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1350, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1350, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQrySecAgentACIDMap);
            __Pyx_GIVEREF(__pyx_v_pQrySecAgentACIDMap);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQrySecAgentACIDMap);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1350, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1350, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1351
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQrySecAgentACIDMap)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQrySecAgentACIDMap(<CThostFtdcQrySecAgentACIDMapField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1352
 *         address = ctypes.addressof(pQrySecAgentACIDMap)
 *         with nogil:
 *           result = self._api.ReqQrySecAgentACIDMap(<CThostFtdcQrySecAgentACIDMapField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQrySecAgentACIDMap(((struct CThostFtdcQrySecAgentACIDMapField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1352, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1351
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQrySecAgentACIDMap)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQrySecAgentACIDMap(<CThostFtdcQrySecAgentACIDMapField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1349
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQrySecAgentACIDMap)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1354
 *           result = self._api.ReqQrySecAgentACIDMap(<CThostFtdcQrySecAgentACIDMapField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQrySecAgentACIDMap', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1354, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1354, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1354, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1354, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1354, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1344
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1355
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQrySecAgentACIDMap', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQrySecAgentACIDMap", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1355, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1356
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQrySecAgentACIDMap', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1356, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1356, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1356, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1356, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1356, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__62, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1356, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1355
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQrySecAgentACIDMap', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1344
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1358
 *       myEnv.logger.error('ReqQrySecAgentACIDMap', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1340
 * 
 *   #
 *   def  ReqQrySecAgentACIDMap(self, pQrySecAgentACIDMap, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQrySecAgentACIDMap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1362
 * 
 *   #
 *   def  ReqQryProductExchRate(self, pQryProductExchRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_127ReqQryProductExchRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_127ReqQryProductExchRate = {"ReqQryProductExchRate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_127ReqQryProductExchRate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_127ReqQryProductExchRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryProductExchRate = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryProductExchRate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryProductExchRate,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryProductExchRate)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryProductExchRate", 1, 2, 2, 1); __PYX_ERR(0, 1362, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryProductExchRate") < 0)) __PYX_ERR(0, 1362, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryProductExchRate = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1362, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryProductExchRate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1362, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryProductExchRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_126ReqQryProductExchRate(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryProductExchRate, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_126ReqQryProductExchRate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryProductExchRate, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryProductExchRate", 0);

  /* "ptp/TraderApi.pyx":1364
 *   def  ReqQryProductExchRate(self, pQryProductExchRate, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1365
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1366
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1367
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1367, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1367, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1367, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1368
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1368, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1368, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1368, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1368, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1368, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1368, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1368, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1368, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1368, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1368, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1369
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1369, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1369, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1369, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1369, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1369, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1371
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryProductExchRate)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1372
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryProductExchRate)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryProductExchRate(<CThostFtdcQryProductExchRateField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1372, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1372, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryProductExchRate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1372, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryProductExchRate};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1372, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryProductExchRate};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1372, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1372, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryProductExchRate);
            __Pyx_GIVEREF(__pyx_v_pQryProductExchRate);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryProductExchRate);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1372, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1372, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1373
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryProductExchRate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryProductExchRate(<CThostFtdcQryProductExchRateField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1374
 *         address = ctypes.addressof(pQryProductExchRate)
 *         with nogil:
 *           result = self._api.ReqQryProductExchRate(<CThostFtdcQryProductExchRateField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryProductExchRate(((struct CThostFtdcQryProductExchRateField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1374, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1373
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryProductExchRate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryProductExchRate(<CThostFtdcQryProductExchRateField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1371
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryProductExchRate)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1376
 *           result = self._api.ReqQryProductExchRate(<CThostFtdcQryProductExchRateField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryProductExchRate', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1376, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1376, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1376, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1376, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1376, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1366
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1377
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryProductExchRate', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryProductExchRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1377, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1378
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryProductExchRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1378, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1378, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1378, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1378, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1378, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__63, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1378, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1377
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryProductExchRate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1366
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1380
 *       myEnv.logger.error('ReqQryProductExchRate', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1362
 * 
 *   #
 *   def  ReqQryProductExchRate(self, pQryProductExchRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryProductExchRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1384
 * 
 *   #
 *   def  ReqQryProductGroup(self, pQryProductGroup, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_129ReqQryProductGroup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_129ReqQryProductGroup = {"ReqQryProductGroup", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_129ReqQryProductGroup, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_129ReqQryProductGroup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryProductGroup = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryProductGroup (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryProductGroup,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryProductGroup)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryProductGroup", 1, 2, 2, 1); __PYX_ERR(0, 1384, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryProductGroup") < 0)) __PYX_ERR(0, 1384, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryProductGroup = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1384, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryProductGroup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1384, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryProductGroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_128ReqQryProductGroup(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryProductGroup, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_128ReqQryProductGroup(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryProductGroup, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryProductGroup", 0);

  /* "ptp/TraderApi.pyx":1386
 *   def  ReqQryProductGroup(self, pQryProductGroup, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1387
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1388
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1389
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1389, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1389, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1389, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1390
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1390, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1390, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1390, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1390, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1390, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1390, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1390, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1390, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1390, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1390, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1391
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1391, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1391, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1391, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1391, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1391, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1393
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryProductGroup)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1394
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryProductGroup)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryProductGroup(<CThostFtdcQryProductGroupField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1394, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1394, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryProductGroup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1394, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryProductGroup};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1394, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryProductGroup};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1394, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1394, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryProductGroup);
            __Pyx_GIVEREF(__pyx_v_pQryProductGroup);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryProductGroup);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1394, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1394, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1395
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryProductGroup)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryProductGroup(<CThostFtdcQryProductGroupField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1396
 *         address = ctypes.addressof(pQryProductGroup)
 *         with nogil:
 *           result = self._api.ReqQryProductGroup(<CThostFtdcQryProductGroupField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryProductGroup(((struct CThostFtdcQryProductGroupField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1396, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1395
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryProductGroup)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryProductGroup(<CThostFtdcQryProductGroupField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1393
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryProductGroup)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1398
 *           result = self._api.ReqQryProductGroup(<CThostFtdcQryProductGroupField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryProductGroup', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1398, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1398, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1398, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1398, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1398, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1388
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1399
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryProductGroup', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryProductGroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1399, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1400
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryProductGroup', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1400, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1400, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1400, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1400, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1400, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__64, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1400, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1399
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryProductGroup', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1388
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1402
 *       myEnv.logger.error('ReqQryProductGroup', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1384
 * 
 *   #
 *   def  ReqQryProductGroup(self, pQryProductGroup, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryProductGroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1406
 * 
 *   #
 *   def  ReqQryMMInstrumentCommissionRate(self, pQryMMInstrumentCommissionRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_131ReqQryMMInstrumentCommissionRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_131ReqQryMMInstrumentCommissionRate = {"ReqQryMMInstrumentCommissionRate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_131ReqQryMMInstrumentCommissionRate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_131ReqQryMMInstrumentCommissionRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryMMInstrumentCommissionRate = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryMMInstrumentCommissionRate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryMMInstrumentCommissionRate,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryMMInstrumentCommissionRate)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryMMInstrumentCommissionRate", 1, 2, 2, 1); __PYX_ERR(0, 1406, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryMMInstrumentCommissionRate") < 0)) __PYX_ERR(0, 1406, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryMMInstrumentCommissionRate = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1406, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryMMInstrumentCommissionRate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1406, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryMMInstrumentCommissionRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_130ReqQryMMInstrumentCommissionRate(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryMMInstrumentCommissionRate, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_130ReqQryMMInstrumentCommissionRate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryMMInstrumentCommissionRate, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryMMInstrumentCommissionRate", 0);

  /* "ptp/TraderApi.pyx":1408
 *   def  ReqQryMMInstrumentCommissionRate(self, pQryMMInstrumentCommissionRate, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1409
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1410
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1411
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1411, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1411, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1411, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1412
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1412, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1412, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1412, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1412, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1412, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1412, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1412, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1412, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1412, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1412, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1413
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1413, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1413, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1413, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1413, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1413, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1415
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryMMInstrumentCommissionRate)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1416
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryMMInstrumentCommissionRate)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryMMInstrumentCommissionRate(<CThostFtdcQryMMInstrumentCommissionRateField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1416, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1416, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryMMInstrumentCommissionRate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1416, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryMMInstrumentCommissionRate};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1416, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryMMInstrumentCommissionRate};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1416, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1416, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryMMInstrumentCommissionRate);
            __Pyx_GIVEREF(__pyx_v_pQryMMInstrumentCommissionRate);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryMMInstrumentCommissionRate);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1416, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1416, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1417
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryMMInstrumentCommissionRate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryMMInstrumentCommissionRate(<CThostFtdcQryMMInstrumentCommissionRateField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1418
 *         address = ctypes.addressof(pQryMMInstrumentCommissionRate)
 *         with nogil:
 *           result = self._api.ReqQryMMInstrumentCommissionRate(<CThostFtdcQryMMInstrumentCommissionRateField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryMMInstrumentCommissionRate(((struct CThostFtdcQryMMInstrumentCommissionRateField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1418, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1417
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryMMInstrumentCommissionRate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryMMInstrumentCommissionRate(<CThostFtdcQryMMInstrumentCommissionRateField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1415
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryMMInstrumentCommissionRate)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1420
 *           result = self._api.ReqQryMMInstrumentCommissionRate(<CThostFtdcQryMMInstrumentCommissionRateField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryMMInstrumentCommissionRate', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1420, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1420, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1420, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1420, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1420, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1410
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1421
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryMMInstrumentCommissionRate', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryMMInstrumentCommissionRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1421, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1422
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryMMInstrumentCommissionRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1422, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1422, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1422, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1422, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1422, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__65, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1422, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1421
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryMMInstrumentCommissionRate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1410
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1424
 *       myEnv.logger.error('ReqQryMMInstrumentCommissionRate', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1406
 * 
 *   #
 *   def  ReqQryMMInstrumentCommissionRate(self, pQryMMInstrumentCommissionRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryMMInstrumentCommissionRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1428
 * 
 *   #
 *   def  ReqQryMMOptionInstrCommRate(self, pQryMMOptionInstrCommRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_133ReqQryMMOptionInstrCommRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_133ReqQryMMOptionInstrCommRate = {"ReqQryMMOptionInstrCommRate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_133ReqQryMMOptionInstrCommRate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_133ReqQryMMOptionInstrCommRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryMMOptionInstrCommRate = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryMMOptionInstrCommRate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryMMOptionInstrCommRate,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryMMOptionInstrCommRate)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryMMOptionInstrCommRate", 1, 2, 2, 1); __PYX_ERR(0, 1428, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryMMOptionInstrCommRate") < 0)) __PYX_ERR(0, 1428, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryMMOptionInstrCommRate = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1428, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryMMOptionInstrCommRate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1428, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryMMOptionInstrCommRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_132ReqQryMMOptionInstrCommRate(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryMMOptionInstrCommRate, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_132ReqQryMMOptionInstrCommRate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryMMOptionInstrCommRate, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryMMOptionInstrCommRate", 0);

  /* "ptp/TraderApi.pyx":1430
 *   def  ReqQryMMOptionInstrCommRate(self, pQryMMOptionInstrCommRate, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1431
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1432
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1433
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1433, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1433, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1433, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1434
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1434, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1434, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1434, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1434, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1434, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1434, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1434, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1434, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1434, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1434, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1435
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1435, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1435, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1435, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1435, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1435, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1437
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryMMOptionInstrCommRate)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1438
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryMMOptionInstrCommRate)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryMMOptionInstrCommRate(<CThostFtdcQryMMOptionInstrCommRateField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1438, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1438, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryMMOptionInstrCommRate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1438, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryMMOptionInstrCommRate};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1438, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryMMOptionInstrCommRate};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1438, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1438, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryMMOptionInstrCommRate);
            __Pyx_GIVEREF(__pyx_v_pQryMMOptionInstrCommRate);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryMMOptionInstrCommRate);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1438, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1438, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1439
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryMMOptionInstrCommRate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryMMOptionInstrCommRate(<CThostFtdcQryMMOptionInstrCommRateField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1440
 *         address = ctypes.addressof(pQryMMOptionInstrCommRate)
 *         with nogil:
 *           result = self._api.ReqQryMMOptionInstrCommRate(<CThostFtdcQryMMOptionInstrCommRateField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryMMOptionInstrCommRate(((struct CThostFtdcQryMMOptionInstrCommRateField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1440, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1439
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryMMOptionInstrCommRate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryMMOptionInstrCommRate(<CThostFtdcQryMMOptionInstrCommRateField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1437
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryMMOptionInstrCommRate)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1442
 *           result = self._api.ReqQryMMOptionInstrCommRate(<CThostFtdcQryMMOptionInstrCommRateField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryMMOptionInstrCommRate', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1442, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1442, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1442, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1442, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1442, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1432
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1443
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryMMOptionInstrCommRate', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryMMOptionInstrCommRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1443, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1444
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryMMOptionInstrCommRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1444, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1444, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1444, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1444, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1444, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__66, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1444, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1443
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryMMOptionInstrCommRate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1432
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1446
 *       myEnv.logger.error('ReqQryMMOptionInstrCommRate', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1428
 * 
 *   #
 *   def  ReqQryMMOptionInstrCommRate(self, pQryMMOptionInstrCommRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryMMOptionInstrCommRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1450
 * 
 *   #
 *   def  ReqQryInstrumentOrderCommRate(self, pQryInstrumentOrderCommRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_135ReqQryInstrumentOrderCommRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_135ReqQryInstrumentOrderCommRate = {"ReqQryInstrumentOrderCommRate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_135ReqQryInstrumentOrderCommRate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_135ReqQryInstrumentOrderCommRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryInstrumentOrderCommRate = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryInstrumentOrderCommRate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryInstrumentOrderCommRate,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryInstrumentOrderCommRate)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryInstrumentOrderCommRate", 1, 2, 2, 1); __PYX_ERR(0, 1450, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryInstrumentOrderCommRate") < 0)) __PYX_ERR(0, 1450, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryInstrumentOrderCommRate = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1450, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryInstrumentOrderCommRate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1450, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInstrumentOrderCommRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_134ReqQryInstrumentOrderCommRate(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryInstrumentOrderCommRate, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_134ReqQryInstrumentOrderCommRate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryInstrumentOrderCommRate, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryInstrumentOrderCommRate", 0);

  /* "ptp/TraderApi.pyx":1452
 *   def  ReqQryInstrumentOrderCommRate(self, pQryInstrumentOrderCommRate, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1453
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1454
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1455
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1455, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1455, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1455, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1456
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1456, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1456, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1456, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1456, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1456, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1456, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1456, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1456, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1456, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1456, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1457
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1457, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1457, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1457, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1457, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1457, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1459
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryInstrumentOrderCommRate)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1460
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInstrumentOrderCommRate)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryInstrumentOrderCommRate(<CThostFtdcQryInstrumentOrderCommRateField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1460, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1460, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryInstrumentOrderCommRate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1460, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryInstrumentOrderCommRate};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1460, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryInstrumentOrderCommRate};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1460, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1460, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryInstrumentOrderCommRate);
            __Pyx_GIVEREF(__pyx_v_pQryInstrumentOrderCommRate);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryInstrumentOrderCommRate);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1460, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1460, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1461
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInstrumentOrderCommRate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryInstrumentOrderCommRate(<CThostFtdcQryInstrumentOrderCommRateField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1462
 *         address = ctypes.addressof(pQryInstrumentOrderCommRate)
 *         with nogil:
 *           result = self._api.ReqQryInstrumentOrderCommRate(<CThostFtdcQryInstrumentOrderCommRateField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryInstrumentOrderCommRate(((struct CThostFtdcQryInstrumentOrderCommRateField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1462, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1461
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInstrumentOrderCommRate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryInstrumentOrderCommRate(<CThostFtdcQryInstrumentOrderCommRateField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1459
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryInstrumentOrderCommRate)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1464
 *           result = self._api.ReqQryInstrumentOrderCommRate(<CThostFtdcQryInstrumentOrderCommRateField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInstrumentOrderCommRate', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1464, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1464, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1464, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1464, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1464, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1454
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1465
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryInstrumentOrderCommRate', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInstrumentOrderCommRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1465, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1466
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInstrumentOrderCommRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1466, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1466, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1466, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1466, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1466, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__67, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1466, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1465
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryInstrumentOrderCommRate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1454
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1468
 *       myEnv.logger.error('ReqQryInstrumentOrderCommRate', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1450
 * 
 *   #
 *   def  ReqQryInstrumentOrderCommRate(self, pQryInstrumentOrderCommRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInstrumentOrderCommRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1472
 * 
 *   #
 *   def  ReqQrySecAgentTradingAccount(self, pQryTradingAccount, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_137ReqQrySecAgentTradingAccount(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_137ReqQrySecAgentTradingAccount = {"ReqQrySecAgentTradingAccount", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_137ReqQrySecAgentTradingAccount, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_137ReqQrySecAgentTradingAccount(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryTradingAccount = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQrySecAgentTradingAccount (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryTradingAccount,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryTradingAccount)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQrySecAgentTradingAccount", 1, 2, 2, 1); __PYX_ERR(0, 1472, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQrySecAgentTradingAccount") < 0)) __PYX_ERR(0, 1472, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryTradingAccount = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1472, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQrySecAgentTradingAccount", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1472, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQrySecAgentTradingAccount", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_136ReqQrySecAgentTradingAccount(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryTradingAccount, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_136ReqQrySecAgentTradingAccount(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryTradingAccount, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQrySecAgentTradingAccount", 0);

  /* "ptp/TraderApi.pyx":1474
 *   def  ReqQrySecAgentTradingAccount(self, pQryTradingAccount, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1475
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1476
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1477
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1477, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1477, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1477, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1478
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1478, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1478, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1478, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1478, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1478, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1478, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1478, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1478, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1478, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1478, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1479
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1479, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1479, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1479, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1479, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1479, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1481
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryTradingAccount)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1482
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryTradingAccount)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQrySecAgentTradingAccount(<CThostFtdcQryTradingAccountField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1482, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1482, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryTradingAccount); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryTradingAccount};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryTradingAccount};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1482, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryTradingAccount);
            __Pyx_GIVEREF(__pyx_v_pQryTradingAccount);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryTradingAccount);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1482, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1483
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryTradingAccount)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQrySecAgentTradingAccount(<CThostFtdcQryTradingAccountField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1484
 *         address = ctypes.addressof(pQryTradingAccount)
 *         with nogil:
 *           result = self._api.ReqQrySecAgentTradingAccount(<CThostFtdcQryTradingAccountField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQrySecAgentTradingAccount(((struct CThostFtdcQryTradingAccountField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1484, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1483
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryTradingAccount)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQrySecAgentTradingAccount(<CThostFtdcQryTradingAccountField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1481
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryTradingAccount)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1486
 *           result = self._api.ReqQrySecAgentTradingAccount(<CThostFtdcQryTradingAccountField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQrySecAgentTradingAccount', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1486, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1486, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1486, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1486, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1486, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1476
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1487
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQrySecAgentTradingAccount', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQrySecAgentTradingAccount", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1487, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1488
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQrySecAgentTradingAccount', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1488, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1488, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1488, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1488, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1488, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__68, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1488, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1487
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQrySecAgentTradingAccount', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1476
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1490
 *       myEnv.logger.error('ReqQrySecAgentTradingAccount', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1472
 * 
 *   #
 *   def  ReqQrySecAgentTradingAccount(self, pQryTradingAccount, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQrySecAgentTradingAccount", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1494
 * 
 *   #
 *   def  ReqQrySecAgentCheckMode(self, pQrySecAgentCheckMode, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_139ReqQrySecAgentCheckMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_139ReqQrySecAgentCheckMode = {"ReqQrySecAgentCheckMode", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_139ReqQrySecAgentCheckMode, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_139ReqQrySecAgentCheckMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQrySecAgentCheckMode = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQrySecAgentCheckMode (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQrySecAgentCheckMode,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQrySecAgentCheckMode)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQrySecAgentCheckMode", 1, 2, 2, 1); __PYX_ERR(0, 1494, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQrySecAgentCheckMode") < 0)) __PYX_ERR(0, 1494, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQrySecAgentCheckMode = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1494, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQrySecAgentCheckMode", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1494, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQrySecAgentCheckMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_138ReqQrySecAgentCheckMode(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQrySecAgentCheckMode, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_138ReqQrySecAgentCheckMode(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQrySecAgentCheckMode, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQrySecAgentCheckMode", 0);

  /* "ptp/TraderApi.pyx":1496
 *   def  ReqQrySecAgentCheckMode(self, pQrySecAgentCheckMode, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1497
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1498
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1499
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1499, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1499, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1499, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1500
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1500, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1500, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1500, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1500, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1500, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1500, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1500, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1500, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1500, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1500, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1501
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1501, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1501, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1501, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1501, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1501, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1503
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQrySecAgentCheckMode)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1504
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQrySecAgentCheckMode)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQrySecAgentCheckMode(<CThostFtdcQrySecAgentCheckModeField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1504, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1504, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQrySecAgentCheckMode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1504, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQrySecAgentCheckMode};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1504, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQrySecAgentCheckMode};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1504, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1504, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQrySecAgentCheckMode);
            __Pyx_GIVEREF(__pyx_v_pQrySecAgentCheckMode);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQrySecAgentCheckMode);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1504, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1504, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1505
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQrySecAgentCheckMode)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQrySecAgentCheckMode(<CThostFtdcQrySecAgentCheckModeField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1506
 *         address = ctypes.addressof(pQrySecAgentCheckMode)
 *         with nogil:
 *           result = self._api.ReqQrySecAgentCheckMode(<CThostFtdcQrySecAgentCheckModeField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQrySecAgentCheckMode(((struct CThostFtdcQrySecAgentCheckModeField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1506, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1505
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQrySecAgentCheckMode)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQrySecAgentCheckMode(<CThostFtdcQrySecAgentCheckModeField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1503
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQrySecAgentCheckMode)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1508
 *           result = self._api.ReqQrySecAgentCheckMode(<CThostFtdcQrySecAgentCheckModeField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQrySecAgentCheckMode', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1508, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1508, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1508, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1508, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1508, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1498
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1509
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQrySecAgentCheckMode', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQrySecAgentCheckMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1509, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1510
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQrySecAgentCheckMode', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1510, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1510, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1510, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1510, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1510, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__69, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1510, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1509
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQrySecAgentCheckMode', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1498
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1512
 *       myEnv.logger.error('ReqQrySecAgentCheckMode', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1494
 * 
 *   #
 *   def  ReqQrySecAgentCheckMode(self, pQrySecAgentCheckMode, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQrySecAgentCheckMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1516
 * 
 *   #
 *   def  ReqQryOptionInstrTradeCost(self, pQryOptionInstrTradeCost, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_141ReqQryOptionInstrTradeCost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_141ReqQryOptionInstrTradeCost = {"ReqQryOptionInstrTradeCost", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_141ReqQryOptionInstrTradeCost, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_141ReqQryOptionInstrTradeCost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryOptionInstrTradeCost = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryOptionInstrTradeCost (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryOptionInstrTradeCost,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryOptionInstrTradeCost)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryOptionInstrTradeCost", 1, 2, 2, 1); __PYX_ERR(0, 1516, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryOptionInstrTradeCost") < 0)) __PYX_ERR(0, 1516, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryOptionInstrTradeCost = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1516, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryOptionInstrTradeCost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1516, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryOptionInstrTradeCost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_140ReqQryOptionInstrTradeCost(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryOptionInstrTradeCost, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_140ReqQryOptionInstrTradeCost(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryOptionInstrTradeCost, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryOptionInstrTradeCost", 0);

  /* "ptp/TraderApi.pyx":1518
 *   def  ReqQryOptionInstrTradeCost(self, pQryOptionInstrTradeCost, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1519
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1520
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1521
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1521, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1521, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1521, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1522
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1522, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1522, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1522, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1522, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1522, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1522, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1522, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1522, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1522, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1522, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1523
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1523, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1523, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1523, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1523, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1523, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1525
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryOptionInstrTradeCost)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1526
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryOptionInstrTradeCost)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryOptionInstrTradeCost(<CThostFtdcQryOptionInstrTradeCostField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1526, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1526, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryOptionInstrTradeCost); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1526, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryOptionInstrTradeCost};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1526, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryOptionInstrTradeCost};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1526, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1526, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryOptionInstrTradeCost);
            __Pyx_GIVEREF(__pyx_v_pQryOptionInstrTradeCost);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryOptionInstrTradeCost);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1526, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1526, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1527
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryOptionInstrTradeCost)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryOptionInstrTradeCost(<CThostFtdcQryOptionInstrTradeCostField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1528
 *         address = ctypes.addressof(pQryOptionInstrTradeCost)
 *         with nogil:
 *           result = self._api.ReqQryOptionInstrTradeCost(<CThostFtdcQryOptionInstrTradeCostField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryOptionInstrTradeCost(((struct CThostFtdcQryOptionInstrTradeCostField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1528, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1527
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryOptionInstrTradeCost)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryOptionInstrTradeCost(<CThostFtdcQryOptionInstrTradeCostField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1525
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryOptionInstrTradeCost)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1530
 *           result = self._api.ReqQryOptionInstrTradeCost(<CThostFtdcQryOptionInstrTradeCostField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryOptionInstrTradeCost', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1530, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1530, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1530, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1530, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1530, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1520
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1531
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryOptionInstrTradeCost', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryOptionInstrTradeCost", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1531, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1532
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryOptionInstrTradeCost', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1532, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1532, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1532, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1532, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1532, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__70, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1532, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1531
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryOptionInstrTradeCost', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1520
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1534
 *       myEnv.logger.error('ReqQryOptionInstrTradeCost', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1516
 * 
 *   #
 *   def  ReqQryOptionInstrTradeCost(self, pQryOptionInstrTradeCost, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryOptionInstrTradeCost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1538
 * 
 *   #
 *   def  ReqQryOptionInstrCommRate(self, pQryOptionInstrCommRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_143ReqQryOptionInstrCommRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_143ReqQryOptionInstrCommRate = {"ReqQryOptionInstrCommRate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_143ReqQryOptionInstrCommRate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_143ReqQryOptionInstrCommRate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryOptionInstrCommRate = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryOptionInstrCommRate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryOptionInstrCommRate,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryOptionInstrCommRate)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryOptionInstrCommRate", 1, 2, 2, 1); __PYX_ERR(0, 1538, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryOptionInstrCommRate") < 0)) __PYX_ERR(0, 1538, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryOptionInstrCommRate = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1538, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryOptionInstrCommRate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1538, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryOptionInstrCommRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_142ReqQryOptionInstrCommRate(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryOptionInstrCommRate, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_142ReqQryOptionInstrCommRate(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryOptionInstrCommRate, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryOptionInstrCommRate", 0);

  /* "ptp/TraderApi.pyx":1540
 *   def  ReqQryOptionInstrCommRate(self, pQryOptionInstrCommRate, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1541
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1542
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1543
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1543, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1543, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1543, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1544
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1544, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1544, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1544, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1544, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1544, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1544, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1544, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1544, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1544, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1544, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1545
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1545, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1545, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1545, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1545, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1545, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1547
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryOptionInstrCommRate)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1548
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryOptionInstrCommRate)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryOptionInstrCommRate(<CThostFtdcQryOptionInstrCommRateField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1548, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1548, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryOptionInstrCommRate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1548, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryOptionInstrCommRate};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1548, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryOptionInstrCommRate};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1548, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1548, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryOptionInstrCommRate);
            __Pyx_GIVEREF(__pyx_v_pQryOptionInstrCommRate);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryOptionInstrCommRate);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1548, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1548, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1549
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryOptionInstrCommRate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryOptionInstrCommRate(<CThostFtdcQryOptionInstrCommRateField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1550
 *         address = ctypes.addressof(pQryOptionInstrCommRate)
 *         with nogil:
 *           result = self._api.ReqQryOptionInstrCommRate(<CThostFtdcQryOptionInstrCommRateField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryOptionInstrCommRate(((struct CThostFtdcQryOptionInstrCommRateField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1550, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1549
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryOptionInstrCommRate)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryOptionInstrCommRate(<CThostFtdcQryOptionInstrCommRateField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1547
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryOptionInstrCommRate)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1552
 *           result = self._api.ReqQryOptionInstrCommRate(<CThostFtdcQryOptionInstrCommRateField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryOptionInstrCommRate', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1552, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1552, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1552, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1552, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1552, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1542
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1553
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryOptionInstrCommRate', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryOptionInstrCommRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1553, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1554
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryOptionInstrCommRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1554, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1554, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1554, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1554, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1554, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__71, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1554, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1553
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryOptionInstrCommRate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1542
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1556
 *       myEnv.logger.error('ReqQryOptionInstrCommRate', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1538
 * 
 *   #
 *   def  ReqQryOptionInstrCommRate(self, pQryOptionInstrCommRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryOptionInstrCommRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1560
 * 
 *   #
 *   def  ReqQryExecOrder(self, pQryExecOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_145ReqQryExecOrder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_145ReqQryExecOrder = {"ReqQryExecOrder", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_145ReqQryExecOrder, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_145ReqQryExecOrder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryExecOrder = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryExecOrder (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryExecOrder,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryExecOrder)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryExecOrder", 1, 2, 2, 1); __PYX_ERR(0, 1560, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryExecOrder") < 0)) __PYX_ERR(0, 1560, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryExecOrder = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1560, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryExecOrder", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1560, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryExecOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_144ReqQryExecOrder(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryExecOrder, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_144ReqQryExecOrder(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryExecOrder, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryExecOrder", 0);

  /* "ptp/TraderApi.pyx":1562
 *   def  ReqQryExecOrder(self, pQryExecOrder, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1563
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1564
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1565
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1565, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1565, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1565, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1566
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1566, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1566, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1566, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1566, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1566, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1566, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1566, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1566, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1566, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1566, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1567
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1567, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1567, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1567, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1567, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1567, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1569
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryExecOrder)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1570
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryExecOrder)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryExecOrder(<CThostFtdcQryExecOrderField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1570, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1570, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryExecOrder); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1570, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryExecOrder};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1570, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryExecOrder};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1570, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1570, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryExecOrder);
            __Pyx_GIVEREF(__pyx_v_pQryExecOrder);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryExecOrder);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1570, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1570, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1571
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryExecOrder)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryExecOrder(<CThostFtdcQryExecOrderField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1572
 *         address = ctypes.addressof(pQryExecOrder)
 *         with nogil:
 *           result = self._api.ReqQryExecOrder(<CThostFtdcQryExecOrderField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryExecOrder(((struct CThostFtdcQryExecOrderField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1572, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1571
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryExecOrder)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryExecOrder(<CThostFtdcQryExecOrderField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1569
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryExecOrder)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1574
 *           result = self._api.ReqQryExecOrder(<CThostFtdcQryExecOrderField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryExecOrder', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1574, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1574, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1574, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1574, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1574, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1564
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1575
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryExecOrder', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryExecOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1575, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1576
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryExecOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1576, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1576, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1576, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1576, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1576, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__72, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1576, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1575
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryExecOrder', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1564
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1578
 *       myEnv.logger.error('ReqQryExecOrder', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1560
 * 
 *   #
 *   def  ReqQryExecOrder(self, pQryExecOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryExecOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1582
 * 
 *   #
 *   def  ReqQryForQuote(self, pQryForQuote, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_147ReqQryForQuote(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_147ReqQryForQuote = {"ReqQryForQuote", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_147ReqQryForQuote, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_147ReqQryForQuote(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryForQuote = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryForQuote (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryForQuote,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryForQuote)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryForQuote", 1, 2, 2, 1); __PYX_ERR(0, 1582, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryForQuote") < 0)) __PYX_ERR(0, 1582, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryForQuote = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1582, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryForQuote", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1582, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryForQuote", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_146ReqQryForQuote(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryForQuote, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_146ReqQryForQuote(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryForQuote, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryForQuote", 0);

  /* "ptp/TraderApi.pyx":1584
 *   def  ReqQryForQuote(self, pQryForQuote, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1585
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1586
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1587
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1587, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1587, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1587, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1588
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1588, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1588, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1588, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1588, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1588, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1588, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1588, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1588, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1588, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1588, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1589
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1589, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1589, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1589, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1589, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1589, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1591
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryForQuote)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1592
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryForQuote)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryForQuote(<CThostFtdcQryForQuoteField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1592, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1592, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryForQuote); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1592, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryForQuote};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1592, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryForQuote};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1592, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1592, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryForQuote);
            __Pyx_GIVEREF(__pyx_v_pQryForQuote);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryForQuote);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1592, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1592, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1593
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryForQuote)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryForQuote(<CThostFtdcQryForQuoteField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1594
 *         address = ctypes.addressof(pQryForQuote)
 *         with nogil:
 *           result = self._api.ReqQryForQuote(<CThostFtdcQryForQuoteField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryForQuote(((struct CThostFtdcQryForQuoteField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1594, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1593
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryForQuote)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryForQuote(<CThostFtdcQryForQuoteField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1591
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryForQuote)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1596
 *           result = self._api.ReqQryForQuote(<CThostFtdcQryForQuoteField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryForQuote', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1596, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1596, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1596, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1596, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1596, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1586
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1597
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryForQuote', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryForQuote", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1597, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1598
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryForQuote', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1598, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1598, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1598, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1598, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1598, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__73, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1598, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1597
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryForQuote', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1586
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1600
 *       myEnv.logger.error('ReqQryForQuote', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1582
 * 
 *   #
 *   def  ReqQryForQuote(self, pQryForQuote, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryForQuote", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1604
 * 
 *   #
 *   def  ReqQryQuote(self, pQryQuote, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_149ReqQryQuote(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_149ReqQryQuote = {"ReqQryQuote", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_149ReqQryQuote, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_149ReqQryQuote(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryQuote = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryQuote (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryQuote,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryQuote)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryQuote", 1, 2, 2, 1); __PYX_ERR(0, 1604, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryQuote") < 0)) __PYX_ERR(0, 1604, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryQuote = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1604, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryQuote", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1604, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryQuote", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_148ReqQryQuote(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryQuote, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_148ReqQryQuote(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryQuote, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryQuote", 0);

  /* "ptp/TraderApi.pyx":1606
 *   def  ReqQryQuote(self, pQryQuote, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1607
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1608
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1609
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1609, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1609, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1609, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1610
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1610, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1610, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1610, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1610, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1610, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1610, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1610, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1610, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1610, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1610, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1611
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1611, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1611, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1611, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1611, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1611, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1613
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryQuote)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1614
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryQuote)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryQuote(<CThostFtdcQryQuoteField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1614, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1614, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryQuote); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1614, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryQuote};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1614, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryQuote};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1614, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1614, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryQuote);
            __Pyx_GIVEREF(__pyx_v_pQryQuote);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryQuote);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1614, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1614, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1615
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryQuote)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryQuote(<CThostFtdcQryQuoteField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1616
 *         address = ctypes.addressof(pQryQuote)
 *         with nogil:
 *           result = self._api.ReqQryQuote(<CThostFtdcQryQuoteField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryQuote(((struct CThostFtdcQryQuoteField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1616, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1615
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryQuote)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryQuote(<CThostFtdcQryQuoteField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1613
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryQuote)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1618
 *           result = self._api.ReqQryQuote(<CThostFtdcQryQuoteField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryQuote', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1618, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1618, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1618, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1618, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1618, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1608
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1619
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryQuote', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryQuote", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1619, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1620
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryQuote', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1620, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1620, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1620, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1620, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1620, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__74, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1620, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1619
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryQuote', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1608
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1622
 *       myEnv.logger.error('ReqQryQuote', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1604
 * 
 *   #
 *   def  ReqQryQuote(self, pQryQuote, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryQuote", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1626
 * 
 *   #
 *   def  ReqQryOptionSelfClose(self, pQryOptionSelfClose, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_151ReqQryOptionSelfClose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_151ReqQryOptionSelfClose = {"ReqQryOptionSelfClose", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_151ReqQryOptionSelfClose, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_151ReqQryOptionSelfClose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryOptionSelfClose = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryOptionSelfClose (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryOptionSelfClose,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryOptionSelfClose)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryOptionSelfClose", 1, 2, 2, 1); __PYX_ERR(0, 1626, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryOptionSelfClose") < 0)) __PYX_ERR(0, 1626, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryOptionSelfClose = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1626, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryOptionSelfClose", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1626, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryOptionSelfClose", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_150ReqQryOptionSelfClose(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryOptionSelfClose, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_150ReqQryOptionSelfClose(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryOptionSelfClose, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryOptionSelfClose", 0);

  /* "ptp/TraderApi.pyx":1628
 *   def  ReqQryOptionSelfClose(self, pQryOptionSelfClose, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1629
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1630
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1631
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1631, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1631, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1631, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1632
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1632, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1632, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1632, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1632, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1632, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1632, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1632, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1632, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1632, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1632, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1633
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1633, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1633, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1633, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1633, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1633, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1635
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryOptionSelfClose)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1636
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryOptionSelfClose)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryOptionSelfClose(<CThostFtdcQryOptionSelfCloseField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1636, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1636, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryOptionSelfClose); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1636, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryOptionSelfClose};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1636, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryOptionSelfClose};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1636, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1636, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryOptionSelfClose);
            __Pyx_GIVEREF(__pyx_v_pQryOptionSelfClose);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryOptionSelfClose);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1636, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1636, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1637
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryOptionSelfClose)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryOptionSelfClose(<CThostFtdcQryOptionSelfCloseField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1638
 *         address = ctypes.addressof(pQryOptionSelfClose)
 *         with nogil:
 *           result = self._api.ReqQryOptionSelfClose(<CThostFtdcQryOptionSelfCloseField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryOptionSelfClose(((struct CThostFtdcQryOptionSelfCloseField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1638, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1637
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryOptionSelfClose)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryOptionSelfClose(<CThostFtdcQryOptionSelfCloseField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1635
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryOptionSelfClose)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1640
 *           result = self._api.ReqQryOptionSelfClose(<CThostFtdcQryOptionSelfCloseField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryOptionSelfClose', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1640, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1640, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1640, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1640, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1640, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1630
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1641
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryOptionSelfClose', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryOptionSelfClose", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1641, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1642
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryOptionSelfClose', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1642, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1642, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1642, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1642, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1642, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__75, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1642, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1641
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryOptionSelfClose', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1630
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1644
 *       myEnv.logger.error('ReqQryOptionSelfClose', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1626
 * 
 *   #
 *   def  ReqQryOptionSelfClose(self, pQryOptionSelfClose, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryOptionSelfClose", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1648
 * 
 *   #
 *   def  ReqQryInvestUnit(self, pQryInvestUnit, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_153ReqQryInvestUnit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_153ReqQryInvestUnit = {"ReqQryInvestUnit", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_153ReqQryInvestUnit, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_153ReqQryInvestUnit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryInvestUnit = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryInvestUnit (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryInvestUnit,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryInvestUnit)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryInvestUnit", 1, 2, 2, 1); __PYX_ERR(0, 1648, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryInvestUnit") < 0)) __PYX_ERR(0, 1648, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryInvestUnit = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1648, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryInvestUnit", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1648, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInvestUnit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_152ReqQryInvestUnit(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryInvestUnit, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_152ReqQryInvestUnit(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryInvestUnit, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryInvestUnit", 0);

  /* "ptp/TraderApi.pyx":1650
 *   def  ReqQryInvestUnit(self, pQryInvestUnit, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1651
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1652
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1653
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1653, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1653, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1653, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1654
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1654, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1654, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1654, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1654, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1654, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1654, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1654, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1654, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1654, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1654, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1655
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1655, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1655, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1655, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1655, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1655, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1657
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryInvestUnit)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1658
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInvestUnit)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryInvestUnit(<CThostFtdcQryInvestUnitField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1658, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1658, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryInvestUnit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1658, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryInvestUnit};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1658, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryInvestUnit};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1658, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1658, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryInvestUnit);
            __Pyx_GIVEREF(__pyx_v_pQryInvestUnit);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryInvestUnit);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1658, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1658, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1659
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInvestUnit)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryInvestUnit(<CThostFtdcQryInvestUnitField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1660
 *         address = ctypes.addressof(pQryInvestUnit)
 *         with nogil:
 *           result = self._api.ReqQryInvestUnit(<CThostFtdcQryInvestUnitField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryInvestUnit(((struct CThostFtdcQryInvestUnitField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1660, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1659
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryInvestUnit)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryInvestUnit(<CThostFtdcQryInvestUnitField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1657
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryInvestUnit)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1662
 *           result = self._api.ReqQryInvestUnit(<CThostFtdcQryInvestUnitField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInvestUnit', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1662, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1662, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1662, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1662, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1662, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1652
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1663
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryInvestUnit', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInvestUnit", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1663, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1664
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInvestUnit', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1664, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1664, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1664, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1664, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1664, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__76, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1664, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1663
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryInvestUnit', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1652
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1666
 *       myEnv.logger.error('ReqQryInvestUnit', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1648
 * 
 *   #
 *   def  ReqQryInvestUnit(self, pQryInvestUnit, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryInvestUnit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1670
 * 
 *   #
 *   def  ReqQryCombInstrumentGuard(self, pQryCombInstrumentGuard, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_155ReqQryCombInstrumentGuard(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_155ReqQryCombInstrumentGuard = {"ReqQryCombInstrumentGuard", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_155ReqQryCombInstrumentGuard, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_155ReqQryCombInstrumentGuard(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryCombInstrumentGuard = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryCombInstrumentGuard (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryCombInstrumentGuard,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryCombInstrumentGuard)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryCombInstrumentGuard", 1, 2, 2, 1); __PYX_ERR(0, 1670, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryCombInstrumentGuard") < 0)) __PYX_ERR(0, 1670, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryCombInstrumentGuard = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1670, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryCombInstrumentGuard", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1670, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryCombInstrumentGuard", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_154ReqQryCombInstrumentGuard(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryCombInstrumentGuard, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_154ReqQryCombInstrumentGuard(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryCombInstrumentGuard, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryCombInstrumentGuard", 0);

  /* "ptp/TraderApi.pyx":1672
 *   def  ReqQryCombInstrumentGuard(self, pQryCombInstrumentGuard, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1673
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1674
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1675
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1675, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1675, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1675, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1676
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1676, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1676, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1676, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1676, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1676, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1676, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1676, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1676, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1676, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1676, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1677
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1677, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1677, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1677, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1677, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1677, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1679
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryCombInstrumentGuard)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1680
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryCombInstrumentGuard)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryCombInstrumentGuard(<CThostFtdcQryCombInstrumentGuardField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1680, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1680, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryCombInstrumentGuard); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1680, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryCombInstrumentGuard};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1680, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryCombInstrumentGuard};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1680, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1680, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryCombInstrumentGuard);
            __Pyx_GIVEREF(__pyx_v_pQryCombInstrumentGuard);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryCombInstrumentGuard);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1680, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1680, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1681
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryCombInstrumentGuard)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryCombInstrumentGuard(<CThostFtdcQryCombInstrumentGuardField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1682
 *         address = ctypes.addressof(pQryCombInstrumentGuard)
 *         with nogil:
 *           result = self._api.ReqQryCombInstrumentGuard(<CThostFtdcQryCombInstrumentGuardField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryCombInstrumentGuard(((struct CThostFtdcQryCombInstrumentGuardField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1682, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1681
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryCombInstrumentGuard)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryCombInstrumentGuard(<CThostFtdcQryCombInstrumentGuardField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1679
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryCombInstrumentGuard)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1684
 *           result = self._api.ReqQryCombInstrumentGuard(<CThostFtdcQryCombInstrumentGuardField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryCombInstrumentGuard', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1684, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1684, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1684, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1684, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1684, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1674
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1685
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryCombInstrumentGuard', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryCombInstrumentGuard", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1685, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1686
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryCombInstrumentGuard', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1686, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1686, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1686, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1686, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1686, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__77, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1686, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1685
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryCombInstrumentGuard', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1674
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1688
 *       myEnv.logger.error('ReqQryCombInstrumentGuard', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1670
 * 
 *   #
 *   def  ReqQryCombInstrumentGuard(self, pQryCombInstrumentGuard, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryCombInstrumentGuard", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1692
 * 
 *   #
 *   def  ReqQryCombAction(self, pQryCombAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_157ReqQryCombAction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_157ReqQryCombAction = {"ReqQryCombAction", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_157ReqQryCombAction, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_157ReqQryCombAction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryCombAction = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryCombAction (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryCombAction,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryCombAction)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryCombAction", 1, 2, 2, 1); __PYX_ERR(0, 1692, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryCombAction") < 0)) __PYX_ERR(0, 1692, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryCombAction = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1692, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryCombAction", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1692, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryCombAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_156ReqQryCombAction(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryCombAction, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_156ReqQryCombAction(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryCombAction, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryCombAction", 0);

  /* "ptp/TraderApi.pyx":1694
 *   def  ReqQryCombAction(self, pQryCombAction, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1695
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1696
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1697
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1697, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1697, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1697, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1698
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1698, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1698, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1698, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1698, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1698, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1698, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1698, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1698, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1698, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1698, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1699
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1699, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1699, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1699, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1699, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1699, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1701
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryCombAction)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1702
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryCombAction)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryCombAction(<CThostFtdcQryCombActionField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1702, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1702, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryCombAction); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1702, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryCombAction};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1702, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryCombAction};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1702, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1702, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryCombAction);
            __Pyx_GIVEREF(__pyx_v_pQryCombAction);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryCombAction);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1702, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1702, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1703
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryCombAction)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryCombAction(<CThostFtdcQryCombActionField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1704
 *         address = ctypes.addressof(pQryCombAction)
 *         with nogil:
 *           result = self._api.ReqQryCombAction(<CThostFtdcQryCombActionField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryCombAction(((struct CThostFtdcQryCombActionField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1704, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1703
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryCombAction)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryCombAction(<CThostFtdcQryCombActionField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1701
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryCombAction)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1706
 *           result = self._api.ReqQryCombAction(<CThostFtdcQryCombActionField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryCombAction', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1706, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1706, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1706, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1706, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1706, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1696
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1707
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryCombAction', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryCombAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1707, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1708
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryCombAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1708, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1708, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1708, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1708, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1708, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__78, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1708, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1707
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryCombAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1696
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1710
 *       myEnv.logger.error('ReqQryCombAction', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1692
 * 
 *   #
 *   def  ReqQryCombAction(self, pQryCombAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryCombAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1714
 * 
 *   #
 *   def  ReqQryTransferSerial(self, pQryTransferSerial, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_159ReqQryTransferSerial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_159ReqQryTransferSerial = {"ReqQryTransferSerial", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_159ReqQryTransferSerial, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_159ReqQryTransferSerial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryTransferSerial = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryTransferSerial (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryTransferSerial,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryTransferSerial)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryTransferSerial", 1, 2, 2, 1); __PYX_ERR(0, 1714, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryTransferSerial") < 0)) __PYX_ERR(0, 1714, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryTransferSerial = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1714, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryTransferSerial", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1714, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryTransferSerial", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_158ReqQryTransferSerial(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryTransferSerial, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_158ReqQryTransferSerial(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryTransferSerial, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryTransferSerial", 0);

  /* "ptp/TraderApi.pyx":1716
 *   def  ReqQryTransferSerial(self, pQryTransferSerial, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1717
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1718
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1719
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1719, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1719, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1719, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1720
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1720, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1720, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1720, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1720, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1720, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1720, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1720, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1720, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1720, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1720, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1721
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1721, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1721, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1721, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1721, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1721, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1723
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryTransferSerial)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1724
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryTransferSerial)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryTransferSerial(<CThostFtdcQryTransferSerialField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1724, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1724, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryTransferSerial); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1724, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryTransferSerial};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1724, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryTransferSerial};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1724, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1724, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryTransferSerial);
            __Pyx_GIVEREF(__pyx_v_pQryTransferSerial);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryTransferSerial);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1724, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1724, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1725
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryTransferSerial)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryTransferSerial(<CThostFtdcQryTransferSerialField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1726
 *         address = ctypes.addressof(pQryTransferSerial)
 *         with nogil:
 *           result = self._api.ReqQryTransferSerial(<CThostFtdcQryTransferSerialField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryTransferSerial(((struct CThostFtdcQryTransferSerialField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1726, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1725
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryTransferSerial)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryTransferSerial(<CThostFtdcQryTransferSerialField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1723
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryTransferSerial)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1728
 *           result = self._api.ReqQryTransferSerial(<CThostFtdcQryTransferSerialField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryTransferSerial', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1728, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1728, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1728, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1728, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1728, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1718
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1729
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryTransferSerial', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryTransferSerial", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1729, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1730
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryTransferSerial', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1730, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1730, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1730, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1730, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1730, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__79, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1730, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1729
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryTransferSerial', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1718
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1732
 *       myEnv.logger.error('ReqQryTransferSerial', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1714
 * 
 *   #
 *   def  ReqQryTransferSerial(self, pQryTransferSerial, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryTransferSerial", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1736
 * 
 *   #
 *   def  ReqQryAccountregister(self, pQryAccountregister, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_161ReqQryAccountregister(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_161ReqQryAccountregister = {"ReqQryAccountregister", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_161ReqQryAccountregister, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_161ReqQryAccountregister(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryAccountregister = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryAccountregister (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryAccountregister,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryAccountregister)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryAccountregister", 1, 2, 2, 1); __PYX_ERR(0, 1736, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryAccountregister") < 0)) __PYX_ERR(0, 1736, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryAccountregister = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1736, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryAccountregister", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1736, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryAccountregister", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_160ReqQryAccountregister(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryAccountregister, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_160ReqQryAccountregister(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryAccountregister, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryAccountregister", 0);

  /* "ptp/TraderApi.pyx":1738
 *   def  ReqQryAccountregister(self, pQryAccountregister, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1739
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1740
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1741
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1741, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1741, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1741, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1742
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1742, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1742, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1742, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1742, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1742, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1742, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1742, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1742, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1742, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1742, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1743
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1743, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1743, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1743, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1743, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1743, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1745
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryAccountregister)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1746
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryAccountregister)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryAccountregister(<CThostFtdcQryAccountregisterField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1746, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1746, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryAccountregister); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1746, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryAccountregister};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1746, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryAccountregister};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1746, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1746, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryAccountregister);
            __Pyx_GIVEREF(__pyx_v_pQryAccountregister);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryAccountregister);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1746, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1746, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1747
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryAccountregister)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryAccountregister(<CThostFtdcQryAccountregisterField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1748
 *         address = ctypes.addressof(pQryAccountregister)
 *         with nogil:
 *           result = self._api.ReqQryAccountregister(<CThostFtdcQryAccountregisterField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryAccountregister(((struct CThostFtdcQryAccountregisterField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1748, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1747
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryAccountregister)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryAccountregister(<CThostFtdcQryAccountregisterField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1745
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryAccountregister)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1750
 *           result = self._api.ReqQryAccountregister(<CThostFtdcQryAccountregisterField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryAccountregister', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1750, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1750, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1750, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1750, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1750, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1740
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1751
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryAccountregister', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryAccountregister", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1751, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1752
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryAccountregister', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1752, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1752, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1752, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1752, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1752, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__80, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1752, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1751
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryAccountregister', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1740
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1754
 *       myEnv.logger.error('ReqQryAccountregister', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1736
 * 
 *   #
 *   def  ReqQryAccountregister(self, pQryAccountregister, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryAccountregister", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1758
 * 
 *   #
 *   def  ReqQryContractBank(self, pQryContractBank, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_163ReqQryContractBank(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_163ReqQryContractBank = {"ReqQryContractBank", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_163ReqQryContractBank, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_163ReqQryContractBank(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryContractBank = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryContractBank (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryContractBank,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryContractBank)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryContractBank", 1, 2, 2, 1); __PYX_ERR(0, 1758, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryContractBank") < 0)) __PYX_ERR(0, 1758, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryContractBank = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1758, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryContractBank", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1758, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryContractBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_162ReqQryContractBank(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryContractBank, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_162ReqQryContractBank(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryContractBank, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryContractBank", 0);

  /* "ptp/TraderApi.pyx":1760
 *   def  ReqQryContractBank(self, pQryContractBank, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1761
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1762
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1763
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1763, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1763, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1763, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1764
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1764, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1764, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1764, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1764, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1764, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1764, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1764, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1764, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1764, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1764, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1765
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1765, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1765, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1765, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1765, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1765, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1767
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryContractBank)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1768
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryContractBank)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryContractBank(<CThostFtdcQryContractBankField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1768, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1768, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryContractBank); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1768, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryContractBank};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1768, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryContractBank};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1768, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1768, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryContractBank);
            __Pyx_GIVEREF(__pyx_v_pQryContractBank);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryContractBank);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1768, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1768, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1769
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryContractBank)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryContractBank(<CThostFtdcQryContractBankField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1770
 *         address = ctypes.addressof(pQryContractBank)
 *         with nogil:
 *           result = self._api.ReqQryContractBank(<CThostFtdcQryContractBankField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryContractBank(((struct CThostFtdcQryContractBankField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1770, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1769
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryContractBank)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryContractBank(<CThostFtdcQryContractBankField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1767
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryContractBank)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1772
 *           result = self._api.ReqQryContractBank(<CThostFtdcQryContractBankField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryContractBank', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1772, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1772, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1772, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1772, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1772, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1762
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1773
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryContractBank', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryContractBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1773, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1774
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryContractBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1774, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1774, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1774, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1774, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1774, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__81, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1774, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1773
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryContractBank', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1762
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1776
 *       myEnv.logger.error('ReqQryContractBank', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1758
 * 
 *   #
 *   def  ReqQryContractBank(self, pQryContractBank, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryContractBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1780
 * 
 *   #
 *   def  ReqQryParkedOrder(self, pQryParkedOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_165ReqQryParkedOrder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_165ReqQryParkedOrder = {"ReqQryParkedOrder", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_165ReqQryParkedOrder, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_165ReqQryParkedOrder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryParkedOrder = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryParkedOrder (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryParkedOrder,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryParkedOrder)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryParkedOrder", 1, 2, 2, 1); __PYX_ERR(0, 1780, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryParkedOrder") < 0)) __PYX_ERR(0, 1780, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryParkedOrder = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1780, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryParkedOrder", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1780, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryParkedOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_164ReqQryParkedOrder(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryParkedOrder, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_164ReqQryParkedOrder(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryParkedOrder, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryParkedOrder", 0);

  /* "ptp/TraderApi.pyx":1782
 *   def  ReqQryParkedOrder(self, pQryParkedOrder, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1783
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1784
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1785
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1785, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1785, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1785, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1786
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1786, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1786, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1786, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1786, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1786, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1786, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1786, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1786, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1786, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1786, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1787
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1787, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1787, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1787, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1787, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1787, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1789
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryParkedOrder)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1790
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryParkedOrder)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryParkedOrder(<CThostFtdcQryParkedOrderField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1790, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1790, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryParkedOrder); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1790, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryParkedOrder};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1790, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryParkedOrder};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1790, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1790, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryParkedOrder);
            __Pyx_GIVEREF(__pyx_v_pQryParkedOrder);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryParkedOrder);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1790, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1790, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1791
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryParkedOrder)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryParkedOrder(<CThostFtdcQryParkedOrderField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1792
 *         address = ctypes.addressof(pQryParkedOrder)
 *         with nogil:
 *           result = self._api.ReqQryParkedOrder(<CThostFtdcQryParkedOrderField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryParkedOrder(((struct CThostFtdcQryParkedOrderField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1792, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1791
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryParkedOrder)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryParkedOrder(<CThostFtdcQryParkedOrderField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1789
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryParkedOrder)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1794
 *           result = self._api.ReqQryParkedOrder(<CThostFtdcQryParkedOrderField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryParkedOrder', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1794, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1794, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1794, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1794, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1794, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1784
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1795
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryParkedOrder', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryParkedOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1795, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1796
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryParkedOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1796, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1796, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1796, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1796, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1796, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__82, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1796, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1795
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryParkedOrder', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1784
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1798
 *       myEnv.logger.error('ReqQryParkedOrder', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1780
 * 
 *   #
 *   def  ReqQryParkedOrder(self, pQryParkedOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryParkedOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1802
 * 
 *   #
 *   def  ReqQryParkedOrderAction(self, pQryParkedOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_167ReqQryParkedOrderAction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_167ReqQryParkedOrderAction = {"ReqQryParkedOrderAction", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_167ReqQryParkedOrderAction, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_167ReqQryParkedOrderAction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryParkedOrderAction = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryParkedOrderAction (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryParkedOrderAction,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryParkedOrderAction)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryParkedOrderAction", 1, 2, 2, 1); __PYX_ERR(0, 1802, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryParkedOrderAction") < 0)) __PYX_ERR(0, 1802, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryParkedOrderAction = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1802, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryParkedOrderAction", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1802, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryParkedOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_166ReqQryParkedOrderAction(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryParkedOrderAction, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_166ReqQryParkedOrderAction(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryParkedOrderAction, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryParkedOrderAction", 0);

  /* "ptp/TraderApi.pyx":1804
 *   def  ReqQryParkedOrderAction(self, pQryParkedOrderAction, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1805
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1806
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1807
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1807, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1807, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1807, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1808
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1808, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1808, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1808, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1808, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1808, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1808, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1808, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1808, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1808, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1808, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1809
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1809, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1809, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1809, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1809, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1809, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1811
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryParkedOrderAction)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1812
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryParkedOrderAction)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryParkedOrderAction(<CThostFtdcQryParkedOrderActionField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1812, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1812, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryParkedOrderAction); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1812, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryParkedOrderAction};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1812, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryParkedOrderAction};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1812, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1812, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryParkedOrderAction);
            __Pyx_GIVEREF(__pyx_v_pQryParkedOrderAction);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryParkedOrderAction);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1812, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1812, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1813
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryParkedOrderAction)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryParkedOrderAction(<CThostFtdcQryParkedOrderActionField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1814
 *         address = ctypes.addressof(pQryParkedOrderAction)
 *         with nogil:
 *           result = self._api.ReqQryParkedOrderAction(<CThostFtdcQryParkedOrderActionField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryParkedOrderAction(((struct CThostFtdcQryParkedOrderActionField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1814, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1813
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryParkedOrderAction)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryParkedOrderAction(<CThostFtdcQryParkedOrderActionField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1811
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryParkedOrderAction)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1816
 *           result = self._api.ReqQryParkedOrderAction(<CThostFtdcQryParkedOrderActionField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryParkedOrderAction', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1816, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1816, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1816, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1816, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1816, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1806
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1817
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryParkedOrderAction', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryParkedOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1817, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1818
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryParkedOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1818, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1818, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1818, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1818, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1818, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__83, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1818, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1817
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryParkedOrderAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1806
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1820
 *       myEnv.logger.error('ReqQryParkedOrderAction', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1802
 * 
 *   #
 *   def  ReqQryParkedOrderAction(self, pQryParkedOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryParkedOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1824
 * 
 *   #
 *   def  ReqQryTradingNotice(self, pQryTradingNotice, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_169ReqQryTradingNotice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_169ReqQryTradingNotice = {"ReqQryTradingNotice", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_169ReqQryTradingNotice, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_169ReqQryTradingNotice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryTradingNotice = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryTradingNotice (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryTradingNotice,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryTradingNotice)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryTradingNotice", 1, 2, 2, 1); __PYX_ERR(0, 1824, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryTradingNotice") < 0)) __PYX_ERR(0, 1824, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryTradingNotice = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1824, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryTradingNotice", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1824, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryTradingNotice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_168ReqQryTradingNotice(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryTradingNotice, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_168ReqQryTradingNotice(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryTradingNotice, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryTradingNotice", 0);

  /* "ptp/TraderApi.pyx":1826
 *   def  ReqQryTradingNotice(self, pQryTradingNotice, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1827
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1828
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1829
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1829, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1829, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1829, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1830
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1830, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1830, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1830, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1830, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1830, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1830, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1830, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1830, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1830, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1830, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1831
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1831, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1831, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1831, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1831, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1831, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1833
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryTradingNotice)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1834
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryTradingNotice)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryTradingNotice(<CThostFtdcQryTradingNoticeField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1834, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1834, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryTradingNotice); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1834, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryTradingNotice};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1834, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryTradingNotice};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1834, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1834, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryTradingNotice);
            __Pyx_GIVEREF(__pyx_v_pQryTradingNotice);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryTradingNotice);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1834, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1834, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1835
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryTradingNotice)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryTradingNotice(<CThostFtdcQryTradingNoticeField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1836
 *         address = ctypes.addressof(pQryTradingNotice)
 *         with nogil:
 *           result = self._api.ReqQryTradingNotice(<CThostFtdcQryTradingNoticeField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryTradingNotice(((struct CThostFtdcQryTradingNoticeField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1836, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1835
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryTradingNotice)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryTradingNotice(<CThostFtdcQryTradingNoticeField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1833
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryTradingNotice)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1838
 *           result = self._api.ReqQryTradingNotice(<CThostFtdcQryTradingNoticeField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryTradingNotice', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1838, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1838, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1838, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1838, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1838, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1828
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1839
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryTradingNotice', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryTradingNotice", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1839, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1840
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryTradingNotice', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1840, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1840, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1840, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1840, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1840, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__84, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1840, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1839
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryTradingNotice', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1828
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1842
 *       myEnv.logger.error('ReqQryTradingNotice', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1824
 * 
 *   #
 *   def  ReqQryTradingNotice(self, pQryTradingNotice, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryTradingNotice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1846
 * 
 *   #
 *   def  ReqQryBrokerTradingParams(self, pQryBrokerTradingParams, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_171ReqQryBrokerTradingParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_171ReqQryBrokerTradingParams = {"ReqQryBrokerTradingParams", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_171ReqQryBrokerTradingParams, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_171ReqQryBrokerTradingParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryBrokerTradingParams = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryBrokerTradingParams (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryBrokerTradingParams,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryBrokerTradingParams)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryBrokerTradingParams", 1, 2, 2, 1); __PYX_ERR(0, 1846, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryBrokerTradingParams") < 0)) __PYX_ERR(0, 1846, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryBrokerTradingParams = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1846, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryBrokerTradingParams", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1846, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryBrokerTradingParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_170ReqQryBrokerTradingParams(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryBrokerTradingParams, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_170ReqQryBrokerTradingParams(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryBrokerTradingParams, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryBrokerTradingParams", 0);

  /* "ptp/TraderApi.pyx":1848
 *   def  ReqQryBrokerTradingParams(self, pQryBrokerTradingParams, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1849
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1850
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1851
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1851, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1851, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1851, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1852
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1852, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1852, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1852, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1852, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1852, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1852, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1852, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1852, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1852, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1852, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1853
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1853, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1853, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1853, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1853, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1853, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1855
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryBrokerTradingParams)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1856
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryBrokerTradingParams)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryBrokerTradingParams(<CThostFtdcQryBrokerTradingParamsField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1856, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1856, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryBrokerTradingParams); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1856, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryBrokerTradingParams};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1856, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryBrokerTradingParams};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1856, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1856, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryBrokerTradingParams);
            __Pyx_GIVEREF(__pyx_v_pQryBrokerTradingParams);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryBrokerTradingParams);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1856, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1856, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1857
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryBrokerTradingParams)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryBrokerTradingParams(<CThostFtdcQryBrokerTradingParamsField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1858
 *         address = ctypes.addressof(pQryBrokerTradingParams)
 *         with nogil:
 *           result = self._api.ReqQryBrokerTradingParams(<CThostFtdcQryBrokerTradingParamsField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryBrokerTradingParams(((struct CThostFtdcQryBrokerTradingParamsField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1858, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1857
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryBrokerTradingParams)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryBrokerTradingParams(<CThostFtdcQryBrokerTradingParamsField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1855
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryBrokerTradingParams)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1860
 *           result = self._api.ReqQryBrokerTradingParams(<CThostFtdcQryBrokerTradingParamsField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryBrokerTradingParams', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1860, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1860, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1860, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1860, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1860, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1850
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1861
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryBrokerTradingParams', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryBrokerTradingParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1861, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1862
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryBrokerTradingParams', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1862, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1862, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1862, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1862, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1862, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__85, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1862, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1861
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryBrokerTradingParams', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1850
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1864
 *       myEnv.logger.error('ReqQryBrokerTradingParams', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1846
 * 
 *   #
 *   def  ReqQryBrokerTradingParams(self, pQryBrokerTradingParams, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryBrokerTradingParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1868
 * 
 *   #
 *   def  ReqQryBrokerTradingAlgos(self, pQryBrokerTradingAlgos, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_173ReqQryBrokerTradingAlgos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_173ReqQryBrokerTradingAlgos = {"ReqQryBrokerTradingAlgos", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_173ReqQryBrokerTradingAlgos, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_173ReqQryBrokerTradingAlgos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQryBrokerTradingAlgos = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQryBrokerTradingAlgos (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQryBrokerTradingAlgos,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQryBrokerTradingAlgos)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQryBrokerTradingAlgos", 1, 2, 2, 1); __PYX_ERR(0, 1868, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQryBrokerTradingAlgos") < 0)) __PYX_ERR(0, 1868, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQryBrokerTradingAlgos = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1868, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQryBrokerTradingAlgos", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1868, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryBrokerTradingAlgos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_172ReqQryBrokerTradingAlgos(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQryBrokerTradingAlgos, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_172ReqQryBrokerTradingAlgos(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQryBrokerTradingAlgos, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQryBrokerTradingAlgos", 0);

  /* "ptp/TraderApi.pyx":1870
 *   def  ReqQryBrokerTradingAlgos(self, pQryBrokerTradingAlgos, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1871
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1872
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1873
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1873, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1873, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1873, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1874
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1874, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1874, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1874, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1874, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1874, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1874, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1874, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1874, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1874, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1874, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1875
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1875, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1875, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1875, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1875, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1875, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1877
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryBrokerTradingAlgos)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1878
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryBrokerTradingAlgos)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQryBrokerTradingAlgos(<CThostFtdcQryBrokerTradingAlgosField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1878, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1878, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQryBrokerTradingAlgos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1878, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryBrokerTradingAlgos};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1878, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQryBrokerTradingAlgos};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1878, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1878, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQryBrokerTradingAlgos);
            __Pyx_GIVEREF(__pyx_v_pQryBrokerTradingAlgos);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQryBrokerTradingAlgos);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1878, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1878, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1879
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryBrokerTradingAlgos)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryBrokerTradingAlgos(<CThostFtdcQryBrokerTradingAlgosField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1880
 *         address = ctypes.addressof(pQryBrokerTradingAlgos)
 *         with nogil:
 *           result = self._api.ReqQryBrokerTradingAlgos(<CThostFtdcQryBrokerTradingAlgosField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQryBrokerTradingAlgos(((struct CThostFtdcQryBrokerTradingAlgosField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1880, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1879
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQryBrokerTradingAlgos)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQryBrokerTradingAlgos(<CThostFtdcQryBrokerTradingAlgosField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1877
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQryBrokerTradingAlgos)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1882
 *           result = self._api.ReqQryBrokerTradingAlgos(<CThostFtdcQryBrokerTradingAlgosField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryBrokerTradingAlgos', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1882, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1882, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1882, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1882, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1882, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1872
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1883
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryBrokerTradingAlgos', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryBrokerTradingAlgos", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1883, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1884
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryBrokerTradingAlgos', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1884, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1884, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1884, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1884, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1884, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__86, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1884, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1883
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQryBrokerTradingAlgos', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1872
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1886
 *       myEnv.logger.error('ReqQryBrokerTradingAlgos', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1868
 * 
 *   #
 *   def  ReqQryBrokerTradingAlgos(self, pQryBrokerTradingAlgos, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQryBrokerTradingAlgos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1890
 * 
 *   #
 *   def  ReqQueryCFMMCTradingAccountToken(self, pQueryCFMMCTradingAccountToken, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_175ReqQueryCFMMCTradingAccountToken(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_175ReqQueryCFMMCTradingAccountToken = {"ReqQueryCFMMCTradingAccountToken", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_175ReqQueryCFMMCTradingAccountToken, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_175ReqQueryCFMMCTradingAccountToken(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pQueryCFMMCTradingAccountToken = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQueryCFMMCTradingAccountToken (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pQueryCFMMCTradingAccountToken,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pQueryCFMMCTradingAccountToken)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQueryCFMMCTradingAccountToken", 1, 2, 2, 1); __PYX_ERR(0, 1890, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQueryCFMMCTradingAccountToken") < 0)) __PYX_ERR(0, 1890, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pQueryCFMMCTradingAccountToken = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1890, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQueryCFMMCTradingAccountToken", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1890, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQueryCFMMCTradingAccountToken", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_174ReqQueryCFMMCTradingAccountToken(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pQueryCFMMCTradingAccountToken, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_174ReqQueryCFMMCTradingAccountToken(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pQueryCFMMCTradingAccountToken, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQueryCFMMCTradingAccountToken", 0);

  /* "ptp/TraderApi.pyx":1892
 *   def  ReqQueryCFMMCTradingAccountToken(self, pQueryCFMMCTradingAccountToken, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1893
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1894
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1895
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1895, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1895, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1895, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1896
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1896, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1896, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1896, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1896, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1896, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1896, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1896, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1896, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1896, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1896, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1897
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1897, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1897, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1897, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1897, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1897, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1899
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQueryCFMMCTradingAccountToken)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1900
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQueryCFMMCTradingAccountToken)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQueryCFMMCTradingAccountToken(<CThostFtdcQueryCFMMCTradingAccountTokenField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1900, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1900, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pQueryCFMMCTradingAccountToken); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1900, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQueryCFMMCTradingAccountToken};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1900, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pQueryCFMMCTradingAccountToken};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1900, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1900, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pQueryCFMMCTradingAccountToken);
            __Pyx_GIVEREF(__pyx_v_pQueryCFMMCTradingAccountToken);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pQueryCFMMCTradingAccountToken);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1900, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1900, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1901
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQueryCFMMCTradingAccountToken)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQueryCFMMCTradingAccountToken(<CThostFtdcQueryCFMMCTradingAccountTokenField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1902
 *         address = ctypes.addressof(pQueryCFMMCTradingAccountToken)
 *         with nogil:
 *           result = self._api.ReqQueryCFMMCTradingAccountToken(<CThostFtdcQueryCFMMCTradingAccountTokenField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQueryCFMMCTradingAccountToken(((struct CThostFtdcQueryCFMMCTradingAccountTokenField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1902, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1901
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pQueryCFMMCTradingAccountToken)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQueryCFMMCTradingAccountToken(<CThostFtdcQueryCFMMCTradingAccountTokenField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1899
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pQueryCFMMCTradingAccountToken)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1904
 *           result = self._api.ReqQueryCFMMCTradingAccountToken(<CThostFtdcQueryCFMMCTradingAccountTokenField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQueryCFMMCTradingAccountToken', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1904, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1904, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1904, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1904, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1904, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1894
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1905
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQueryCFMMCTradingAccountToken', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQueryCFMMCTradingAccountToken", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1905, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1906
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQueryCFMMCTradingAccountToken', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1906, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1906, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1906, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1906, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1906, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__87, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1906, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1905
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQueryCFMMCTradingAccountToken', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1894
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1908
 *       myEnv.logger.error('ReqQueryCFMMCTradingAccountToken', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1890
 * 
 *   #
 *   def  ReqQueryCFMMCTradingAccountToken(self, pQueryCFMMCTradingAccountToken, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQueryCFMMCTradingAccountToken", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1912
 * 
 *   #
 *   def  ReqFromBankToFutureByFuture(self, pReqTransfer, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_177ReqFromBankToFutureByFuture(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_177ReqFromBankToFutureByFuture = {"ReqFromBankToFutureByFuture", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_177ReqFromBankToFutureByFuture, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_177ReqFromBankToFutureByFuture(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pReqTransfer = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqFromBankToFutureByFuture (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pReqTransfer,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pReqTransfer)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqFromBankToFutureByFuture", 1, 2, 2, 1); __PYX_ERR(0, 1912, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqFromBankToFutureByFuture") < 0)) __PYX_ERR(0, 1912, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pReqTransfer = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1912, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqFromBankToFutureByFuture", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1912, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqFromBankToFutureByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_176ReqFromBankToFutureByFuture(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pReqTransfer, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_176ReqFromBankToFutureByFuture(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pReqTransfer, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqFromBankToFutureByFuture", 0);

  /* "ptp/TraderApi.pyx":1914
 *   def  ReqFromBankToFutureByFuture(self, pReqTransfer, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1915
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1916
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1917
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1917, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1917, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1917, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1918
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1918, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1918, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1918, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1918, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1918, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1918, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1918, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1918, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1918, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1918, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1919
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1919, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1919, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1919, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1919, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1919, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1922
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pReqTransfer)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1923
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pReqTransfer)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqFromBankToFutureByFuture(<CThostFtdcReqTransferField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1923, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1923, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pReqTransfer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1923, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pReqTransfer};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1923, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pReqTransfer};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1923, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1923, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pReqTransfer);
            __Pyx_GIVEREF(__pyx_v_pReqTransfer);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pReqTransfer);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1923, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1923, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1924
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pReqTransfer)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqFromBankToFutureByFuture(<CThostFtdcReqTransferField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1925
 *         address = ctypes.addressof(pReqTransfer)
 *         with nogil:
 *           result = self._api.ReqFromBankToFutureByFuture(<CThostFtdcReqTransferField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqFromBankToFutureByFuture(((struct CThostFtdcReqTransferField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1925, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1924
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pReqTransfer)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqFromBankToFutureByFuture(<CThostFtdcReqTransferField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1922
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pReqTransfer)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1927
 *           result = self._api.ReqFromBankToFutureByFuture(<CThostFtdcReqTransferField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqFromBankToFutureByFuture', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1927, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1927, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1927, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1927, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1927, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1916
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1928
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqFromBankToFutureByFuture', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqFromBankToFutureByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1928, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1929
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqFromBankToFutureByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1929, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1929, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1929, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1929, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1929, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__88, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1929, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1928
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqFromBankToFutureByFuture', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1916
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1931
 *       myEnv.logger.error('ReqFromBankToFutureByFuture', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1912
 * 
 *   #
 *   def  ReqFromBankToFutureByFuture(self, pReqTransfer, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqFromBankToFutureByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1935
 * 
 *   #
 *   def  ReqFromFutureToBankByFuture(self, pReqTransfer, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_179ReqFromFutureToBankByFuture(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_179ReqFromFutureToBankByFuture = {"ReqFromFutureToBankByFuture", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_179ReqFromFutureToBankByFuture, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_179ReqFromFutureToBankByFuture(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pReqTransfer = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqFromFutureToBankByFuture (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pReqTransfer,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pReqTransfer)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqFromFutureToBankByFuture", 1, 2, 2, 1); __PYX_ERR(0, 1935, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqFromFutureToBankByFuture") < 0)) __PYX_ERR(0, 1935, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pReqTransfer = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1935, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqFromFutureToBankByFuture", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1935, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqFromFutureToBankByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_178ReqFromFutureToBankByFuture(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pReqTransfer, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_178ReqFromFutureToBankByFuture(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pReqTransfer, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqFromFutureToBankByFuture", 0);

  /* "ptp/TraderApi.pyx":1937
 *   def  ReqFromFutureToBankByFuture(self, pReqTransfer, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1938
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1939
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1940
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1940, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1940, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1940, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1941
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1941, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1941, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1941, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1941, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1941, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1941, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1941, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1941, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1941, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1941, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1942
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1942, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1942, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1942, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1942, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1942, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1945
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pReqTransfer)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1946
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pReqTransfer)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqFromFutureToBankByFuture(<CThostFtdcReqTransferField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1946, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1946, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pReqTransfer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1946, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pReqTransfer};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1946, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pReqTransfer};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1946, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1946, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pReqTransfer);
            __Pyx_GIVEREF(__pyx_v_pReqTransfer);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pReqTransfer);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1946, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1946, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1947
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pReqTransfer)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqFromFutureToBankByFuture(<CThostFtdcReqTransferField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1948
 *         address = ctypes.addressof(pReqTransfer)
 *         with nogil:
 *           result = self._api.ReqFromFutureToBankByFuture(<CThostFtdcReqTransferField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqFromFutureToBankByFuture(((struct CThostFtdcReqTransferField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1948, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1947
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pReqTransfer)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqFromFutureToBankByFuture(<CThostFtdcReqTransferField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1945
 * 
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pReqTransfer)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1950
 *           result = self._api.ReqFromFutureToBankByFuture(<CThostFtdcReqTransferField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqFromFutureToBankByFuture', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1950, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1950, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1950, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1950, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1950, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1939
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1951
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqFromFutureToBankByFuture', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqFromFutureToBankByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1951, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1952
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqFromFutureToBankByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1952, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1952, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1952, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1952, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1952, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__89, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1952, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1951
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqFromFutureToBankByFuture', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1939
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1954
 *       myEnv.logger.error('ReqFromFutureToBankByFuture', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1935
 * 
 *   #
 *   def  ReqFromFutureToBankByFuture(self, pReqTransfer, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqFromFutureToBankByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1958
 * 
 *   #
 *   def  ReqQueryBankAccountMoneyByFuture(self, pReqQueryAccount, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_181ReqQueryBankAccountMoneyByFuture(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_181ReqQueryBankAccountMoneyByFuture = {"ReqQueryBankAccountMoneyByFuture", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_181ReqQueryBankAccountMoneyByFuture, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_181ReqQueryBankAccountMoneyByFuture(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pReqQueryAccount = 0;
  int __pyx_v_nRequestID;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReqQueryBankAccountMoneyByFuture (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pReqQueryAccount,&__pyx_n_s_nRequestID,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pReqQueryAccount)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nRequestID)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReqQueryBankAccountMoneyByFuture", 1, 2, 2, 1); __PYX_ERR(0, 1958, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReqQueryBankAccountMoneyByFuture") < 0)) __PYX_ERR(0, 1958, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_pReqQueryAccount = values[0];
    __pyx_v_nRequestID = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nRequestID == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1958, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReqQueryBankAccountMoneyByFuture", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1958, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQueryBankAccountMoneyByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_180ReqQueryBankAccountMoneyByFuture(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), __pyx_v_pReqQueryAccount, __pyx_v_nRequestID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_180ReqQueryBankAccountMoneyByFuture(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, PyObject *__pyx_v_pReqQueryAccount, int __pyx_v_nRequestID) {
  int __pyx_v_result;
  size_t __pyx_v_address;
  PyObject *__pyx_v_dwTime = NULL;
  PyObject *__pyx_v_funName = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("ReqQueryBankAccountMoneyByFuture", 0);

  /* "ptp/TraderApi.pyx":1960
 *   def  ReqQueryBankAccountMoneyByFuture(self, pReqQueryAccount, int nRequestID):
 * 
 *     cdef int result = 0             # <<<<<<<<<<<<<<
 *     cdef size_t address = 0
 *     try:
 */
  __pyx_v_result = 0;

  /* "ptp/TraderApi.pyx":1961
 * 
 *     cdef int result = 0
 *     cdef size_t address = 0             # <<<<<<<<<<<<<<
 *     try:
 *       dwTime  = self.Inc_RequestID()
 */
  __pyx_v_address = 0;

  /* "ptp/TraderApi.pyx":1962
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1963
 *     cdef size_t address = 0
 *     try:
 *       dwTime  = self.Inc_RequestID()             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Inc_RequestID); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1963, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1963, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1963, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dwTime = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1964
 *     try:
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)             # <<<<<<<<<<<<<<
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1964, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1964, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1964, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getframe); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1964, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1964, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1964, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_f_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1964, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_co_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1964, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1964, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s_s, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1964, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_funName = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1965
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName,dwTime)             # <<<<<<<<<<<<<<
 * 
 *       if self._api is not NULL:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1965, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1965, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1965, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1965, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call);
        __Pyx_GIVEREF(__pyx_kp_u_call);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_kp_u_call);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1965, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1967
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pReqQueryAccount)
 *         with nogil:
 */
      __pyx_t_9 = ((__pyx_v_self->_api != NULL) != 0);
      if (__pyx_t_9) {

        /* "ptp/TraderApi.pyx":1968
 * 
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pReqQueryAccount)             # <<<<<<<<<<<<<<
 *         with nogil:
 *           result = self._api.ReqQueryBankAccountMoneyByFuture(<CThostFtdcReqQueryAccountField *> address, nRequestID)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1968, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_addressof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1968, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pReqQueryAccount); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1968, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pReqQueryAccount};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1968, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pReqQueryAccount};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1968, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1968, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_pReqQueryAccount);
            __Pyx_GIVEREF(__pyx_v_pReqQueryAccount);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pReqQueryAccount);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1968, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1968, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_address = __pyx_t_10;

        /* "ptp/TraderApi.pyx":1969
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pReqQueryAccount)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQueryBankAccountMoneyByFuture(<CThostFtdcReqQueryAccountField *> address, nRequestID)
 * 
 */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            __Pyx_FastGIL_Remember();
            #endif
            /*try:*/ {

              /* "ptp/TraderApi.pyx":1970
 *         address = ctypes.addressof(pReqQueryAccount)
 *         with nogil:
 *           result = self._api.ReqQueryBankAccountMoneyByFuture(<CThostFtdcReqQueryAccountField *> address, nRequestID)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 */
              try {
                __pyx_t_8 = __pyx_v_self->_api->ReqQueryBankAccountMoneyByFuture(((struct CThostFtdcReqQueryAccountField *)__pyx_v_address), __pyx_v_nRequestID);
              } catch(...) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
                #endif
                __Pyx_CppExn2PyErr();
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 1970, __pyx_L11_error)
              }
              __pyx_v_result = __pyx_t_8;
            }

            /* "ptp/TraderApi.pyx":1969
 *       if self._api is not NULL:
 *         address = ctypes.addressof(pReqQueryAccount)
 *         with nogil:             # <<<<<<<<<<<<<<
 *           result = self._api.ReqQueryBankAccountMoneyByFuture(<CThostFtdcReqQueryAccountField *> address, nRequestID)
 * 
 */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L12;
              }
              __pyx_L11_error: {
                #ifdef WITH_THREAD
                __Pyx_FastGIL_Forget();
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L3_error;
              }
              __pyx_L12:;
            }
        }

        /* "ptp/TraderApi.pyx":1967
 *       printString("TraderApicall_stack","call->",funName,dwTime)
 * 
 *       if self._api is not NULL:             # <<<<<<<<<<<<<<
 *         address = ctypes.addressof(pReqQueryAccount)
 *         with nogil:
 */
      }

      /* "ptp/TraderApi.pyx":1972
 *           result = self._api.ReqQueryBankAccountMoneyByFuture(<CThostFtdcReqQueryAccountField *> address, nRequestID)
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *       myEnv.logger.error('ReqQueryBankAccountMoneyByFuture', exc_info=True)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_printString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1972, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1972, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_n_u_TraderApicall_stack, __pyx_kp_u_call_2, __pyx_v_funName, __pyx_v_dwTime};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1972, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1972, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_TraderApicall_stack);
        __Pyx_GIVEREF(__pyx_n_u_TraderApicall_stack);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_TraderApicall_stack);
        __Pyx_INCREF(__pyx_kp_u_call_2);
        __Pyx_GIVEREF(__pyx_kp_u_call_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_call_2);
        __Pyx_INCREF(__pyx_v_funName);
        __Pyx_GIVEREF(__pyx_v_funName);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_funName);
        __Pyx_INCREF(__pyx_v_dwTime);
        __Pyx_GIVEREF(__pyx_v_dwTime);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_dwTime);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1972, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1962
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1973
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQueryBankAccountMoneyByFuture', exc_info=True)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQueryBankAccountMoneyByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1973, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1974
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQueryBankAccountMoneyByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1974, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1974, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1974, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1974, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1974, __pyx_L18_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__90, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1974, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":1973
 * 
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('ReqQueryBankAccountMoneyByFuture', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L19;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L18_error:;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1962
 *     cdef int result = 0
 *     cdef size_t address = 0
 *     try:             # <<<<<<<<<<<<<<
 *       dwTime  = self.Inc_RequestID()
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1976
 *       myEnv.logger.error('ReqQueryBankAccountMoneyByFuture', exc_info=True)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1958
 * 
 *   #
 *   def  ReqQueryBankAccountMoneyByFuture(self, pReqQueryAccount, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.ReqQueryBankAccountMoneyByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dwTime);
  __Pyx_XDECREF(__pyx_v_funName);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_183__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_183__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_183__reduce_cython__, METH_NOARGS, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_183__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_182__reduce_cython__(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_182__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_185__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyMethodDef __pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_185__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_185__setstate_cython__, METH_O, 0};
static PyObject *__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_185__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_184__setstate_cython__(((struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3ptp_9TraderApi_16TraderApiWrapper_184__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("ptp.TraderApi.TraderApiWrapper.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":1982
 * 
 * """
 * cdef extern int   TraderSpi_OnFrontConnected(self) except -1:             # <<<<<<<<<<<<<<
 * 
 *   try:
 */

int TraderSpi_OnFrontConnected(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  char const *__pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnFrontConnected", 0);

  /* "ptp/TraderApi.pyx":1984
 * cdef extern int   TraderSpi_OnFrontConnected(self) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *       self.OnFrontConnected()
 *   except Exception as err:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":1985
 * 
 *   try:
 *       self.OnFrontConnected()             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnFrontConnected', exc_info=True)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnFrontConnected); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1985, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1985, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1985, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":1984
 * cdef extern int   TraderSpi_OnFrontConnected(self) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *       self.OnFrontConnected()
 *   except Exception as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":1986
 *   try:
 *       self.OnFrontConnected()
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnFrontConnected', exc_info=True)
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_7) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnFrontConnected", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 1986, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_v_err = __pyx_t_5;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":1987
 *       self.OnFrontConnected()
 *   except Exception as err:
 *       myEnv.logger.error('OnFrontConnected', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1987, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1987, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1987, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1987, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1987, __pyx_L14_error)
        __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__93, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1987, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }

      /* "ptp/TraderApi.pyx":1986
 *   try:
 *       self.OnFrontConnected()
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnFrontConnected', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L15;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L14_error:;
          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __pyx_t_7 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          }
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
          __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
          goto __pyx_L5_except_error;
        }
        __pyx_L15:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":1984
 * cdef extern int   TraderSpi_OnFrontConnected(self) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *       self.OnFrontConnected()
 *   except Exception as err:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":1989
 *       myEnv.logger.error('OnFrontConnected', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":1982
 * 
 * """
 * cdef extern int   TraderSpi_OnFrontConnected(self) except -1:             # <<<<<<<<<<<<<<
 * 
 *   try:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnFrontConnected", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2001
 * ///        0x2003
 * """
 * cdef extern int   TraderSpi_OnFrontDisconnected(self             # <<<<<<<<<<<<<<
 *     , int nReason) except -1:
 * 
 */

int TraderSpi_OnFrontDisconnected(PyObject *__pyx_v_self, int __pyx_v_nReason) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  char const *__pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnFrontDisconnected", 0);

  /* "ptp/TraderApi.pyx":2004
 *     , int nReason) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *       self.OnFrontDisconnected(nReason)
 *   except Exception as err:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2005
 * 
 *   try:
 *       self.OnFrontDisconnected(nReason)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnFrontDisconnected', exc_info=True)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnFrontDisconnected); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2005, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nReason); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2005, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2005, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2005, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2005, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2005, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
          __Pyx_GIVEREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
          __pyx_t_6 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2005, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":2004
 *     , int nReason) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *       self.OnFrontDisconnected(nReason)
 *   except Exception as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":2006
 *   try:
 *       self.OnFrontDisconnected(nReason)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnFrontDisconnected', exc_info=True)
 * 
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_9) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnFrontDisconnected", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_8) < 0) __PYX_ERR(0, 2006, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_v_err = __pyx_t_5;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2007
 *       self.OnFrontDisconnected(nReason)
 *   except Exception as err:
 *       myEnv.logger.error('OnFrontDisconnected', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2007, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2007, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2007, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2007, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2007, __pyx_L14_error)
        __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__94, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2007, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }

      /* "ptp/TraderApi.pyx":2006
 *   try:
 *       self.OnFrontDisconnected(nReason)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnFrontDisconnected', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L15;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L14_error:;
          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __pyx_t_9 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          }
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
          __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
          goto __pyx_L5_except_error;
        }
        __pyx_L15:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2004
 *     , int nReason) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *       self.OnFrontDisconnected(nReason)
 *   except Exception as err:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2009
 *       myEnv.logger.error('OnFrontDisconnected', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2001
 * ///        0x2003
 * """
 * cdef extern int   TraderSpi_OnFrontDisconnected(self             # <<<<<<<<<<<<<<
 *     , int nReason) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnFrontDisconnected", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2016
 * ///@param nTimeLapse
 * """
 * cdef extern int   TraderSpi_OnHeartBeatWarning(self             # <<<<<<<<<<<<<<
 *     , int nTimeLapse) except -1:
 * 
 */

int TraderSpi_OnHeartBeatWarning(PyObject *__pyx_v_self, int __pyx_v_nTimeLapse) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  char const *__pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnHeartBeatWarning", 0);

  /* "ptp/TraderApi.pyx":2019
 *     , int nTimeLapse) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *       self.OnHeartBeatWarning(nTimeLapse)
 *   except Exception as err:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2020
 * 
 *   try:
 *       self.OnHeartBeatWarning(nTimeLapse)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnHeartBeatWarning', exc_info=True)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnHeartBeatWarning); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2020, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nTimeLapse); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2020, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2020, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2020, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2020, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2020, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
          __Pyx_GIVEREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
          __pyx_t_6 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2020, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ptp/TraderApi.pyx":2019
 *     , int nTimeLapse) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *       self.OnHeartBeatWarning(nTimeLapse)
 *   except Exception as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ptp/TraderApi.pyx":2021
 *   try:
 *       self.OnHeartBeatWarning(nTimeLapse)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnHeartBeatWarning', exc_info=True)
 * 
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_9) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnHeartBeatWarning", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_8) < 0) __PYX_ERR(0, 2021, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_v_err = __pyx_t_5;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2022
 *       self.OnHeartBeatWarning(nTimeLapse)
 *   except Exception as err:
 *       myEnv.logger.error('OnHeartBeatWarning', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2022, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2022, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2022, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2022, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2022, __pyx_L14_error)
        __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__95, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2022, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }

      /* "ptp/TraderApi.pyx":2021
 *   try:
 *       self.OnHeartBeatWarning(nTimeLapse)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnHeartBeatWarning', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L15;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L14_error:;
          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __pyx_t_9 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          }
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
          __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
          goto __pyx_L5_except_error;
        }
        __pyx_L15:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2019
 *     , int nTimeLapse) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *       self.OnHeartBeatWarning(nTimeLapse)
 *   except Exception as err:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2024
 *       myEnv.logger.error('OnHeartBeatWarning', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2016
 * ///@param nTimeLapse
 * """
 * cdef extern int   TraderSpi_OnHeartBeatWarning(self             # <<<<<<<<<<<<<<
 *     , int nTimeLapse) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnHeartBeatWarning", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2030
 * 
 * """
 * cdef extern int   TraderSpi_OnRspAuthenticate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspAuthenticateField *pRspAuthenticateField
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspAuthenticate(PyObject *__pyx_v_self, struct CThostFtdcRspAuthenticateField *__pyx_v_pRspAuthenticateField, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspAuthenticate", 0);

  /* "ptp/TraderApi.pyx":2036
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspAuthenticateField != NULL:
 *       self.OnRspAuthenticate(None if pRspAuthenticateField is NULL else py_ApiStructure.RspAuthenticateField.from_address(<size_t> pRspAuthenticateField)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2037
 * 
 *   try:
 *     if pRspAuthenticateField != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspAuthenticate(None if pRspAuthenticateField is NULL else py_ApiStructure.RspAuthenticateField.from_address(<size_t> pRspAuthenticateField)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pRspAuthenticateField != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2038
 *   try:
 *     if pRspAuthenticateField != NULL:
 *       self.OnRspAuthenticate(None if pRspAuthenticateField is NULL else py_ApiStructure.RspAuthenticateField.from_address(<size_t> pRspAuthenticateField)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspAuthenticate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2038, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pRspAuthenticateField == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2038, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_RspAuthenticateField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2038, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2038, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspAuthenticateField)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2038, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2038, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2038, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2038, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2038, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2038, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2039
 *     if pRspAuthenticateField != NULL:
 *       self.OnRspAuthenticate(None if pRspAuthenticateField is NULL else py_ApiStructure.RspAuthenticateField.from_address(<size_t> pRspAuthenticateField)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2039, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2039, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2039, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2039, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2039, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2039, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2039, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2039, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2039, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2041
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspAuthenticate', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2041, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2041, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2038, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2038, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2038, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2038, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2037
 * 
 *   try:
 *     if pRspAuthenticateField != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspAuthenticate(None if pRspAuthenticateField is NULL else py_ApiStructure.RspAuthenticateField.from_address(<size_t> pRspAuthenticateField)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2036
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspAuthenticateField != NULL:
 *       self.OnRspAuthenticate(None if pRspAuthenticateField is NULL else py_ApiStructure.RspAuthenticateField.from_address(<size_t> pRspAuthenticateField)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2042
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspAuthenticate', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspAuthenticate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2042, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2043
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspAuthenticate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2043, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2043, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2043, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2043, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2043, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__96, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2043, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2042
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspAuthenticate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2036
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspAuthenticateField != NULL:
 *       self.OnRspAuthenticate(None if pRspAuthenticateField is NULL else py_ApiStructure.RspAuthenticateField.from_address(<size_t> pRspAuthenticateField)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2045
 *       myEnv.logger.error('OnRspAuthenticate', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2030
 * 
 * """
 * cdef extern int   TraderSpi_OnRspAuthenticate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspAuthenticateField *pRspAuthenticateField
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspAuthenticate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2051
 * 
 * """
 * cdef extern int   TraderSpi_OnRspUserLogin(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspUserLoginField *pRspUserLogin
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspUserLogin(PyObject *__pyx_v_self, struct CThostFtdcRspUserLoginField *__pyx_v_pRspUserLogin, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspUserLogin", 0);

  /* "ptp/TraderApi.pyx":2057
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspUserLogin != NULL:
 *       self.OnRspUserLogin(None if pRspUserLogin is NULL else py_ApiStructure.RspUserLoginField.from_address(<size_t> pRspUserLogin)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2058
 * 
 *   try:
 *     if pRspUserLogin != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspUserLogin(None if pRspUserLogin is NULL else py_ApiStructure.RspUserLoginField.from_address(<size_t> pRspUserLogin)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pRspUserLogin != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2059
 *   try:
 *     if pRspUserLogin != NULL:
 *       self.OnRspUserLogin(None if pRspUserLogin is NULL else py_ApiStructure.RspUserLoginField.from_address(<size_t> pRspUserLogin)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspUserLogin); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2059, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pRspUserLogin == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2059, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_RspUserLoginField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2059, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2059, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspUserLogin)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2059, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2059, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2059, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2059, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2059, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2059, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2060
 *     if pRspUserLogin != NULL:
 *       self.OnRspUserLogin(None if pRspUserLogin is NULL else py_ApiStructure.RspUserLoginField.from_address(<size_t> pRspUserLogin)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2060, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2060, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2060, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2060, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2060, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2060, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2060, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2060, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2060, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2062
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspUserLogin', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2062, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2062, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2059, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2059, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2059, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2059, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2058
 * 
 *   try:
 *     if pRspUserLogin != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspUserLogin(None if pRspUserLogin is NULL else py_ApiStructure.RspUserLoginField.from_address(<size_t> pRspUserLogin)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2057
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspUserLogin != NULL:
 *       self.OnRspUserLogin(None if pRspUserLogin is NULL else py_ApiStructure.RspUserLoginField.from_address(<size_t> pRspUserLogin)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2063
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspUserLogin', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspUserLogin", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2063, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2064
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspUserLogin', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2064, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2064, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2064, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2064, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2064, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__97, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2064, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2063
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspUserLogin', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2057
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspUserLogin != NULL:
 *       self.OnRspUserLogin(None if pRspUserLogin is NULL else py_ApiStructure.RspUserLoginField.from_address(<size_t> pRspUserLogin)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2066
 *       myEnv.logger.error('OnRspUserLogin', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2051
 * 
 * """
 * cdef extern int   TraderSpi_OnRspUserLogin(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspUserLoginField *pRspUserLogin
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspUserLogin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2072
 * 
 * """
 * cdef extern int   TraderSpi_OnRspUserLogout(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcUserLogoutField *pUserLogout
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspUserLogout(PyObject *__pyx_v_self, struct CThostFtdcUserLogoutField *__pyx_v_pUserLogout, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspUserLogout", 0);

  /* "ptp/TraderApi.pyx":2078
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pUserLogout != NULL:
 *       self.OnRspUserLogout(None if pUserLogout is NULL else py_ApiStructure.UserLogoutField.from_address(<size_t> pUserLogout)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2079
 * 
 *   try:
 *     if pUserLogout != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspUserLogout(None if pUserLogout is NULL else py_ApiStructure.UserLogoutField.from_address(<size_t> pUserLogout)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pUserLogout != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2080
 *   try:
 *     if pUserLogout != NULL:
 *       self.OnRspUserLogout(None if pUserLogout is NULL else py_ApiStructure.UserLogoutField.from_address(<size_t> pUserLogout)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspUserLogout); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2080, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pUserLogout == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2080, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_UserLogoutField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2080, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2080, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pUserLogout)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2080, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2080, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2080, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2080, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2080, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2080, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2081
 *     if pUserLogout != NULL:
 *       self.OnRspUserLogout(None if pUserLogout is NULL else py_ApiStructure.UserLogoutField.from_address(<size_t> pUserLogout)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2081, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2081, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2081, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2081, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2081, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2081, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2081, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2081, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2081, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2083
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspUserLogout', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2083, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2083, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2080, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2080, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2080, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2080, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2079
 * 
 *   try:
 *     if pUserLogout != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspUserLogout(None if pUserLogout is NULL else py_ApiStructure.UserLogoutField.from_address(<size_t> pUserLogout)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2078
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pUserLogout != NULL:
 *       self.OnRspUserLogout(None if pUserLogout is NULL else py_ApiStructure.UserLogoutField.from_address(<size_t> pUserLogout)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2084
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspUserLogout', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspUserLogout", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2084, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2085
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspUserLogout', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2085, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2085, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2085, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2085, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2085, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__98, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2085, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2084
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspUserLogout', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2078
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pUserLogout != NULL:
 *       self.OnRspUserLogout(None if pUserLogout is NULL else py_ApiStructure.UserLogoutField.from_address(<size_t> pUserLogout)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2087
 *       myEnv.logger.error('OnRspUserLogout', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2072
 * 
 * """
 * cdef extern int   TraderSpi_OnRspUserLogout(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcUserLogoutField *pUserLogout
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspUserLogout", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2093
 * 
 * """
 * cdef extern int   TraderSpi_OnRspUserPasswordUpdate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspUserPasswordUpdate(PyObject *__pyx_v_self, struct CThostFtdcUserPasswordUpdateField *__pyx_v_pUserPasswordUpdate, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspUserPasswordUpdate", 0);

  /* "ptp/TraderApi.pyx":2099
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pUserPasswordUpdate != NULL:
 *       self.OnRspUserPasswordUpdate(None if pUserPasswordUpdate is NULL else py_ApiStructure.UserPasswordUpdateField.from_address(<size_t> pUserPasswordUpdate)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2100
 * 
 *   try:
 *     if pUserPasswordUpdate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspUserPasswordUpdate(None if pUserPasswordUpdate is NULL else py_ApiStructure.UserPasswordUpdateField.from_address(<size_t> pUserPasswordUpdate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pUserPasswordUpdate != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2101
 *   try:
 *     if pUserPasswordUpdate != NULL:
 *       self.OnRspUserPasswordUpdate(None if pUserPasswordUpdate is NULL else py_ApiStructure.UserPasswordUpdateField.from_address(<size_t> pUserPasswordUpdate)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspUserPasswordUpdate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2101, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pUserPasswordUpdate == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2101, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_UserPasswordUpdateField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2101, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2101, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pUserPasswordUpdate)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2101, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2101, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2101, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2101, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2101, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2101, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2102
 *     if pUserPasswordUpdate != NULL:
 *       self.OnRspUserPasswordUpdate(None if pUserPasswordUpdate is NULL else py_ApiStructure.UserPasswordUpdateField.from_address(<size_t> pUserPasswordUpdate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2102, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2102, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2102, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2102, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2102, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2102, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2102, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2102, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2102, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2104
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspUserPasswordUpdate', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2104, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2104, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2101, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2101, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2101, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2101, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2100
 * 
 *   try:
 *     if pUserPasswordUpdate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspUserPasswordUpdate(None if pUserPasswordUpdate is NULL else py_ApiStructure.UserPasswordUpdateField.from_address(<size_t> pUserPasswordUpdate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2099
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pUserPasswordUpdate != NULL:
 *       self.OnRspUserPasswordUpdate(None if pUserPasswordUpdate is NULL else py_ApiStructure.UserPasswordUpdateField.from_address(<size_t> pUserPasswordUpdate)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2105
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspUserPasswordUpdate', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspUserPasswordUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2105, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2106
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspUserPasswordUpdate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2106, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2106, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2106, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2106, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2106, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__99, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2106, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2105
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspUserPasswordUpdate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2099
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pUserPasswordUpdate != NULL:
 *       self.OnRspUserPasswordUpdate(None if pUserPasswordUpdate is NULL else py_ApiStructure.UserPasswordUpdateField.from_address(<size_t> pUserPasswordUpdate)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2108
 *       myEnv.logger.error('OnRspUserPasswordUpdate', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2093
 * 
 * """
 * cdef extern int   TraderSpi_OnRspUserPasswordUpdate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspUserPasswordUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2114
 * 
 * """
 * cdef extern int   TraderSpi_OnRspTradingAccountPasswordUpdate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspTradingAccountPasswordUpdate(PyObject *__pyx_v_self, struct CThostFtdcTradingAccountPasswordUpdateField *__pyx_v_pTradingAccountPasswordUpdate, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspTradingAccountPasswordUpdate", 0);

  /* "ptp/TraderApi.pyx":2120
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTradingAccountPasswordUpdate != NULL:
 *       self.OnRspTradingAccountPasswordUpdate(None if pTradingAccountPasswordUpdate is NULL else py_ApiStructure.TradingAccountPasswordUpdateField.from_address(<size_t> pTradingAccountPasswordUpdate)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2121
 * 
 *   try:
 *     if pTradingAccountPasswordUpdate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspTradingAccountPasswordUpdate(None if pTradingAccountPasswordUpdate is NULL else py_ApiStructure.TradingAccountPasswordUpdateField.from_address(<size_t> pTradingAccountPasswordUpdate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pTradingAccountPasswordUpdate != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2122
 *   try:
 *     if pTradingAccountPasswordUpdate != NULL:
 *       self.OnRspTradingAccountPasswordUpdate(None if pTradingAccountPasswordUpdate is NULL else py_ApiStructure.TradingAccountPasswordUpdateField.from_address(<size_t> pTradingAccountPasswordUpdate)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspTradingAccountPasswordUpdat); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2122, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pTradingAccountPasswordUpdate == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2122, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_TradingAccountPasswordUpdateFiel); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2122, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2122, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pTradingAccountPasswordUpdate)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2122, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2122, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2122, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2122, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2122, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2122, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2123
 *     if pTradingAccountPasswordUpdate != NULL:
 *       self.OnRspTradingAccountPasswordUpdate(None if pTradingAccountPasswordUpdate is NULL else py_ApiStructure.TradingAccountPasswordUpdateField.from_address(<size_t> pTradingAccountPasswordUpdate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2123, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2123, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2123, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2123, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2123, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2123, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2123, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2123, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2123, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2125
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspTradingAccountPasswordUpdate', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2125, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2125, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2122, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2122, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2122, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2122, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2121
 * 
 *   try:
 *     if pTradingAccountPasswordUpdate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspTradingAccountPasswordUpdate(None if pTradingAccountPasswordUpdate is NULL else py_ApiStructure.TradingAccountPasswordUpdateField.from_address(<size_t> pTradingAccountPasswordUpdate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2120
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTradingAccountPasswordUpdate != NULL:
 *       self.OnRspTradingAccountPasswordUpdate(None if pTradingAccountPasswordUpdate is NULL else py_ApiStructure.TradingAccountPasswordUpdateField.from_address(<size_t> pTradingAccountPasswordUpdate)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2126
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspTradingAccountPasswordUpdate', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspTradingAccountPasswordUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2126, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2127
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspTradingAccountPasswordUpdate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2127, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2127, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2127, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2127, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2127, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__100, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2127, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2126
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspTradingAccountPasswordUpdate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2120
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTradingAccountPasswordUpdate != NULL:
 *       self.OnRspTradingAccountPasswordUpdate(None if pTradingAccountPasswordUpdate is NULL else py_ApiStructure.TradingAccountPasswordUpdateField.from_address(<size_t> pTradingAccountPasswordUpdate)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2129
 *       myEnv.logger.error('OnRspTradingAccountPasswordUpdate', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2114
 * 
 * """
 * cdef extern int   TraderSpi_OnRspTradingAccountPasswordUpdate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspTradingAccountPasswordUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2135
 * 
 * """
 * cdef extern int   TraderSpi_OnRspOrderInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputOrderField *pInputOrder
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspOrderInsert(PyObject *__pyx_v_self, struct CThostFtdcInputOrderField *__pyx_v_pInputOrder, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspOrderInsert", 0);

  /* "ptp/TraderApi.pyx":2141
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputOrder != NULL:
 *       self.OnRspOrderInsert(None if pInputOrder is NULL else py_ApiStructure.InputOrderField.from_address(<size_t> pInputOrder)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2142
 * 
 *   try:
 *     if pInputOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspOrderInsert(None if pInputOrder is NULL else py_ApiStructure.InputOrderField.from_address(<size_t> pInputOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pInputOrder != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2143
 *   try:
 *     if pInputOrder != NULL:
 *       self.OnRspOrderInsert(None if pInputOrder is NULL else py_ApiStructure.InputOrderField.from_address(<size_t> pInputOrder)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspOrderInsert); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2143, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInputOrder == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2143, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InputOrderField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2143, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2143, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInputOrder)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2143, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2143, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2143, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2143, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2143, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2143, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2144
 *     if pInputOrder != NULL:
 *       self.OnRspOrderInsert(None if pInputOrder is NULL else py_ApiStructure.InputOrderField.from_address(<size_t> pInputOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2144, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2144, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2144, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2144, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2144, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2144, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2144, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2144, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2144, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2146
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspOrderInsert', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2146, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2146, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2143, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2143, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2143, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2143, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2142
 * 
 *   try:
 *     if pInputOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspOrderInsert(None if pInputOrder is NULL else py_ApiStructure.InputOrderField.from_address(<size_t> pInputOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2141
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputOrder != NULL:
 *       self.OnRspOrderInsert(None if pInputOrder is NULL else py_ApiStructure.InputOrderField.from_address(<size_t> pInputOrder)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2147
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspOrderInsert', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspOrderInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2147, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2148
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspOrderInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2148, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2148, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2148, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2148, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2148, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__101, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2148, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2147
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspOrderInsert', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2141
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputOrder != NULL:
 *       self.OnRspOrderInsert(None if pInputOrder is NULL else py_ApiStructure.InputOrderField.from_address(<size_t> pInputOrder)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2150
 *       myEnv.logger.error('OnRspOrderInsert', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2135
 * 
 * """
 * cdef extern int   TraderSpi_OnRspOrderInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputOrderField *pInputOrder
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspOrderInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2156
 * 
 * """
 * cdef extern int   TraderSpi_OnRspParkedOrderInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcParkedOrderField *pParkedOrder
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspParkedOrderInsert(PyObject *__pyx_v_self, struct CThostFtdcParkedOrderField *__pyx_v_pParkedOrder, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspParkedOrderInsert", 0);

  /* "ptp/TraderApi.pyx":2162
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pParkedOrder != NULL:
 *       self.OnRspParkedOrderInsert(None if pParkedOrder is NULL else py_ApiStructure.ParkedOrderField.from_address(<size_t> pParkedOrder)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2163
 * 
 *   try:
 *     if pParkedOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspParkedOrderInsert(None if pParkedOrder is NULL else py_ApiStructure.ParkedOrderField.from_address(<size_t> pParkedOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pParkedOrder != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2164
 *   try:
 *     if pParkedOrder != NULL:
 *       self.OnRspParkedOrderInsert(None if pParkedOrder is NULL else py_ApiStructure.ParkedOrderField.from_address(<size_t> pParkedOrder)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspParkedOrderInsert); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2164, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pParkedOrder == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2164, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ParkedOrderField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2164, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2164, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pParkedOrder)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2164, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2164, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2164, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2164, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2164, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2164, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2165
 *     if pParkedOrder != NULL:
 *       self.OnRspParkedOrderInsert(None if pParkedOrder is NULL else py_ApiStructure.ParkedOrderField.from_address(<size_t> pParkedOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2165, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2165, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2165, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2165, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2165, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2165, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2165, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2165, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2165, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2167
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspParkedOrderInsert', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2167, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2167, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2164, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2164, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2164, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2164, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2163
 * 
 *   try:
 *     if pParkedOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspParkedOrderInsert(None if pParkedOrder is NULL else py_ApiStructure.ParkedOrderField.from_address(<size_t> pParkedOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2162
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pParkedOrder != NULL:
 *       self.OnRspParkedOrderInsert(None if pParkedOrder is NULL else py_ApiStructure.ParkedOrderField.from_address(<size_t> pParkedOrder)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2168
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspParkedOrderInsert', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspParkedOrderInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2168, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2169
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspParkedOrderInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2169, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2169, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2169, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2169, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2169, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__102, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2169, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2168
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspParkedOrderInsert', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2162
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pParkedOrder != NULL:
 *       self.OnRspParkedOrderInsert(None if pParkedOrder is NULL else py_ApiStructure.ParkedOrderField.from_address(<size_t> pParkedOrder)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2171
 *       myEnv.logger.error('OnRspParkedOrderInsert', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2156
 * 
 * """
 * cdef extern int   TraderSpi_OnRspParkedOrderInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcParkedOrderField *pParkedOrder
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspParkedOrderInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2177
 * 
 * """
 * cdef extern int   TraderSpi_OnRspParkedOrderAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcParkedOrderActionField *pParkedOrderAction
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspParkedOrderAction(PyObject *__pyx_v_self, struct CThostFtdcParkedOrderActionField *__pyx_v_pParkedOrderAction, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspParkedOrderAction", 0);

  /* "ptp/TraderApi.pyx":2183
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pParkedOrderAction != NULL:
 *       self.OnRspParkedOrderAction(None if pParkedOrderAction is NULL else py_ApiStructure.ParkedOrderActionField.from_address(<size_t> pParkedOrderAction)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2184
 * 
 *   try:
 *     if pParkedOrderAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspParkedOrderAction(None if pParkedOrderAction is NULL else py_ApiStructure.ParkedOrderActionField.from_address(<size_t> pParkedOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pParkedOrderAction != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2185
 *   try:
 *     if pParkedOrderAction != NULL:
 *       self.OnRspParkedOrderAction(None if pParkedOrderAction is NULL else py_ApiStructure.ParkedOrderActionField.from_address(<size_t> pParkedOrderAction)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspParkedOrderAction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2185, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pParkedOrderAction == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2185, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ParkedOrderActionField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2185, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2185, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pParkedOrderAction)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2185, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2185, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2185, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2185, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2185, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2185, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2186
 *     if pParkedOrderAction != NULL:
 *       self.OnRspParkedOrderAction(None if pParkedOrderAction is NULL else py_ApiStructure.ParkedOrderActionField.from_address(<size_t> pParkedOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2186, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2186, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2186, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2186, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2186, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2186, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2186, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2186, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2186, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2188
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspParkedOrderAction', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2188, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2188, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2185, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2185, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2185, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2185, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2184
 * 
 *   try:
 *     if pParkedOrderAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspParkedOrderAction(None if pParkedOrderAction is NULL else py_ApiStructure.ParkedOrderActionField.from_address(<size_t> pParkedOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2183
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pParkedOrderAction != NULL:
 *       self.OnRspParkedOrderAction(None if pParkedOrderAction is NULL else py_ApiStructure.ParkedOrderActionField.from_address(<size_t> pParkedOrderAction)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2189
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspParkedOrderAction', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspParkedOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2189, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2190
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspParkedOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2190, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2190, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2190, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2190, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2190, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__103, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2190, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2189
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspParkedOrderAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2183
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pParkedOrderAction != NULL:
 *       self.OnRspParkedOrderAction(None if pParkedOrderAction is NULL else py_ApiStructure.ParkedOrderActionField.from_address(<size_t> pParkedOrderAction)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2192
 *       myEnv.logger.error('OnRspParkedOrderAction', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2177
 * 
 * """
 * cdef extern int   TraderSpi_OnRspParkedOrderAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcParkedOrderActionField *pParkedOrderAction
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspParkedOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2198
 * 
 * """
 * cdef extern int   TraderSpi_OnRspOrderAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputOrderActionField *pInputOrderAction
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspOrderAction(PyObject *__pyx_v_self, struct CThostFtdcInputOrderActionField *__pyx_v_pInputOrderAction, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspOrderAction", 0);

  /* "ptp/TraderApi.pyx":2204
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputOrderAction != NULL:
 *       self.OnRspOrderAction(None if pInputOrderAction is NULL else py_ApiStructure.InputOrderActionField.from_address(<size_t> pInputOrderAction)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2205
 * 
 *   try:
 *     if pInputOrderAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspOrderAction(None if pInputOrderAction is NULL else py_ApiStructure.InputOrderActionField.from_address(<size_t> pInputOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pInputOrderAction != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2206
 *   try:
 *     if pInputOrderAction != NULL:
 *       self.OnRspOrderAction(None if pInputOrderAction is NULL else py_ApiStructure.InputOrderActionField.from_address(<size_t> pInputOrderAction)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspOrderAction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2206, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInputOrderAction == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2206, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InputOrderActionField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2206, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2206, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInputOrderAction)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2206, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2206, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2206, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2206, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2206, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2206, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2207
 *     if pInputOrderAction != NULL:
 *       self.OnRspOrderAction(None if pInputOrderAction is NULL else py_ApiStructure.InputOrderActionField.from_address(<size_t> pInputOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2207, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2207, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2207, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2207, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2207, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2207, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2207, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2207, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2207, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2209
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspOrderAction', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2209, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2209, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2206, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2206, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2206, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2206, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2205
 * 
 *   try:
 *     if pInputOrderAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspOrderAction(None if pInputOrderAction is NULL else py_ApiStructure.InputOrderActionField.from_address(<size_t> pInputOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2204
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputOrderAction != NULL:
 *       self.OnRspOrderAction(None if pInputOrderAction is NULL else py_ApiStructure.InputOrderActionField.from_address(<size_t> pInputOrderAction)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2210
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspOrderAction', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2210, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2211
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2211, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2211, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2211, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2211, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2211, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__104, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2211, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2210
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspOrderAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2204
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputOrderAction != NULL:
 *       self.OnRspOrderAction(None if pInputOrderAction is NULL else py_ApiStructure.InputOrderActionField.from_address(<size_t> pInputOrderAction)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2213
 *       myEnv.logger.error('OnRspOrderAction', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2198
 * 
 * """
 * cdef extern int   TraderSpi_OnRspOrderAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputOrderActionField *pInputOrderAction
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2219
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQueryMaxOrderVolume(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQueryMaxOrderVolume(PyObject *__pyx_v_self, struct CThostFtdcQueryMaxOrderVolumeField *__pyx_v_pQueryMaxOrderVolume, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQueryMaxOrderVolume", 0);

  /* "ptp/TraderApi.pyx":2225
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pQueryMaxOrderVolume != NULL:
 *       self.OnRspQueryMaxOrderVolume(None if pQueryMaxOrderVolume is NULL else py_ApiStructure.QueryMaxOrderVolumeField.from_address(<size_t> pQueryMaxOrderVolume)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2226
 * 
 *   try:
 *     if pQueryMaxOrderVolume != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQueryMaxOrderVolume(None if pQueryMaxOrderVolume is NULL else py_ApiStructure.QueryMaxOrderVolumeField.from_address(<size_t> pQueryMaxOrderVolume)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pQueryMaxOrderVolume != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2227
 *   try:
 *     if pQueryMaxOrderVolume != NULL:
 *       self.OnRspQueryMaxOrderVolume(None if pQueryMaxOrderVolume is NULL else py_ApiStructure.QueryMaxOrderVolumeField.from_address(<size_t> pQueryMaxOrderVolume)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQueryMaxOrderVolume); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2227, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pQueryMaxOrderVolume == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2227, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_QueryMaxOrderVolumeField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2227, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2227, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pQueryMaxOrderVolume)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2227, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2227, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2227, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2227, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2227, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2227, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2228
 *     if pQueryMaxOrderVolume != NULL:
 *       self.OnRspQueryMaxOrderVolume(None if pQueryMaxOrderVolume is NULL else py_ApiStructure.QueryMaxOrderVolumeField.from_address(<size_t> pQueryMaxOrderVolume)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2228, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2228, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2228, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2228, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2228, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2228, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2228, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2228, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2228, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2230
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQueryMaxOrderVolume', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2230, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2230, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2227, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2227, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2227, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2227, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2226
 * 
 *   try:
 *     if pQueryMaxOrderVolume != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQueryMaxOrderVolume(None if pQueryMaxOrderVolume is NULL else py_ApiStructure.QueryMaxOrderVolumeField.from_address(<size_t> pQueryMaxOrderVolume)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2225
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pQueryMaxOrderVolume != NULL:
 *       self.OnRspQueryMaxOrderVolume(None if pQueryMaxOrderVolume is NULL else py_ApiStructure.QueryMaxOrderVolumeField.from_address(<size_t> pQueryMaxOrderVolume)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2231
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQueryMaxOrderVolume', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQueryMaxOrderVolume", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2231, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2232
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQueryMaxOrderVolume', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2232, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2232, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2232, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2232, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2232, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__105, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2232, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2231
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQueryMaxOrderVolume', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2225
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pQueryMaxOrderVolume != NULL:
 *       self.OnRspQueryMaxOrderVolume(None if pQueryMaxOrderVolume is NULL else py_ApiStructure.QueryMaxOrderVolumeField.from_address(<size_t> pQueryMaxOrderVolume)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2234
 *       myEnv.logger.error('OnRspQueryMaxOrderVolume', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2219
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQueryMaxOrderVolume(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQueryMaxOrderVolume", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2240
 * 
 * """
 * cdef extern int   TraderSpi_OnRspSettlementInfoConfirm(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspSettlementInfoConfirm(PyObject *__pyx_v_self, struct CThostFtdcSettlementInfoConfirmField *__pyx_v_pSettlementInfoConfirm, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspSettlementInfoConfirm", 0);

  /* "ptp/TraderApi.pyx":2246
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pSettlementInfoConfirm != NULL:
 *       self.OnRspSettlementInfoConfirm(None if pSettlementInfoConfirm is NULL else py_ApiStructure.SettlementInfoConfirmField.from_address(<size_t> pSettlementInfoConfirm)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2247
 * 
 *   try:
 *     if pSettlementInfoConfirm != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspSettlementInfoConfirm(None if pSettlementInfoConfirm is NULL else py_ApiStructure.SettlementInfoConfirmField.from_address(<size_t> pSettlementInfoConfirm)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pSettlementInfoConfirm != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2248
 *   try:
 *     if pSettlementInfoConfirm != NULL:
 *       self.OnRspSettlementInfoConfirm(None if pSettlementInfoConfirm is NULL else py_ApiStructure.SettlementInfoConfirmField.from_address(<size_t> pSettlementInfoConfirm)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspSettlementInfoConfirm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2248, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pSettlementInfoConfirm == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2248, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_SettlementInfoConfirmField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2248, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2248, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pSettlementInfoConfirm)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2248, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2248, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2248, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2248, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2248, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2248, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2249
 *     if pSettlementInfoConfirm != NULL:
 *       self.OnRspSettlementInfoConfirm(None if pSettlementInfoConfirm is NULL else py_ApiStructure.SettlementInfoConfirmField.from_address(<size_t> pSettlementInfoConfirm)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2249, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2249, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2249, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2249, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2249, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2249, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2249, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2249, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2249, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2251
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspSettlementInfoConfirm', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2251, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2251, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2248, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2248, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2248, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2248, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2247
 * 
 *   try:
 *     if pSettlementInfoConfirm != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspSettlementInfoConfirm(None if pSettlementInfoConfirm is NULL else py_ApiStructure.SettlementInfoConfirmField.from_address(<size_t> pSettlementInfoConfirm)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2246
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pSettlementInfoConfirm != NULL:
 *       self.OnRspSettlementInfoConfirm(None if pSettlementInfoConfirm is NULL else py_ApiStructure.SettlementInfoConfirmField.from_address(<size_t> pSettlementInfoConfirm)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2252
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspSettlementInfoConfirm', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspSettlementInfoConfirm", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2252, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2253
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspSettlementInfoConfirm', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2253, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2253, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2253, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2253, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2253, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__106, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2253, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2252
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspSettlementInfoConfirm', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2246
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pSettlementInfoConfirm != NULL:
 *       self.OnRspSettlementInfoConfirm(None if pSettlementInfoConfirm is NULL else py_ApiStructure.SettlementInfoConfirmField.from_address(<size_t> pSettlementInfoConfirm)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2255
 *       myEnv.logger.error('OnRspSettlementInfoConfirm', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2240
 * 
 * """
 * cdef extern int   TraderSpi_OnRspSettlementInfoConfirm(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspSettlementInfoConfirm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2261
 * 
 * """
 * cdef extern int   TraderSpi_OnRspRemoveParkedOrder(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspRemoveParkedOrder(PyObject *__pyx_v_self, struct CThostFtdcRemoveParkedOrderField *__pyx_v_pRemoveParkedOrder, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspRemoveParkedOrder", 0);

  /* "ptp/TraderApi.pyx":2267
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRemoveParkedOrder != NULL:
 *       self.OnRspRemoveParkedOrder(None if pRemoveParkedOrder is NULL else py_ApiStructure.RemoveParkedOrderField.from_address(<size_t> pRemoveParkedOrder)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2268
 * 
 *   try:
 *     if pRemoveParkedOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspRemoveParkedOrder(None if pRemoveParkedOrder is NULL else py_ApiStructure.RemoveParkedOrderField.from_address(<size_t> pRemoveParkedOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pRemoveParkedOrder != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2269
 *   try:
 *     if pRemoveParkedOrder != NULL:
 *       self.OnRspRemoveParkedOrder(None if pRemoveParkedOrder is NULL else py_ApiStructure.RemoveParkedOrderField.from_address(<size_t> pRemoveParkedOrder)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspRemoveParkedOrder); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2269, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pRemoveParkedOrder == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2269, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_RemoveParkedOrderField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2269, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2269, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRemoveParkedOrder)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2269, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2269, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2269, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2269, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2269, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2269, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2270
 *     if pRemoveParkedOrder != NULL:
 *       self.OnRspRemoveParkedOrder(None if pRemoveParkedOrder is NULL else py_ApiStructure.RemoveParkedOrderField.from_address(<size_t> pRemoveParkedOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2270, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2270, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2270, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2270, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2270, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2270, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2270, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2270, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2270, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2272
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspRemoveParkedOrder', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2272, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2272, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2269, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2269, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2269, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2269, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2268
 * 
 *   try:
 *     if pRemoveParkedOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspRemoveParkedOrder(None if pRemoveParkedOrder is NULL else py_ApiStructure.RemoveParkedOrderField.from_address(<size_t> pRemoveParkedOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2267
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRemoveParkedOrder != NULL:
 *       self.OnRspRemoveParkedOrder(None if pRemoveParkedOrder is NULL else py_ApiStructure.RemoveParkedOrderField.from_address(<size_t> pRemoveParkedOrder)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2273
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspRemoveParkedOrder', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspRemoveParkedOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2273, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2274
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspRemoveParkedOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2274, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2274, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2274, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2274, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2274, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__107, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2274, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2273
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspRemoveParkedOrder', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2267
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRemoveParkedOrder != NULL:
 *       self.OnRspRemoveParkedOrder(None if pRemoveParkedOrder is NULL else py_ApiStructure.RemoveParkedOrderField.from_address(<size_t> pRemoveParkedOrder)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2276
 *       myEnv.logger.error('OnRspRemoveParkedOrder', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2261
 * 
 * """
 * cdef extern int   TraderSpi_OnRspRemoveParkedOrder(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspRemoveParkedOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2282
 * 
 * """
 * cdef extern int   TraderSpi_OnRspRemoveParkedOrderAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspRemoveParkedOrderAction(PyObject *__pyx_v_self, struct CThostFtdcRemoveParkedOrderActionField *__pyx_v_pRemoveParkedOrderAction, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspRemoveParkedOrderAction", 0);

  /* "ptp/TraderApi.pyx":2288
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRemoveParkedOrderAction != NULL:
 *       self.OnRspRemoveParkedOrderAction(None if pRemoveParkedOrderAction is NULL else py_ApiStructure.RemoveParkedOrderActionField.from_address(<size_t> pRemoveParkedOrderAction)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2289
 * 
 *   try:
 *     if pRemoveParkedOrderAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspRemoveParkedOrderAction(None if pRemoveParkedOrderAction is NULL else py_ApiStructure.RemoveParkedOrderActionField.from_address(<size_t> pRemoveParkedOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pRemoveParkedOrderAction != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2290
 *   try:
 *     if pRemoveParkedOrderAction != NULL:
 *       self.OnRspRemoveParkedOrderAction(None if pRemoveParkedOrderAction is NULL else py_ApiStructure.RemoveParkedOrderActionField.from_address(<size_t> pRemoveParkedOrderAction)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspRemoveParkedOrderAction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2290, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pRemoveParkedOrderAction == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2290, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_RemoveParkedOrderActionField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2290, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2290, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRemoveParkedOrderAction)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2290, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2290, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2290, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2290, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2290, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2290, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2291
 *     if pRemoveParkedOrderAction != NULL:
 *       self.OnRspRemoveParkedOrderAction(None if pRemoveParkedOrderAction is NULL else py_ApiStructure.RemoveParkedOrderActionField.from_address(<size_t> pRemoveParkedOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2291, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2291, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2291, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2291, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2291, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2291, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2291, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2291, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2291, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2293
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspRemoveParkedOrderAction', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2293, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2293, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2290, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2290, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2290, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2290, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2289
 * 
 *   try:
 *     if pRemoveParkedOrderAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspRemoveParkedOrderAction(None if pRemoveParkedOrderAction is NULL else py_ApiStructure.RemoveParkedOrderActionField.from_address(<size_t> pRemoveParkedOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2288
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRemoveParkedOrderAction != NULL:
 *       self.OnRspRemoveParkedOrderAction(None if pRemoveParkedOrderAction is NULL else py_ApiStructure.RemoveParkedOrderActionField.from_address(<size_t> pRemoveParkedOrderAction)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2294
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspRemoveParkedOrderAction', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspRemoveParkedOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2294, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2295
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspRemoveParkedOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2295, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2295, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2295, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2295, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2295, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__108, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2295, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2294
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspRemoveParkedOrderAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2288
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRemoveParkedOrderAction != NULL:
 *       self.OnRspRemoveParkedOrderAction(None if pRemoveParkedOrderAction is NULL else py_ApiStructure.RemoveParkedOrderActionField.from_address(<size_t> pRemoveParkedOrderAction)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2297
 *       myEnv.logger.error('OnRspRemoveParkedOrderAction', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2282
 * 
 * """
 * cdef extern int   TraderSpi_OnRspRemoveParkedOrderAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspRemoveParkedOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2303
 * 
 * """
 * cdef extern int   TraderSpi_OnRspExecOrderInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputExecOrderField *pInputExecOrder
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspExecOrderInsert(PyObject *__pyx_v_self, struct CThostFtdcInputExecOrderField *__pyx_v_pInputExecOrder, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspExecOrderInsert", 0);

  /* "ptp/TraderApi.pyx":2309
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputExecOrder != NULL:
 *       self.OnRspExecOrderInsert(None if pInputExecOrder is NULL else py_ApiStructure.InputExecOrderField.from_address(<size_t> pInputExecOrder)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2310
 * 
 *   try:
 *     if pInputExecOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspExecOrderInsert(None if pInputExecOrder is NULL else py_ApiStructure.InputExecOrderField.from_address(<size_t> pInputExecOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pInputExecOrder != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2311
 *   try:
 *     if pInputExecOrder != NULL:
 *       self.OnRspExecOrderInsert(None if pInputExecOrder is NULL else py_ApiStructure.InputExecOrderField.from_address(<size_t> pInputExecOrder)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspExecOrderInsert); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2311, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInputExecOrder == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2311, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InputExecOrderField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2311, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2311, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInputExecOrder)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2311, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2311, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2311, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2311, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2311, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2311, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2312
 *     if pInputExecOrder != NULL:
 *       self.OnRspExecOrderInsert(None if pInputExecOrder is NULL else py_ApiStructure.InputExecOrderField.from_address(<size_t> pInputExecOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2312, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2312, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2312, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2312, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2312, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2312, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2312, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2312, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2312, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2314
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspExecOrderInsert', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2314, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2314, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2311, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2311, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2311, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2311, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2310
 * 
 *   try:
 *     if pInputExecOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspExecOrderInsert(None if pInputExecOrder is NULL else py_ApiStructure.InputExecOrderField.from_address(<size_t> pInputExecOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2309
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputExecOrder != NULL:
 *       self.OnRspExecOrderInsert(None if pInputExecOrder is NULL else py_ApiStructure.InputExecOrderField.from_address(<size_t> pInputExecOrder)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2315
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspExecOrderInsert', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspExecOrderInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2315, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2316
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspExecOrderInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2316, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2316, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2316, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2316, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2316, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__109, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2316, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2315
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspExecOrderInsert', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2309
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputExecOrder != NULL:
 *       self.OnRspExecOrderInsert(None if pInputExecOrder is NULL else py_ApiStructure.InputExecOrderField.from_address(<size_t> pInputExecOrder)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2318
 *       myEnv.logger.error('OnRspExecOrderInsert', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2303
 * 
 * """
 * cdef extern int   TraderSpi_OnRspExecOrderInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputExecOrderField *pInputExecOrder
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspExecOrderInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2324
 * 
 * """
 * cdef extern int   TraderSpi_OnRspExecOrderAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputExecOrderActionField *pInputExecOrderAction
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspExecOrderAction(PyObject *__pyx_v_self, struct CThostFtdcInputExecOrderActionField *__pyx_v_pInputExecOrderAction, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspExecOrderAction", 0);

  /* "ptp/TraderApi.pyx":2330
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputExecOrderAction != NULL:
 *       self.OnRspExecOrderAction(None if pInputExecOrderAction is NULL else py_ApiStructure.InputExecOrderActionField.from_address(<size_t> pInputExecOrderAction)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2331
 * 
 *   try:
 *     if pInputExecOrderAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspExecOrderAction(None if pInputExecOrderAction is NULL else py_ApiStructure.InputExecOrderActionField.from_address(<size_t> pInputExecOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pInputExecOrderAction != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2332
 *   try:
 *     if pInputExecOrderAction != NULL:
 *       self.OnRspExecOrderAction(None if pInputExecOrderAction is NULL else py_ApiStructure.InputExecOrderActionField.from_address(<size_t> pInputExecOrderAction)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspExecOrderAction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2332, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInputExecOrderAction == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2332, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InputExecOrderActionField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2332, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2332, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInputExecOrderAction)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2332, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2332, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2332, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2332, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2332, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2332, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2333
 *     if pInputExecOrderAction != NULL:
 *       self.OnRspExecOrderAction(None if pInputExecOrderAction is NULL else py_ApiStructure.InputExecOrderActionField.from_address(<size_t> pInputExecOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2333, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2333, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2333, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2333, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2333, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2333, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2333, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2333, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2333, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2335
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspExecOrderAction', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2335, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2335, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2332, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2332, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2332, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2332, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2331
 * 
 *   try:
 *     if pInputExecOrderAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspExecOrderAction(None if pInputExecOrderAction is NULL else py_ApiStructure.InputExecOrderActionField.from_address(<size_t> pInputExecOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2330
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputExecOrderAction != NULL:
 *       self.OnRspExecOrderAction(None if pInputExecOrderAction is NULL else py_ApiStructure.InputExecOrderActionField.from_address(<size_t> pInputExecOrderAction)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2336
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspExecOrderAction', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspExecOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2336, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2337
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspExecOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2337, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2337, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2337, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2337, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2337, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__110, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2337, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2336
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspExecOrderAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2330
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputExecOrderAction != NULL:
 *       self.OnRspExecOrderAction(None if pInputExecOrderAction is NULL else py_ApiStructure.InputExecOrderActionField.from_address(<size_t> pInputExecOrderAction)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2339
 *       myEnv.logger.error('OnRspExecOrderAction', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2324
 * 
 * """
 * cdef extern int   TraderSpi_OnRspExecOrderAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputExecOrderActionField *pInputExecOrderAction
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspExecOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2345
 * 
 * """
 * cdef extern int   TraderSpi_OnRspForQuoteInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputForQuoteField *pInputForQuote
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspForQuoteInsert(PyObject *__pyx_v_self, struct CThostFtdcInputForQuoteField *__pyx_v_pInputForQuote, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspForQuoteInsert", 0);

  /* "ptp/TraderApi.pyx":2351
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputForQuote != NULL:
 *       self.OnRspForQuoteInsert(None if pInputForQuote is NULL else py_ApiStructure.InputForQuoteField.from_address(<size_t> pInputForQuote)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2352
 * 
 *   try:
 *     if pInputForQuote != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspForQuoteInsert(None if pInputForQuote is NULL else py_ApiStructure.InputForQuoteField.from_address(<size_t> pInputForQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pInputForQuote != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2353
 *   try:
 *     if pInputForQuote != NULL:
 *       self.OnRspForQuoteInsert(None if pInputForQuote is NULL else py_ApiStructure.InputForQuoteField.from_address(<size_t> pInputForQuote)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspForQuoteInsert); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2353, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInputForQuote == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2353, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InputForQuoteField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2353, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2353, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInputForQuote)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2353, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2353, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2353, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2353, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2353, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2353, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2354
 *     if pInputForQuote != NULL:
 *       self.OnRspForQuoteInsert(None if pInputForQuote is NULL else py_ApiStructure.InputForQuoteField.from_address(<size_t> pInputForQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2354, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2354, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2354, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2354, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2354, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2354, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2354, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2354, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2354, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2356
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspForQuoteInsert', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2356, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2356, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2353, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2353, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2353, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2353, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2352
 * 
 *   try:
 *     if pInputForQuote != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspForQuoteInsert(None if pInputForQuote is NULL else py_ApiStructure.InputForQuoteField.from_address(<size_t> pInputForQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2351
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputForQuote != NULL:
 *       self.OnRspForQuoteInsert(None if pInputForQuote is NULL else py_ApiStructure.InputForQuoteField.from_address(<size_t> pInputForQuote)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2357
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspForQuoteInsert', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspForQuoteInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2357, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2358
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspForQuoteInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2358, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2358, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2358, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2358, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2358, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__111, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2358, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2357
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspForQuoteInsert', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2351
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputForQuote != NULL:
 *       self.OnRspForQuoteInsert(None if pInputForQuote is NULL else py_ApiStructure.InputForQuoteField.from_address(<size_t> pInputForQuote)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2360
 *       myEnv.logger.error('OnRspForQuoteInsert', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2345
 * 
 * """
 * cdef extern int   TraderSpi_OnRspForQuoteInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputForQuoteField *pInputForQuote
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspForQuoteInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2366
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQuoteInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputQuoteField *pInputQuote
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQuoteInsert(PyObject *__pyx_v_self, struct CThostFtdcInputQuoteField *__pyx_v_pInputQuote, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQuoteInsert", 0);

  /* "ptp/TraderApi.pyx":2372
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputQuote != NULL:
 *       self.OnRspQuoteInsert(None if pInputQuote is NULL else py_ApiStructure.InputQuoteField.from_address(<size_t> pInputQuote)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2373
 * 
 *   try:
 *     if pInputQuote != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQuoteInsert(None if pInputQuote is NULL else py_ApiStructure.InputQuoteField.from_address(<size_t> pInputQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pInputQuote != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2374
 *   try:
 *     if pInputQuote != NULL:
 *       self.OnRspQuoteInsert(None if pInputQuote is NULL else py_ApiStructure.InputQuoteField.from_address(<size_t> pInputQuote)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQuoteInsert); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2374, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInputQuote == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2374, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InputQuoteField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2374, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2374, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInputQuote)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2374, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2374, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2374, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2374, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2374, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2374, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2375
 *     if pInputQuote != NULL:
 *       self.OnRspQuoteInsert(None if pInputQuote is NULL else py_ApiStructure.InputQuoteField.from_address(<size_t> pInputQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2375, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2375, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2375, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2375, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2375, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2375, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2375, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2375, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2375, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2377
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQuoteInsert', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2377, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2377, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2374, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2374, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2374, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2374, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2373
 * 
 *   try:
 *     if pInputQuote != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQuoteInsert(None if pInputQuote is NULL else py_ApiStructure.InputQuoteField.from_address(<size_t> pInputQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2372
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputQuote != NULL:
 *       self.OnRspQuoteInsert(None if pInputQuote is NULL else py_ApiStructure.InputQuoteField.from_address(<size_t> pInputQuote)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2378
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQuoteInsert', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQuoteInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2378, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2379
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQuoteInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2379, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2379, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2379, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2379, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2379, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__112, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2379, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2378
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQuoteInsert', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2372
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputQuote != NULL:
 *       self.OnRspQuoteInsert(None if pInputQuote is NULL else py_ApiStructure.InputQuoteField.from_address(<size_t> pInputQuote)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2381
 *       myEnv.logger.error('OnRspQuoteInsert', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2366
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQuoteInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputQuoteField *pInputQuote
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQuoteInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2387
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQuoteAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputQuoteActionField *pInputQuoteAction
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQuoteAction(PyObject *__pyx_v_self, struct CThostFtdcInputQuoteActionField *__pyx_v_pInputQuoteAction, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQuoteAction", 0);

  /* "ptp/TraderApi.pyx":2393
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputQuoteAction != NULL:
 *       self.OnRspQuoteAction(None if pInputQuoteAction is NULL else py_ApiStructure.InputQuoteActionField.from_address(<size_t> pInputQuoteAction)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2394
 * 
 *   try:
 *     if pInputQuoteAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQuoteAction(None if pInputQuoteAction is NULL else py_ApiStructure.InputQuoteActionField.from_address(<size_t> pInputQuoteAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pInputQuoteAction != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2395
 *   try:
 *     if pInputQuoteAction != NULL:
 *       self.OnRspQuoteAction(None if pInputQuoteAction is NULL else py_ApiStructure.InputQuoteActionField.from_address(<size_t> pInputQuoteAction)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQuoteAction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2395, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInputQuoteAction == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2395, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InputQuoteActionField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2395, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2395, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInputQuoteAction)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2395, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2395, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2395, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2395, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2395, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2395, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2396
 *     if pInputQuoteAction != NULL:
 *       self.OnRspQuoteAction(None if pInputQuoteAction is NULL else py_ApiStructure.InputQuoteActionField.from_address(<size_t> pInputQuoteAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2396, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2396, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2396, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2396, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2396, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2396, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2396, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2396, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2396, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2398
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQuoteAction', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2398, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2398, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2395, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2395, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2395, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2395, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2394
 * 
 *   try:
 *     if pInputQuoteAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQuoteAction(None if pInputQuoteAction is NULL else py_ApiStructure.InputQuoteActionField.from_address(<size_t> pInputQuoteAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2393
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputQuoteAction != NULL:
 *       self.OnRspQuoteAction(None if pInputQuoteAction is NULL else py_ApiStructure.InputQuoteActionField.from_address(<size_t> pInputQuoteAction)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2399
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQuoteAction', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQuoteAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2399, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2400
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQuoteAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2400, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2400, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2400, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2400, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2400, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__113, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2400, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2399
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQuoteAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2393
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputQuoteAction != NULL:
 *       self.OnRspQuoteAction(None if pInputQuoteAction is NULL else py_ApiStructure.InputQuoteActionField.from_address(<size_t> pInputQuoteAction)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2402
 *       myEnv.logger.error('OnRspQuoteAction', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2387
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQuoteAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputQuoteActionField *pInputQuoteAction
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQuoteAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2408
 * 
 * """
 * cdef extern int   TraderSpi_OnRspBatchOrderAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputBatchOrderActionField *pInputBatchOrderAction
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspBatchOrderAction(PyObject *__pyx_v_self, struct CThostFtdcInputBatchOrderActionField *__pyx_v_pInputBatchOrderAction, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspBatchOrderAction", 0);

  /* "ptp/TraderApi.pyx":2414
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputBatchOrderAction != NULL:
 *       self.OnRspBatchOrderAction(None if pInputBatchOrderAction is NULL else py_ApiStructure.InputBatchOrderActionField.from_address(<size_t> pInputBatchOrderAction)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2415
 * 
 *   try:
 *     if pInputBatchOrderAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspBatchOrderAction(None if pInputBatchOrderAction is NULL else py_ApiStructure.InputBatchOrderActionField.from_address(<size_t> pInputBatchOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pInputBatchOrderAction != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2416
 *   try:
 *     if pInputBatchOrderAction != NULL:
 *       self.OnRspBatchOrderAction(None if pInputBatchOrderAction is NULL else py_ApiStructure.InputBatchOrderActionField.from_address(<size_t> pInputBatchOrderAction)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspBatchOrderAction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2416, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInputBatchOrderAction == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2416, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InputBatchOrderActionField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2416, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2416, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInputBatchOrderAction)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2416, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2416, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2416, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2416, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2416, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2416, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2417
 *     if pInputBatchOrderAction != NULL:
 *       self.OnRspBatchOrderAction(None if pInputBatchOrderAction is NULL else py_ApiStructure.InputBatchOrderActionField.from_address(<size_t> pInputBatchOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2417, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2417, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2417, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2417, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2417, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2417, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2417, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2417, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2417, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2419
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspBatchOrderAction', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2419, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2419, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2416, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2416, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2416, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2416, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2415
 * 
 *   try:
 *     if pInputBatchOrderAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspBatchOrderAction(None if pInputBatchOrderAction is NULL else py_ApiStructure.InputBatchOrderActionField.from_address(<size_t> pInputBatchOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2414
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputBatchOrderAction != NULL:
 *       self.OnRspBatchOrderAction(None if pInputBatchOrderAction is NULL else py_ApiStructure.InputBatchOrderActionField.from_address(<size_t> pInputBatchOrderAction)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2420
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspBatchOrderAction', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspBatchOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2420, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2421
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspBatchOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2421, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2421, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2421, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2421, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2421, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__114, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2421, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2420
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspBatchOrderAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2414
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputBatchOrderAction != NULL:
 *       self.OnRspBatchOrderAction(None if pInputBatchOrderAction is NULL else py_ApiStructure.InputBatchOrderActionField.from_address(<size_t> pInputBatchOrderAction)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2423
 *       myEnv.logger.error('OnRspBatchOrderAction', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2408
 * 
 * """
 * cdef extern int   TraderSpi_OnRspBatchOrderAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputBatchOrderActionField *pInputBatchOrderAction
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspBatchOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2429
 * 
 * """
 * cdef extern int   TraderSpi_OnRspOptionSelfCloseInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputOptionSelfCloseField *pInputOptionSelfClose
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspOptionSelfCloseInsert(PyObject *__pyx_v_self, struct CThostFtdcInputOptionSelfCloseField *__pyx_v_pInputOptionSelfClose, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspOptionSelfCloseInsert", 0);

  /* "ptp/TraderApi.pyx":2435
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputOptionSelfClose != NULL:
 *       self.OnRspOptionSelfCloseInsert(None if pInputOptionSelfClose is NULL else py_ApiStructure.InputOptionSelfCloseField.from_address(<size_t> pInputOptionSelfClose)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2436
 * 
 *   try:
 *     if pInputOptionSelfClose != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspOptionSelfCloseInsert(None if pInputOptionSelfClose is NULL else py_ApiStructure.InputOptionSelfCloseField.from_address(<size_t> pInputOptionSelfClose)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pInputOptionSelfClose != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2437
 *   try:
 *     if pInputOptionSelfClose != NULL:
 *       self.OnRspOptionSelfCloseInsert(None if pInputOptionSelfClose is NULL else py_ApiStructure.InputOptionSelfCloseField.from_address(<size_t> pInputOptionSelfClose)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspOptionSelfCloseInsert); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2437, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInputOptionSelfClose == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2437, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InputOptionSelfCloseField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2437, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2437, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInputOptionSelfClose)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2437, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2437, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2437, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2437, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2437, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2437, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2438
 *     if pInputOptionSelfClose != NULL:
 *       self.OnRspOptionSelfCloseInsert(None if pInputOptionSelfClose is NULL else py_ApiStructure.InputOptionSelfCloseField.from_address(<size_t> pInputOptionSelfClose)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2438, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2438, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2438, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2438, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2438, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2438, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2438, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2438, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2438, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2440
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspOptionSelfCloseInsert', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2440, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2440, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2437, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2437, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2437, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2437, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2436
 * 
 *   try:
 *     if pInputOptionSelfClose != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspOptionSelfCloseInsert(None if pInputOptionSelfClose is NULL else py_ApiStructure.InputOptionSelfCloseField.from_address(<size_t> pInputOptionSelfClose)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2435
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputOptionSelfClose != NULL:
 *       self.OnRspOptionSelfCloseInsert(None if pInputOptionSelfClose is NULL else py_ApiStructure.InputOptionSelfCloseField.from_address(<size_t> pInputOptionSelfClose)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2441
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspOptionSelfCloseInsert', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspOptionSelfCloseInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2441, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2442
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspOptionSelfCloseInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2442, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2442, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2442, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2442, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2442, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__115, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2442, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2441
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspOptionSelfCloseInsert', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2435
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputOptionSelfClose != NULL:
 *       self.OnRspOptionSelfCloseInsert(None if pInputOptionSelfClose is NULL else py_ApiStructure.InputOptionSelfCloseField.from_address(<size_t> pInputOptionSelfClose)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2444
 *       myEnv.logger.error('OnRspOptionSelfCloseInsert', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2429
 * 
 * """
 * cdef extern int   TraderSpi_OnRspOptionSelfCloseInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputOptionSelfCloseField *pInputOptionSelfClose
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspOptionSelfCloseInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2450
 * 
 * """
 * cdef extern int   TraderSpi_OnRspOptionSelfCloseAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputOptionSelfCloseActionField *pInputOptionSelfCloseAction
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspOptionSelfCloseAction(PyObject *__pyx_v_self, struct CThostFtdcInputOptionSelfCloseActionField *__pyx_v_pInputOptionSelfCloseAction, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspOptionSelfCloseAction", 0);

  /* "ptp/TraderApi.pyx":2456
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputOptionSelfCloseAction != NULL:
 *       self.OnRspOptionSelfCloseAction(None if pInputOptionSelfCloseAction is NULL else py_ApiStructure.InputOptionSelfCloseActionField.from_address(<size_t> pInputOptionSelfCloseAction)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2457
 * 
 *   try:
 *     if pInputOptionSelfCloseAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspOptionSelfCloseAction(None if pInputOptionSelfCloseAction is NULL else py_ApiStructure.InputOptionSelfCloseActionField.from_address(<size_t> pInputOptionSelfCloseAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pInputOptionSelfCloseAction != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2458
 *   try:
 *     if pInputOptionSelfCloseAction != NULL:
 *       self.OnRspOptionSelfCloseAction(None if pInputOptionSelfCloseAction is NULL else py_ApiStructure.InputOptionSelfCloseActionField.from_address(<size_t> pInputOptionSelfCloseAction)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspOptionSelfCloseAction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2458, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInputOptionSelfCloseAction == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2458, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InputOptionSelfCloseActionField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2458, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2458, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInputOptionSelfCloseAction)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2458, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2458, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2458, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2458, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2458, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2458, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2459
 *     if pInputOptionSelfCloseAction != NULL:
 *       self.OnRspOptionSelfCloseAction(None if pInputOptionSelfCloseAction is NULL else py_ApiStructure.InputOptionSelfCloseActionField.from_address(<size_t> pInputOptionSelfCloseAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2459, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2459, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2459, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2459, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2459, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2459, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2459, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2459, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2459, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2461
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspOptionSelfCloseAction', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2461, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2461, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2458, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2458, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2458, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2458, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2457
 * 
 *   try:
 *     if pInputOptionSelfCloseAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspOptionSelfCloseAction(None if pInputOptionSelfCloseAction is NULL else py_ApiStructure.InputOptionSelfCloseActionField.from_address(<size_t> pInputOptionSelfCloseAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2456
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputOptionSelfCloseAction != NULL:
 *       self.OnRspOptionSelfCloseAction(None if pInputOptionSelfCloseAction is NULL else py_ApiStructure.InputOptionSelfCloseActionField.from_address(<size_t> pInputOptionSelfCloseAction)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2462
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspOptionSelfCloseAction', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspOptionSelfCloseAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2462, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2463
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspOptionSelfCloseAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2463, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2463, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2463, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2463, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2463, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__116, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2463, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2462
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspOptionSelfCloseAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2456
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputOptionSelfCloseAction != NULL:
 *       self.OnRspOptionSelfCloseAction(None if pInputOptionSelfCloseAction is NULL else py_ApiStructure.InputOptionSelfCloseActionField.from_address(<size_t> pInputOptionSelfCloseAction)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2465
 *       myEnv.logger.error('OnRspOptionSelfCloseAction', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2450
 * 
 * """
 * cdef extern int   TraderSpi_OnRspOptionSelfCloseAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputOptionSelfCloseActionField *pInputOptionSelfCloseAction
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspOptionSelfCloseAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2471
 * 
 * """
 * cdef extern int   TraderSpi_OnRspCombActionInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputCombActionField *pInputCombAction
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspCombActionInsert(PyObject *__pyx_v_self, struct CThostFtdcInputCombActionField *__pyx_v_pInputCombAction, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspCombActionInsert", 0);

  /* "ptp/TraderApi.pyx":2477
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputCombAction != NULL:
 *       self.OnRspCombActionInsert(None if pInputCombAction is NULL else py_ApiStructure.InputCombActionField.from_address(<size_t> pInputCombAction)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2478
 * 
 *   try:
 *     if pInputCombAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspCombActionInsert(None if pInputCombAction is NULL else py_ApiStructure.InputCombActionField.from_address(<size_t> pInputCombAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pInputCombAction != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2479
 *   try:
 *     if pInputCombAction != NULL:
 *       self.OnRspCombActionInsert(None if pInputCombAction is NULL else py_ApiStructure.InputCombActionField.from_address(<size_t> pInputCombAction)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspCombActionInsert); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2479, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInputCombAction == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2479, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InputCombActionField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2479, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2479, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInputCombAction)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2479, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2479, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2479, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2479, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2479, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2479, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2480
 *     if pInputCombAction != NULL:
 *       self.OnRspCombActionInsert(None if pInputCombAction is NULL else py_ApiStructure.InputCombActionField.from_address(<size_t> pInputCombAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2480, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2480, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2480, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2480, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2480, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2480, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2480, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2480, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2480, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2482
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspCombActionInsert', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2482, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2482, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2479, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2479, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2479, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2479, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2478
 * 
 *   try:
 *     if pInputCombAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspCombActionInsert(None if pInputCombAction is NULL else py_ApiStructure.InputCombActionField.from_address(<size_t> pInputCombAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2477
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputCombAction != NULL:
 *       self.OnRspCombActionInsert(None if pInputCombAction is NULL else py_ApiStructure.InputCombActionField.from_address(<size_t> pInputCombAction)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2483
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspCombActionInsert', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspCombActionInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2483, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2484
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspCombActionInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2484, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2484, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2484, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2484, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2484, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__117, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2484, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2483
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspCombActionInsert', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2477
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputCombAction != NULL:
 *       self.OnRspCombActionInsert(None if pInputCombAction is NULL else py_ApiStructure.InputCombActionField.from_address(<size_t> pInputCombAction)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2486
 *       myEnv.logger.error('OnRspCombActionInsert', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2471
 * 
 * """
 * cdef extern int   TraderSpi_OnRspCombActionInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputCombActionField *pInputCombAction
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspCombActionInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2492
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryOrder(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcOrderField *pOrder
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryOrder(PyObject *__pyx_v_self, struct CThostFtdcOrderField *__pyx_v_pOrder, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryOrder", 0);

  /* "ptp/TraderApi.pyx":2498
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOrder != NULL:
 *       self.OnRspQryOrder(None if pOrder is NULL else py_ApiStructure.OrderField.from_address(<size_t> pOrder)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2499
 * 
 *   try:
 *     if pOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryOrder(None if pOrder is NULL else py_ApiStructure.OrderField.from_address(<size_t> pOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pOrder != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2500
 *   try:
 *     if pOrder != NULL:
 *       self.OnRspQryOrder(None if pOrder is NULL else py_ApiStructure.OrderField.from_address(<size_t> pOrder)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryOrder); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2500, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pOrder == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2500, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_OrderField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2500, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2500, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pOrder)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2500, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2500, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2500, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2500, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2500, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2500, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2501
 *     if pOrder != NULL:
 *       self.OnRspQryOrder(None if pOrder is NULL else py_ApiStructure.OrderField.from_address(<size_t> pOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2501, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2501, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2501, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2501, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2501, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2501, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2501, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2501, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2501, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2503
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryOrder', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2503, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2503, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2500, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2500, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2500, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2500, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2499
 * 
 *   try:
 *     if pOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryOrder(None if pOrder is NULL else py_ApiStructure.OrderField.from_address(<size_t> pOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2498
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOrder != NULL:
 *       self.OnRspQryOrder(None if pOrder is NULL else py_ApiStructure.OrderField.from_address(<size_t> pOrder)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2504
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryOrder', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2504, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2505
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2505, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2505, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2505, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2505, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2505, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__118, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2505, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2504
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryOrder', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2498
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOrder != NULL:
 *       self.OnRspQryOrder(None if pOrder is NULL else py_ApiStructure.OrderField.from_address(<size_t> pOrder)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2507
 *       myEnv.logger.error('OnRspQryOrder', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2492
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryOrder(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcOrderField *pOrder
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2513
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryTrade(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcTradeField *pTrade
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryTrade(PyObject *__pyx_v_self, struct CThostFtdcTradeField *__pyx_v_pTrade, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryTrade", 0);

  /* "ptp/TraderApi.pyx":2519
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTrade != NULL:
 *       self.OnRspQryTrade(None if pTrade is NULL else py_ApiStructure.TradeField.from_address(<size_t> pTrade)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2520
 * 
 *   try:
 *     if pTrade != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryTrade(None if pTrade is NULL else py_ApiStructure.TradeField.from_address(<size_t> pTrade)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pTrade != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2521
 *   try:
 *     if pTrade != NULL:
 *       self.OnRspQryTrade(None if pTrade is NULL else py_ApiStructure.TradeField.from_address(<size_t> pTrade)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryTrade); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2521, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pTrade == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2521, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_TradeField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2521, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2521, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pTrade)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2521, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2521, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2521, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2521, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2521, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2521, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2522
 *     if pTrade != NULL:
 *       self.OnRspQryTrade(None if pTrade is NULL else py_ApiStructure.TradeField.from_address(<size_t> pTrade)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2522, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2522, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2522, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2522, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2522, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2522, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2522, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2522, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2522, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2524
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryTrade', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2524, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2524, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2521, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2521, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2521, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2521, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2520
 * 
 *   try:
 *     if pTrade != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryTrade(None if pTrade is NULL else py_ApiStructure.TradeField.from_address(<size_t> pTrade)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2519
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTrade != NULL:
 *       self.OnRspQryTrade(None if pTrade is NULL else py_ApiStructure.TradeField.from_address(<size_t> pTrade)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2525
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryTrade', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryTrade", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2525, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2526
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryTrade', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2526, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2526, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2526, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2526, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2526, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__119, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2526, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2525
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryTrade', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2519
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTrade != NULL:
 *       self.OnRspQryTrade(None if pTrade is NULL else py_ApiStructure.TradeField.from_address(<size_t> pTrade)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2528
 *       myEnv.logger.error('OnRspQryTrade', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2513
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryTrade(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcTradeField *pTrade
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryTrade", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2534
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryInvestorPosition(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInvestorPositionField *pInvestorPosition
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryInvestorPosition(PyObject *__pyx_v_self, struct CThostFtdcInvestorPositionField *__pyx_v_pInvestorPosition, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryInvestorPosition", 0);

  /* "ptp/TraderApi.pyx":2540
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInvestorPosition != NULL:
 *       self.OnRspQryInvestorPosition(None if pInvestorPosition is NULL else py_ApiStructure.InvestorPositionField.from_address(<size_t> pInvestorPosition)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2541
 * 
 *   try:
 *     if pInvestorPosition != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryInvestorPosition(None if pInvestorPosition is NULL else py_ApiStructure.InvestorPositionField.from_address(<size_t> pInvestorPosition)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pInvestorPosition != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2542
 *   try:
 *     if pInvestorPosition != NULL:
 *       self.OnRspQryInvestorPosition(None if pInvestorPosition is NULL else py_ApiStructure.InvestorPositionField.from_address(<size_t> pInvestorPosition)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryInvestorPosition); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2542, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInvestorPosition == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2542, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InvestorPositionField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2542, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2542, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInvestorPosition)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2542, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2542, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2542, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2542, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2542, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2542, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2543
 *     if pInvestorPosition != NULL:
 *       self.OnRspQryInvestorPosition(None if pInvestorPosition is NULL else py_ApiStructure.InvestorPositionField.from_address(<size_t> pInvestorPosition)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2543, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2543, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2543, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2543, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2543, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2543, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2543, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2543, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2543, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2545
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInvestorPosition', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2545, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2545, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2542, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2542, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2542, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2542, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2541
 * 
 *   try:
 *     if pInvestorPosition != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryInvestorPosition(None if pInvestorPosition is NULL else py_ApiStructure.InvestorPositionField.from_address(<size_t> pInvestorPosition)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2540
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInvestorPosition != NULL:
 *       self.OnRspQryInvestorPosition(None if pInvestorPosition is NULL else py_ApiStructure.InvestorPositionField.from_address(<size_t> pInvestorPosition)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2546
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryInvestorPosition', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryInvestorPosition", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2546, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2547
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInvestorPosition', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2547, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2547, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2547, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2547, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2547, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__120, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2547, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2546
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryInvestorPosition', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2540
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInvestorPosition != NULL:
 *       self.OnRspQryInvestorPosition(None if pInvestorPosition is NULL else py_ApiStructure.InvestorPositionField.from_address(<size_t> pInvestorPosition)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2549
 *       myEnv.logger.error('OnRspQryInvestorPosition', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2534
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryInvestorPosition(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInvestorPositionField *pInvestorPosition
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryInvestorPosition", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2555
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryTradingAccount(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcTradingAccountField *pTradingAccount
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryTradingAccount(PyObject *__pyx_v_self, struct CThostFtdcTradingAccountField *__pyx_v_pTradingAccount, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryTradingAccount", 0);

  /* "ptp/TraderApi.pyx":2561
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTradingAccount != NULL:
 *       self.OnRspQryTradingAccount(None if pTradingAccount is NULL else py_ApiStructure.TradingAccountField.from_address(<size_t> pTradingAccount)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2562
 * 
 *   try:
 *     if pTradingAccount != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryTradingAccount(None if pTradingAccount is NULL else py_ApiStructure.TradingAccountField.from_address(<size_t> pTradingAccount)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pTradingAccount != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2563
 *   try:
 *     if pTradingAccount != NULL:
 *       self.OnRspQryTradingAccount(None if pTradingAccount is NULL else py_ApiStructure.TradingAccountField.from_address(<size_t> pTradingAccount)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryTradingAccount); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2563, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pTradingAccount == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2563, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_TradingAccountField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2563, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2563, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pTradingAccount)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2563, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2563, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2563, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2563, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2563, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2563, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2564
 *     if pTradingAccount != NULL:
 *       self.OnRspQryTradingAccount(None if pTradingAccount is NULL else py_ApiStructure.TradingAccountField.from_address(<size_t> pTradingAccount)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2564, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2564, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2564, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2564, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2564, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2564, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2564, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2564, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2564, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2566
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryTradingAccount', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2566, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2566, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2563, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2563, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2563, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2563, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2562
 * 
 *   try:
 *     if pTradingAccount != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryTradingAccount(None if pTradingAccount is NULL else py_ApiStructure.TradingAccountField.from_address(<size_t> pTradingAccount)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2561
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTradingAccount != NULL:
 *       self.OnRspQryTradingAccount(None if pTradingAccount is NULL else py_ApiStructure.TradingAccountField.from_address(<size_t> pTradingAccount)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2567
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryTradingAccount', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryTradingAccount", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2567, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2568
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryTradingAccount', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2568, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2568, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2568, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2568, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2568, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__121, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2568, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2567
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryTradingAccount', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2561
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTradingAccount != NULL:
 *       self.OnRspQryTradingAccount(None if pTradingAccount is NULL else py_ApiStructure.TradingAccountField.from_address(<size_t> pTradingAccount)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2570
 *       myEnv.logger.error('OnRspQryTradingAccount', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2555
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryTradingAccount(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcTradingAccountField *pTradingAccount
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryTradingAccount", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2576
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryInvestor(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInvestorField *pInvestor
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryInvestor(PyObject *__pyx_v_self, struct CThostFtdcInvestorField *__pyx_v_pInvestor, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryInvestor", 0);

  /* "ptp/TraderApi.pyx":2582
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInvestor != NULL:
 *       self.OnRspQryInvestor(None if pInvestor is NULL else py_ApiStructure.InvestorField.from_address(<size_t> pInvestor)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2583
 * 
 *   try:
 *     if pInvestor != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryInvestor(None if pInvestor is NULL else py_ApiStructure.InvestorField.from_address(<size_t> pInvestor)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pInvestor != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2584
 *   try:
 *     if pInvestor != NULL:
 *       self.OnRspQryInvestor(None if pInvestor is NULL else py_ApiStructure.InvestorField.from_address(<size_t> pInvestor)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryInvestor); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2584, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInvestor == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2584, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InvestorField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2584, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2584, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInvestor)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2584, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2584, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2584, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2584, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2584, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2584, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2585
 *     if pInvestor != NULL:
 *       self.OnRspQryInvestor(None if pInvestor is NULL else py_ApiStructure.InvestorField.from_address(<size_t> pInvestor)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2585, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2585, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2585, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2585, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2585, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2585, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2585, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2585, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2585, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2587
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInvestor', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2587, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2587, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2584, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2584, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2584, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2584, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2583
 * 
 *   try:
 *     if pInvestor != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryInvestor(None if pInvestor is NULL else py_ApiStructure.InvestorField.from_address(<size_t> pInvestor)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2582
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInvestor != NULL:
 *       self.OnRspQryInvestor(None if pInvestor is NULL else py_ApiStructure.InvestorField.from_address(<size_t> pInvestor)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2588
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryInvestor', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryInvestor", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2588, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2589
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInvestor', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2589, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2589, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2589, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2589, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2589, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__122, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2589, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2588
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryInvestor', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2582
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInvestor != NULL:
 *       self.OnRspQryInvestor(None if pInvestor is NULL else py_ApiStructure.InvestorField.from_address(<size_t> pInvestor)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2591
 *       myEnv.logger.error('OnRspQryInvestor', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2576
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryInvestor(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInvestorField *pInvestor
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryInvestor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2597
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryTradingCode(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcTradingCodeField *pTradingCode
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryTradingCode(PyObject *__pyx_v_self, struct CThostFtdcTradingCodeField *__pyx_v_pTradingCode, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryTradingCode", 0);

  /* "ptp/TraderApi.pyx":2603
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTradingCode != NULL:
 *       self.OnRspQryTradingCode(None if pTradingCode is NULL else py_ApiStructure.TradingCodeField.from_address(<size_t> pTradingCode)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2604
 * 
 *   try:
 *     if pTradingCode != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryTradingCode(None if pTradingCode is NULL else py_ApiStructure.TradingCodeField.from_address(<size_t> pTradingCode)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pTradingCode != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2605
 *   try:
 *     if pTradingCode != NULL:
 *       self.OnRspQryTradingCode(None if pTradingCode is NULL else py_ApiStructure.TradingCodeField.from_address(<size_t> pTradingCode)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryTradingCode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2605, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pTradingCode == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2605, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_TradingCodeField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2605, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2605, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pTradingCode)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2605, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2605, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2605, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2605, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2605, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2605, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2606
 *     if pTradingCode != NULL:
 *       self.OnRspQryTradingCode(None if pTradingCode is NULL else py_ApiStructure.TradingCodeField.from_address(<size_t> pTradingCode)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2606, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2606, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2606, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2606, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2606, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2606, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2606, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2606, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2606, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2608
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryTradingCode', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2608, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2608, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2605, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2605, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2605, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2605, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2604
 * 
 *   try:
 *     if pTradingCode != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryTradingCode(None if pTradingCode is NULL else py_ApiStructure.TradingCodeField.from_address(<size_t> pTradingCode)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2603
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTradingCode != NULL:
 *       self.OnRspQryTradingCode(None if pTradingCode is NULL else py_ApiStructure.TradingCodeField.from_address(<size_t> pTradingCode)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2609
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryTradingCode', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryTradingCode", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2609, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2610
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryTradingCode', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2610, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2610, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2610, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2610, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2610, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__123, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2610, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2609
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryTradingCode', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2603
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTradingCode != NULL:
 *       self.OnRspQryTradingCode(None if pTradingCode is NULL else py_ApiStructure.TradingCodeField.from_address(<size_t> pTradingCode)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2612
 *       myEnv.logger.error('OnRspQryTradingCode', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2597
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryTradingCode(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcTradingCodeField *pTradingCode
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryTradingCode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2618
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryInstrumentMarginRate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInstrumentMarginRateField *pInstrumentMarginRate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryInstrumentMarginRate(PyObject *__pyx_v_self, struct CThostFtdcInstrumentMarginRateField *__pyx_v_pInstrumentMarginRate, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryInstrumentMarginRate", 0);

  /* "ptp/TraderApi.pyx":2624
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInstrumentMarginRate != NULL:
 *       self.OnRspQryInstrumentMarginRate(None if pInstrumentMarginRate is NULL else py_ApiStructure.InstrumentMarginRateField.from_address(<size_t> pInstrumentMarginRate)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2625
 * 
 *   try:
 *     if pInstrumentMarginRate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryInstrumentMarginRate(None if pInstrumentMarginRate is NULL else py_ApiStructure.InstrumentMarginRateField.from_address(<size_t> pInstrumentMarginRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pInstrumentMarginRate != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2626
 *   try:
 *     if pInstrumentMarginRate != NULL:
 *       self.OnRspQryInstrumentMarginRate(None if pInstrumentMarginRate is NULL else py_ApiStructure.InstrumentMarginRateField.from_address(<size_t> pInstrumentMarginRate)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryInstrumentMarginRate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2626, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInstrumentMarginRate == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2626, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InstrumentMarginRateField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2626, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2626, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInstrumentMarginRate)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2626, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2626, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2626, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2626, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2626, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2626, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2627
 *     if pInstrumentMarginRate != NULL:
 *       self.OnRspQryInstrumentMarginRate(None if pInstrumentMarginRate is NULL else py_ApiStructure.InstrumentMarginRateField.from_address(<size_t> pInstrumentMarginRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2627, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2627, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2627, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2627, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2627, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2627, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2627, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2627, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2627, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2629
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInstrumentMarginRate', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2629, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2629, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2626, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2626, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2626, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2626, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2625
 * 
 *   try:
 *     if pInstrumentMarginRate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryInstrumentMarginRate(None if pInstrumentMarginRate is NULL else py_ApiStructure.InstrumentMarginRateField.from_address(<size_t> pInstrumentMarginRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2624
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInstrumentMarginRate != NULL:
 *       self.OnRspQryInstrumentMarginRate(None if pInstrumentMarginRate is NULL else py_ApiStructure.InstrumentMarginRateField.from_address(<size_t> pInstrumentMarginRate)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2630
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryInstrumentMarginRate', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryInstrumentMarginRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2630, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2631
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInstrumentMarginRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2631, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2631, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2631, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2631, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2631, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__124, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2631, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2630
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryInstrumentMarginRate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2624
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInstrumentMarginRate != NULL:
 *       self.OnRspQryInstrumentMarginRate(None if pInstrumentMarginRate is NULL else py_ApiStructure.InstrumentMarginRateField.from_address(<size_t> pInstrumentMarginRate)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2633
 *       myEnv.logger.error('OnRspQryInstrumentMarginRate', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2618
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryInstrumentMarginRate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInstrumentMarginRateField *pInstrumentMarginRate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryInstrumentMarginRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2639
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryInstrumentCommissionRate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInstrumentCommissionRateField *pInstrumentCommissionRate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryInstrumentCommissionRate(PyObject *__pyx_v_self, struct CThostFtdcInstrumentCommissionRateField *__pyx_v_pInstrumentCommissionRate, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryInstrumentCommissionRate", 0);

  /* "ptp/TraderApi.pyx":2645
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInstrumentCommissionRate != NULL:
 *       self.OnRspQryInstrumentCommissionRate(None if pInstrumentCommissionRate is NULL else py_ApiStructure.InstrumentCommissionRateField.from_address(<size_t> pInstrumentCommissionRate)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2646
 * 
 *   try:
 *     if pInstrumentCommissionRate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryInstrumentCommissionRate(None if pInstrumentCommissionRate is NULL else py_ApiStructure.InstrumentCommissionRateField.from_address(<size_t> pInstrumentCommissionRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pInstrumentCommissionRate != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2647
 *   try:
 *     if pInstrumentCommissionRate != NULL:
 *       self.OnRspQryInstrumentCommissionRate(None if pInstrumentCommissionRate is NULL else py_ApiStructure.InstrumentCommissionRateField.from_address(<size_t> pInstrumentCommissionRate)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryInstrumentCommissionRate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2647, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInstrumentCommissionRate == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2647, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InstrumentCommissionRateField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2647, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2647, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInstrumentCommissionRate)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2647, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2647, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2647, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2647, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2647, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2647, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2648
 *     if pInstrumentCommissionRate != NULL:
 *       self.OnRspQryInstrumentCommissionRate(None if pInstrumentCommissionRate is NULL else py_ApiStructure.InstrumentCommissionRateField.from_address(<size_t> pInstrumentCommissionRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2648, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2648, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2648, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2648, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2648, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2648, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2648, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2648, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2648, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2650
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInstrumentCommissionRate', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2650, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2650, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2647, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2647, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2647, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2647, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2646
 * 
 *   try:
 *     if pInstrumentCommissionRate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryInstrumentCommissionRate(None if pInstrumentCommissionRate is NULL else py_ApiStructure.InstrumentCommissionRateField.from_address(<size_t> pInstrumentCommissionRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2645
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInstrumentCommissionRate != NULL:
 *       self.OnRspQryInstrumentCommissionRate(None if pInstrumentCommissionRate is NULL else py_ApiStructure.InstrumentCommissionRateField.from_address(<size_t> pInstrumentCommissionRate)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2651
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryInstrumentCommissionRate', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryInstrumentCommissionRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2651, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2652
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInstrumentCommissionRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2652, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2652, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2652, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2652, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2652, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__125, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2652, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2651
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryInstrumentCommissionRate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2645
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInstrumentCommissionRate != NULL:
 *       self.OnRspQryInstrumentCommissionRate(None if pInstrumentCommissionRate is NULL else py_ApiStructure.InstrumentCommissionRateField.from_address(<size_t> pInstrumentCommissionRate)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2654
 *       myEnv.logger.error('OnRspQryInstrumentCommissionRate', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2639
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryInstrumentCommissionRate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInstrumentCommissionRateField *pInstrumentCommissionRate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryInstrumentCommissionRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2660
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryExchange(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcExchangeField *pExchange
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryExchange(PyObject *__pyx_v_self, struct CThostFtdcExchangeField *__pyx_v_pExchange, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryExchange", 0);

  /* "ptp/TraderApi.pyx":2666
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pExchange != NULL:
 *       self.OnRspQryExchange(None if pExchange is NULL else py_ApiStructure.ExchangeField.from_address(<size_t> pExchange)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2667
 * 
 *   try:
 *     if pExchange != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryExchange(None if pExchange is NULL else py_ApiStructure.ExchangeField.from_address(<size_t> pExchange)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pExchange != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2668
 *   try:
 *     if pExchange != NULL:
 *       self.OnRspQryExchange(None if pExchange is NULL else py_ApiStructure.ExchangeField.from_address(<size_t> pExchange)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryExchange); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2668, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pExchange == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2668, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ExchangeField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2668, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2668, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pExchange)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2668, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2668, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2668, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2668, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2668, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2668, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2669
 *     if pExchange != NULL:
 *       self.OnRspQryExchange(None if pExchange is NULL else py_ApiStructure.ExchangeField.from_address(<size_t> pExchange)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2669, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2669, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2669, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2669, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2669, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2669, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2669, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2669, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2669, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2671
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryExchange', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2671, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2671, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2668, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2668, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2668, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2668, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2667
 * 
 *   try:
 *     if pExchange != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryExchange(None if pExchange is NULL else py_ApiStructure.ExchangeField.from_address(<size_t> pExchange)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2666
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pExchange != NULL:
 *       self.OnRspQryExchange(None if pExchange is NULL else py_ApiStructure.ExchangeField.from_address(<size_t> pExchange)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2672
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryExchange', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryExchange", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2672, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2673
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryExchange', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2673, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2673, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2673, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2673, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2673, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__126, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2673, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2672
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryExchange', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2666
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pExchange != NULL:
 *       self.OnRspQryExchange(None if pExchange is NULL else py_ApiStructure.ExchangeField.from_address(<size_t> pExchange)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2675
 *       myEnv.logger.error('OnRspQryExchange', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2660
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryExchange(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcExchangeField *pExchange
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryExchange", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2681
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryProduct(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcProductField *pProduct
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryProduct(PyObject *__pyx_v_self, struct CThostFtdcProductField *__pyx_v_pProduct, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryProduct", 0);

  /* "ptp/TraderApi.pyx":2687
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pProduct != NULL:
 *       self.OnRspQryProduct(None if pProduct is NULL else py_ApiStructure.ProductField.from_address(<size_t> pProduct)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2688
 * 
 *   try:
 *     if pProduct != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryProduct(None if pProduct is NULL else py_ApiStructure.ProductField.from_address(<size_t> pProduct)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pProduct != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2689
 *   try:
 *     if pProduct != NULL:
 *       self.OnRspQryProduct(None if pProduct is NULL else py_ApiStructure.ProductField.from_address(<size_t> pProduct)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryProduct); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2689, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pProduct == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2689, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ProductField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2689, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2689, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pProduct)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2689, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2689, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2689, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2689, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2689, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2689, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2690
 *     if pProduct != NULL:
 *       self.OnRspQryProduct(None if pProduct is NULL else py_ApiStructure.ProductField.from_address(<size_t> pProduct)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2690, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2690, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2690, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2690, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2690, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2690, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2690, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2690, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2690, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2692
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryProduct', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2692, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2692, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2689, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2689, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2689, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2689, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2688
 * 
 *   try:
 *     if pProduct != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryProduct(None if pProduct is NULL else py_ApiStructure.ProductField.from_address(<size_t> pProduct)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2687
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pProduct != NULL:
 *       self.OnRspQryProduct(None if pProduct is NULL else py_ApiStructure.ProductField.from_address(<size_t> pProduct)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2693
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryProduct', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryProduct", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2693, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2694
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryProduct', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2694, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2694, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2694, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2694, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2694, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__127, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2694, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2693
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryProduct', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2687
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pProduct != NULL:
 *       self.OnRspQryProduct(None if pProduct is NULL else py_ApiStructure.ProductField.from_address(<size_t> pProduct)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2696
 *       myEnv.logger.error('OnRspQryProduct', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2681
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryProduct(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcProductField *pProduct
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryProduct", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2702
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryInstrument(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInstrumentField *pInstrument
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryInstrument(PyObject *__pyx_v_self, struct CThostFtdcInstrumentField *__pyx_v_pInstrument, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryInstrument", 0);

  /* "ptp/TraderApi.pyx":2708
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInstrument != NULL:
 *       self.OnRspQryInstrument(None if pInstrument is NULL else py_ApiStructure.InstrumentField.from_address(<size_t> pInstrument)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2709
 * 
 *   try:
 *     if pInstrument != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryInstrument(None if pInstrument is NULL else py_ApiStructure.InstrumentField.from_address(<size_t> pInstrument)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pInstrument != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2710
 *   try:
 *     if pInstrument != NULL:
 *       self.OnRspQryInstrument(None if pInstrument is NULL else py_ApiStructure.InstrumentField.from_address(<size_t> pInstrument)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryInstrument); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2710, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInstrument == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2710, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InstrumentField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2710, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2710, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInstrument)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2710, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2710, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2710, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2710, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2710, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2710, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2711
 *     if pInstrument != NULL:
 *       self.OnRspQryInstrument(None if pInstrument is NULL else py_ApiStructure.InstrumentField.from_address(<size_t> pInstrument)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2711, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2711, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2711, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2711, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2711, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2711, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2711, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2711, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2711, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2713
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInstrument', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2713, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2713, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2710, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2710, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2710, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2710, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2709
 * 
 *   try:
 *     if pInstrument != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryInstrument(None if pInstrument is NULL else py_ApiStructure.InstrumentField.from_address(<size_t> pInstrument)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2708
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInstrument != NULL:
 *       self.OnRspQryInstrument(None if pInstrument is NULL else py_ApiStructure.InstrumentField.from_address(<size_t> pInstrument)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2714
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryInstrument', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryInstrument", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2714, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2715
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInstrument', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2715, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2715, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2715, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2715, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2715, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__128, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2715, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2714
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryInstrument', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2708
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInstrument != NULL:
 *       self.OnRspQryInstrument(None if pInstrument is NULL else py_ApiStructure.InstrumentField.from_address(<size_t> pInstrument)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2717
 *       myEnv.logger.error('OnRspQryInstrument', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2702
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryInstrument(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInstrumentField *pInstrument
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryInstrument", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2723
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryDepthMarketData(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcDepthMarketDataField *pDepthMarketData
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryDepthMarketData(PyObject *__pyx_v_self, struct CThostFtdcDepthMarketDataField *__pyx_v_pDepthMarketData, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryDepthMarketData", 0);

  /* "ptp/TraderApi.pyx":2729
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pDepthMarketData != NULL:
 *       self.OnRspQryDepthMarketData(None if pDepthMarketData is NULL else py_ApiStructure.DepthMarketDataField.from_address(<size_t> pDepthMarketData)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2730
 * 
 *   try:
 *     if pDepthMarketData != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryDepthMarketData(None if pDepthMarketData is NULL else py_ApiStructure.DepthMarketDataField.from_address(<size_t> pDepthMarketData)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pDepthMarketData != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2731
 *   try:
 *     if pDepthMarketData != NULL:
 *       self.OnRspQryDepthMarketData(None if pDepthMarketData is NULL else py_ApiStructure.DepthMarketDataField.from_address(<size_t> pDepthMarketData)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryDepthMarketData); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2731, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pDepthMarketData == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2731, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_DepthMarketDataField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2731, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2731, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pDepthMarketData)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2731, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2731, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2731, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2731, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2731, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2731, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2732
 *     if pDepthMarketData != NULL:
 *       self.OnRspQryDepthMarketData(None if pDepthMarketData is NULL else py_ApiStructure.DepthMarketDataField.from_address(<size_t> pDepthMarketData)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2732, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2732, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2732, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2732, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2732, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2732, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2732, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2732, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2732, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2734
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryDepthMarketData', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2734, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2734, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2731, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2731, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2731, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2731, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2730
 * 
 *   try:
 *     if pDepthMarketData != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryDepthMarketData(None if pDepthMarketData is NULL else py_ApiStructure.DepthMarketDataField.from_address(<size_t> pDepthMarketData)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2729
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pDepthMarketData != NULL:
 *       self.OnRspQryDepthMarketData(None if pDepthMarketData is NULL else py_ApiStructure.DepthMarketDataField.from_address(<size_t> pDepthMarketData)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2735
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryDepthMarketData', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryDepthMarketData", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2735, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2736
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryDepthMarketData', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2736, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2736, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2736, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2736, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2736, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__129, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2736, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2735
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryDepthMarketData', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2729
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pDepthMarketData != NULL:
 *       self.OnRspQryDepthMarketData(None if pDepthMarketData is NULL else py_ApiStructure.DepthMarketDataField.from_address(<size_t> pDepthMarketData)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2738
 *       myEnv.logger.error('OnRspQryDepthMarketData', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2723
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryDepthMarketData(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcDepthMarketDataField *pDepthMarketData
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryDepthMarketData", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2744
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQrySettlementInfo(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcSettlementInfoField *pSettlementInfo
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQrySettlementInfo(PyObject *__pyx_v_self, struct CThostFtdcSettlementInfoField *__pyx_v_pSettlementInfo, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQrySettlementInfo", 0);

  /* "ptp/TraderApi.pyx":2750
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pSettlementInfo != NULL:
 *       self.OnRspQrySettlementInfo(None if pSettlementInfo is NULL else py_ApiStructure.SettlementInfoField.from_address(<size_t> pSettlementInfo)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2751
 * 
 *   try:
 *     if pSettlementInfo != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQrySettlementInfo(None if pSettlementInfo is NULL else py_ApiStructure.SettlementInfoField.from_address(<size_t> pSettlementInfo)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pSettlementInfo != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2752
 *   try:
 *     if pSettlementInfo != NULL:
 *       self.OnRspQrySettlementInfo(None if pSettlementInfo is NULL else py_ApiStructure.SettlementInfoField.from_address(<size_t> pSettlementInfo)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQrySettlementInfo); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2752, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pSettlementInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2752, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_SettlementInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2752, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2752, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pSettlementInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2752, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2752, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2752, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2752, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2752, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2752, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2753
 *     if pSettlementInfo != NULL:
 *       self.OnRspQrySettlementInfo(None if pSettlementInfo is NULL else py_ApiStructure.SettlementInfoField.from_address(<size_t> pSettlementInfo)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2753, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2753, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2753, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2753, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2753, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2753, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2753, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2753, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2753, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2755
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQrySettlementInfo', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2755, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2755, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2752, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2752, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2752, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2752, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2751
 * 
 *   try:
 *     if pSettlementInfo != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQrySettlementInfo(None if pSettlementInfo is NULL else py_ApiStructure.SettlementInfoField.from_address(<size_t> pSettlementInfo)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2750
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pSettlementInfo != NULL:
 *       self.OnRspQrySettlementInfo(None if pSettlementInfo is NULL else py_ApiStructure.SettlementInfoField.from_address(<size_t> pSettlementInfo)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2756
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQrySettlementInfo', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQrySettlementInfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2756, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2757
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQrySettlementInfo', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2757, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2757, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2757, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2757, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2757, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__130, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2757, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2756
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQrySettlementInfo', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2750
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pSettlementInfo != NULL:
 *       self.OnRspQrySettlementInfo(None if pSettlementInfo is NULL else py_ApiStructure.SettlementInfoField.from_address(<size_t> pSettlementInfo)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2759
 *       myEnv.logger.error('OnRspQrySettlementInfo', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2744
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQrySettlementInfo(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcSettlementInfoField *pSettlementInfo
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQrySettlementInfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2765
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryTransferBank(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcTransferBankField *pTransferBank
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryTransferBank(PyObject *__pyx_v_self, struct CThostFtdcTransferBankField *__pyx_v_pTransferBank, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryTransferBank", 0);

  /* "ptp/TraderApi.pyx":2771
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTransferBank != NULL:
 *       self.OnRspQryTransferBank(None if pTransferBank is NULL else py_ApiStructure.TransferBankField.from_address(<size_t> pTransferBank)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2772
 * 
 *   try:
 *     if pTransferBank != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryTransferBank(None if pTransferBank is NULL else py_ApiStructure.TransferBankField.from_address(<size_t> pTransferBank)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pTransferBank != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2773
 *   try:
 *     if pTransferBank != NULL:
 *       self.OnRspQryTransferBank(None if pTransferBank is NULL else py_ApiStructure.TransferBankField.from_address(<size_t> pTransferBank)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryTransferBank); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2773, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pTransferBank == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2773, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_TransferBankField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2773, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2773, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pTransferBank)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2773, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2773, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2773, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2773, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2773, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2773, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2774
 *     if pTransferBank != NULL:
 *       self.OnRspQryTransferBank(None if pTransferBank is NULL else py_ApiStructure.TransferBankField.from_address(<size_t> pTransferBank)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2774, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2774, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2774, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2774, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2774, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2774, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2774, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2774, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2774, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2776
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryTransferBank', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2776, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2776, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2773, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2773, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2773, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2773, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2772
 * 
 *   try:
 *     if pTransferBank != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryTransferBank(None if pTransferBank is NULL else py_ApiStructure.TransferBankField.from_address(<size_t> pTransferBank)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2771
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTransferBank != NULL:
 *       self.OnRspQryTransferBank(None if pTransferBank is NULL else py_ApiStructure.TransferBankField.from_address(<size_t> pTransferBank)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2777
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryTransferBank', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryTransferBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2777, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2778
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryTransferBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2778, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2778, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2778, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2778, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2778, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__131, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2778, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2777
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryTransferBank', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2771
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTransferBank != NULL:
 *       self.OnRspQryTransferBank(None if pTransferBank is NULL else py_ApiStructure.TransferBankField.from_address(<size_t> pTransferBank)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2780
 *       myEnv.logger.error('OnRspQryTransferBank', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2765
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryTransferBank(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcTransferBankField *pTransferBank
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryTransferBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2786
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryInvestorPositionDetail(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInvestorPositionDetailField *pInvestorPositionDetail
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryInvestorPositionDetail(PyObject *__pyx_v_self, struct CThostFtdcInvestorPositionDetailField *__pyx_v_pInvestorPositionDetail, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryInvestorPositionDetail", 0);

  /* "ptp/TraderApi.pyx":2792
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInvestorPositionDetail != NULL:
 *       self.OnRspQryInvestorPositionDetail(None if pInvestorPositionDetail is NULL else py_ApiStructure.InvestorPositionDetailField.from_address(<size_t> pInvestorPositionDetail)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2793
 * 
 *   try:
 *     if pInvestorPositionDetail != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryInvestorPositionDetail(None if pInvestorPositionDetail is NULL else py_ApiStructure.InvestorPositionDetailField.from_address(<size_t> pInvestorPositionDetail)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pInvestorPositionDetail != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2794
 *   try:
 *     if pInvestorPositionDetail != NULL:
 *       self.OnRspQryInvestorPositionDetail(None if pInvestorPositionDetail is NULL else py_ApiStructure.InvestorPositionDetailField.from_address(<size_t> pInvestorPositionDetail)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryInvestorPositionDetail); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2794, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInvestorPositionDetail == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2794, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InvestorPositionDetailField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2794, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2794, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInvestorPositionDetail)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2794, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2794, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2794, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2794, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2794, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2794, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2795
 *     if pInvestorPositionDetail != NULL:
 *       self.OnRspQryInvestorPositionDetail(None if pInvestorPositionDetail is NULL else py_ApiStructure.InvestorPositionDetailField.from_address(<size_t> pInvestorPositionDetail)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2795, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2795, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2795, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2795, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2795, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2795, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2795, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2795, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2795, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2797
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInvestorPositionDetail', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2797, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2797, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2794, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2794, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2794, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2794, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2793
 * 
 *   try:
 *     if pInvestorPositionDetail != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryInvestorPositionDetail(None if pInvestorPositionDetail is NULL else py_ApiStructure.InvestorPositionDetailField.from_address(<size_t> pInvestorPositionDetail)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2792
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInvestorPositionDetail != NULL:
 *       self.OnRspQryInvestorPositionDetail(None if pInvestorPositionDetail is NULL else py_ApiStructure.InvestorPositionDetailField.from_address(<size_t> pInvestorPositionDetail)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2798
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryInvestorPositionDetail', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryInvestorPositionDetail", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2798, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2799
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInvestorPositionDetail', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2799, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2799, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2799, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2799, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2799, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__132, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2799, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2798
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryInvestorPositionDetail', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2792
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInvestorPositionDetail != NULL:
 *       self.OnRspQryInvestorPositionDetail(None if pInvestorPositionDetail is NULL else py_ApiStructure.InvestorPositionDetailField.from_address(<size_t> pInvestorPositionDetail)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2801
 *       myEnv.logger.error('OnRspQryInvestorPositionDetail', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2786
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryInvestorPositionDetail(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInvestorPositionDetailField *pInvestorPositionDetail
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryInvestorPositionDetail", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2807
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryNotice(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcNoticeField *pNotice
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryNotice(PyObject *__pyx_v_self, struct CThostFtdcNoticeField *__pyx_v_pNotice, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryNotice", 0);

  /* "ptp/TraderApi.pyx":2813
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pNotice != NULL:
 *       self.OnRspQryNotice(None if pNotice is NULL else py_ApiStructure.NoticeField.from_address(<size_t> pNotice)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2814
 * 
 *   try:
 *     if pNotice != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryNotice(None if pNotice is NULL else py_ApiStructure.NoticeField.from_address(<size_t> pNotice)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pNotice != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2815
 *   try:
 *     if pNotice != NULL:
 *       self.OnRspQryNotice(None if pNotice is NULL else py_ApiStructure.NoticeField.from_address(<size_t> pNotice)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryNotice); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2815, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pNotice == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2815, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_NoticeField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2815, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2815, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pNotice)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2815, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2815, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2815, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2815, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2815, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2815, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2816
 *     if pNotice != NULL:
 *       self.OnRspQryNotice(None if pNotice is NULL else py_ApiStructure.NoticeField.from_address(<size_t> pNotice)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2816, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2816, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2816, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2816, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2816, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2816, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2816, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2816, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2816, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2818
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryNotice', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2818, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2818, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2815, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2815, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2815, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2815, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2814
 * 
 *   try:
 *     if pNotice != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryNotice(None if pNotice is NULL else py_ApiStructure.NoticeField.from_address(<size_t> pNotice)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2813
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pNotice != NULL:
 *       self.OnRspQryNotice(None if pNotice is NULL else py_ApiStructure.NoticeField.from_address(<size_t> pNotice)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2819
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryNotice', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryNotice", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2819, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2820
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryNotice', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2820, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2820, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2820, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2820, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2820, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__133, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2820, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2819
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryNotice', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2813
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pNotice != NULL:
 *       self.OnRspQryNotice(None if pNotice is NULL else py_ApiStructure.NoticeField.from_address(<size_t> pNotice)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2822
 *       myEnv.logger.error('OnRspQryNotice', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2807
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryNotice(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcNoticeField *pNotice
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryNotice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2828
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQrySettlementInfoConfirm(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQrySettlementInfoConfirm(PyObject *__pyx_v_self, struct CThostFtdcSettlementInfoConfirmField *__pyx_v_pSettlementInfoConfirm, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQrySettlementInfoConfirm", 0);

  /* "ptp/TraderApi.pyx":2834
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pSettlementInfoConfirm != NULL:
 *       self.OnRspQrySettlementInfoConfirm(None if pSettlementInfoConfirm is NULL else py_ApiStructure.SettlementInfoConfirmField.from_address(<size_t> pSettlementInfoConfirm)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2835
 * 
 *   try:
 *     if pSettlementInfoConfirm != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQrySettlementInfoConfirm(None if pSettlementInfoConfirm is NULL else py_ApiStructure.SettlementInfoConfirmField.from_address(<size_t> pSettlementInfoConfirm)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pSettlementInfoConfirm != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2836
 *   try:
 *     if pSettlementInfoConfirm != NULL:
 *       self.OnRspQrySettlementInfoConfirm(None if pSettlementInfoConfirm is NULL else py_ApiStructure.SettlementInfoConfirmField.from_address(<size_t> pSettlementInfoConfirm)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQrySettlementInfoConfirm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2836, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pSettlementInfoConfirm == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2836, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_SettlementInfoConfirmField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2836, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2836, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pSettlementInfoConfirm)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2836, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2836, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2836, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2836, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2836, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2836, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2837
 *     if pSettlementInfoConfirm != NULL:
 *       self.OnRspQrySettlementInfoConfirm(None if pSettlementInfoConfirm is NULL else py_ApiStructure.SettlementInfoConfirmField.from_address(<size_t> pSettlementInfoConfirm)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2837, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2837, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2837, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2837, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2837, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2837, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2837, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2837, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2837, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2839
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQrySettlementInfoConfirm', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2839, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2839, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2836, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2836, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2836, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2836, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2835
 * 
 *   try:
 *     if pSettlementInfoConfirm != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQrySettlementInfoConfirm(None if pSettlementInfoConfirm is NULL else py_ApiStructure.SettlementInfoConfirmField.from_address(<size_t> pSettlementInfoConfirm)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2834
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pSettlementInfoConfirm != NULL:
 *       self.OnRspQrySettlementInfoConfirm(None if pSettlementInfoConfirm is NULL else py_ApiStructure.SettlementInfoConfirmField.from_address(<size_t> pSettlementInfoConfirm)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2840
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQrySettlementInfoConfirm', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQrySettlementInfoConfirm", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2840, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2841
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQrySettlementInfoConfirm', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2841, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2841, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2841, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2841, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2841, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__134, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2841, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2840
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQrySettlementInfoConfirm', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2834
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pSettlementInfoConfirm != NULL:
 *       self.OnRspQrySettlementInfoConfirm(None if pSettlementInfoConfirm is NULL else py_ApiStructure.SettlementInfoConfirmField.from_address(<size_t> pSettlementInfoConfirm)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2843
 *       myEnv.logger.error('OnRspQrySettlementInfoConfirm', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2828
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQrySettlementInfoConfirm(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQrySettlementInfoConfirm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2849
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryInvestorPositionCombineDetail(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInvestorPositionCombineDetailField *pInvestorPositionCombineDetail
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryInvestorPositionCombineDetail(PyObject *__pyx_v_self, struct CThostFtdcInvestorPositionCombineDetailField *__pyx_v_pInvestorPositionCombineDetail, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryInvestorPositionCombineDetail", 0);

  /* "ptp/TraderApi.pyx":2855
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInvestorPositionCombineDetail != NULL:
 *       self.OnRspQryInvestorPositionCombineDetail(None if pInvestorPositionCombineDetail is NULL else py_ApiStructure.InvestorPositionCombineDetailField.from_address(<size_t> pInvestorPositionCombineDetail)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2856
 * 
 *   try:
 *     if pInvestorPositionCombineDetail != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryInvestorPositionCombineDetail(None if pInvestorPositionCombineDetail is NULL else py_ApiStructure.InvestorPositionCombineDetailField.from_address(<size_t> pInvestorPositionCombineDetail)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pInvestorPositionCombineDetail != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2857
 *   try:
 *     if pInvestorPositionCombineDetail != NULL:
 *       self.OnRspQryInvestorPositionCombineDetail(None if pInvestorPositionCombineDetail is NULL else py_ApiStructure.InvestorPositionCombineDetailField.from_address(<size_t> pInvestorPositionCombineDetail)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryInvestorPositionCombineD); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2857, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInvestorPositionCombineDetail == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2857, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InvestorPositionCombineDetailFie); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2857, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2857, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInvestorPositionCombineDetail)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2857, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2857, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2857, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2857, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2857, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2857, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2858
 *     if pInvestorPositionCombineDetail != NULL:
 *       self.OnRspQryInvestorPositionCombineDetail(None if pInvestorPositionCombineDetail is NULL else py_ApiStructure.InvestorPositionCombineDetailField.from_address(<size_t> pInvestorPositionCombineDetail)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2858, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2858, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2858, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2858, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2858, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2858, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2858, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2858, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2858, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2860
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInvestorPositionCombineDetail', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2860, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2860, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2857, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2857, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2857, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2857, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2856
 * 
 *   try:
 *     if pInvestorPositionCombineDetail != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryInvestorPositionCombineDetail(None if pInvestorPositionCombineDetail is NULL else py_ApiStructure.InvestorPositionCombineDetailField.from_address(<size_t> pInvestorPositionCombineDetail)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2855
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInvestorPositionCombineDetail != NULL:
 *       self.OnRspQryInvestorPositionCombineDetail(None if pInvestorPositionCombineDetail is NULL else py_ApiStructure.InvestorPositionCombineDetailField.from_address(<size_t> pInvestorPositionCombineDetail)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2861
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryInvestorPositionCombineDetail', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryInvestorPositionCombineDetail", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2861, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2862
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInvestorPositionCombineDetail', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2862, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2862, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2862, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2862, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2862, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__135, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2862, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2861
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryInvestorPositionCombineDetail', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2855
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInvestorPositionCombineDetail != NULL:
 *       self.OnRspQryInvestorPositionCombineDetail(None if pInvestorPositionCombineDetail is NULL else py_ApiStructure.InvestorPositionCombineDetailField.from_address(<size_t> pInvestorPositionCombineDetail)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2864
 *       myEnv.logger.error('OnRspQryInvestorPositionCombineDetail', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2849
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryInvestorPositionCombineDetail(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInvestorPositionCombineDetailField *pInvestorPositionCombineDetail
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryInvestorPositionCombineDetail", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2870
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryCFMMCTradingAccountKey(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcCFMMCTradingAccountKeyField *pCFMMCTradingAccountKey
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryCFMMCTradingAccountKey(PyObject *__pyx_v_self, struct CThostFtdcCFMMCTradingAccountKeyField *__pyx_v_pCFMMCTradingAccountKey, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryCFMMCTradingAccountKey", 0);

  /* "ptp/TraderApi.pyx":2876
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pCFMMCTradingAccountKey != NULL:
 *       self.OnRspQryCFMMCTradingAccountKey(None if pCFMMCTradingAccountKey is NULL else py_ApiStructure.CFMMCTradingAccountKeyField.from_address(<size_t> pCFMMCTradingAccountKey)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2877
 * 
 *   try:
 *     if pCFMMCTradingAccountKey != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryCFMMCTradingAccountKey(None if pCFMMCTradingAccountKey is NULL else py_ApiStructure.CFMMCTradingAccountKeyField.from_address(<size_t> pCFMMCTradingAccountKey)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pCFMMCTradingAccountKey != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2878
 *   try:
 *     if pCFMMCTradingAccountKey != NULL:
 *       self.OnRspQryCFMMCTradingAccountKey(None if pCFMMCTradingAccountKey is NULL else py_ApiStructure.CFMMCTradingAccountKeyField.from_address(<size_t> pCFMMCTradingAccountKey)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryCFMMCTradingAccountKey); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2878, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pCFMMCTradingAccountKey == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2878, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_CFMMCTradingAccountKeyField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2878, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2878, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pCFMMCTradingAccountKey)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2878, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2878, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2878, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2878, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2878, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2878, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2879
 *     if pCFMMCTradingAccountKey != NULL:
 *       self.OnRspQryCFMMCTradingAccountKey(None if pCFMMCTradingAccountKey is NULL else py_ApiStructure.CFMMCTradingAccountKeyField.from_address(<size_t> pCFMMCTradingAccountKey)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2879, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2879, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2879, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2879, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2879, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2879, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2879, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2879, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2879, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2881
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryCFMMCTradingAccountKey', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2881, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2881, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2878, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2878, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2878, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2878, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2877
 * 
 *   try:
 *     if pCFMMCTradingAccountKey != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryCFMMCTradingAccountKey(None if pCFMMCTradingAccountKey is NULL else py_ApiStructure.CFMMCTradingAccountKeyField.from_address(<size_t> pCFMMCTradingAccountKey)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2876
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pCFMMCTradingAccountKey != NULL:
 *       self.OnRspQryCFMMCTradingAccountKey(None if pCFMMCTradingAccountKey is NULL else py_ApiStructure.CFMMCTradingAccountKeyField.from_address(<size_t> pCFMMCTradingAccountKey)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2882
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryCFMMCTradingAccountKey', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryCFMMCTradingAccountKey", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2882, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2883
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryCFMMCTradingAccountKey', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2883, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2883, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2883, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2883, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2883, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__136, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2883, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2882
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryCFMMCTradingAccountKey', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2876
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pCFMMCTradingAccountKey != NULL:
 *       self.OnRspQryCFMMCTradingAccountKey(None if pCFMMCTradingAccountKey is NULL else py_ApiStructure.CFMMCTradingAccountKeyField.from_address(<size_t> pCFMMCTradingAccountKey)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2885
 *       myEnv.logger.error('OnRspQryCFMMCTradingAccountKey', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2870
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryCFMMCTradingAccountKey(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcCFMMCTradingAccountKeyField *pCFMMCTradingAccountKey
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryCFMMCTradingAccountKey", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2891
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryEWarrantOffset(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcEWarrantOffsetField *pEWarrantOffset
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryEWarrantOffset(PyObject *__pyx_v_self, struct CThostFtdcEWarrantOffsetField *__pyx_v_pEWarrantOffset, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryEWarrantOffset", 0);

  /* "ptp/TraderApi.pyx":2897
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pEWarrantOffset != NULL:
 *       self.OnRspQryEWarrantOffset(None if pEWarrantOffset is NULL else py_ApiStructure.EWarrantOffsetField.from_address(<size_t> pEWarrantOffset)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2898
 * 
 *   try:
 *     if pEWarrantOffset != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryEWarrantOffset(None if pEWarrantOffset is NULL else py_ApiStructure.EWarrantOffsetField.from_address(<size_t> pEWarrantOffset)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pEWarrantOffset != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2899
 *   try:
 *     if pEWarrantOffset != NULL:
 *       self.OnRspQryEWarrantOffset(None if pEWarrantOffset is NULL else py_ApiStructure.EWarrantOffsetField.from_address(<size_t> pEWarrantOffset)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryEWarrantOffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2899, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pEWarrantOffset == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2899, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_EWarrantOffsetField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2899, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2899, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pEWarrantOffset)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2899, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2899, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2899, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2899, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2899, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2899, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2900
 *     if pEWarrantOffset != NULL:
 *       self.OnRspQryEWarrantOffset(None if pEWarrantOffset is NULL else py_ApiStructure.EWarrantOffsetField.from_address(<size_t> pEWarrantOffset)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2900, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2900, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2900, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2900, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2900, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2900, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2900, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2900, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2900, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2902
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryEWarrantOffset', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2902, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2902, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2899, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2899, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2899, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2899, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2898
 * 
 *   try:
 *     if pEWarrantOffset != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryEWarrantOffset(None if pEWarrantOffset is NULL else py_ApiStructure.EWarrantOffsetField.from_address(<size_t> pEWarrantOffset)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2897
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pEWarrantOffset != NULL:
 *       self.OnRspQryEWarrantOffset(None if pEWarrantOffset is NULL else py_ApiStructure.EWarrantOffsetField.from_address(<size_t> pEWarrantOffset)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2903
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryEWarrantOffset', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryEWarrantOffset", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2903, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2904
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryEWarrantOffset', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2904, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2904, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2904, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2904, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2904, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__137, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2904, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2903
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryEWarrantOffset', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2897
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pEWarrantOffset != NULL:
 *       self.OnRspQryEWarrantOffset(None if pEWarrantOffset is NULL else py_ApiStructure.EWarrantOffsetField.from_address(<size_t> pEWarrantOffset)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2906
 *       myEnv.logger.error('OnRspQryEWarrantOffset', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2891
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryEWarrantOffset(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcEWarrantOffsetField *pEWarrantOffset
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryEWarrantOffset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2912
 * /
 * """
 * cdef extern int   TraderSpi_OnRspQryInvestorProductGroupMargin(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInvestorProductGroupMarginField *pInvestorProductGroupMargin
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryInvestorProductGroupMargin(PyObject *__pyx_v_self, struct CThostFtdcInvestorProductGroupMarginField *__pyx_v_pInvestorProductGroupMargin, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryInvestorProductGroupMargin", 0);

  /* "ptp/TraderApi.pyx":2918
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInvestorProductGroupMargin != NULL:
 *       self.OnRspQryInvestorProductGroupMargin(None if pInvestorProductGroupMargin is NULL else py_ApiStructure.InvestorProductGroupMarginField.from_address(<size_t> pInvestorProductGroupMargin)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2919
 * 
 *   try:
 *     if pInvestorProductGroupMargin != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryInvestorProductGroupMargin(None if pInvestorProductGroupMargin is NULL else py_ApiStructure.InvestorProductGroupMarginField.from_address(<size_t> pInvestorProductGroupMargin)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pInvestorProductGroupMargin != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2920
 *   try:
 *     if pInvestorProductGroupMargin != NULL:
 *       self.OnRspQryInvestorProductGroupMargin(None if pInvestorProductGroupMargin is NULL else py_ApiStructure.InvestorProductGroupMarginField.from_address(<size_t> pInvestorProductGroupMargin)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryInvestorProductGroupMarg); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2920, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInvestorProductGroupMargin == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2920, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InvestorProductGroupMarginField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2920, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2920, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInvestorProductGroupMargin)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2920, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2920, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2920, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2920, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2920, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2920, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2921
 *     if pInvestorProductGroupMargin != NULL:
 *       self.OnRspQryInvestorProductGroupMargin(None if pInvestorProductGroupMargin is NULL else py_ApiStructure.InvestorProductGroupMarginField.from_address(<size_t> pInvestorProductGroupMargin)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2921, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2921, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2921, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2921, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2921, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2921, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2921, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2921, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2921, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2923
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInvestorProductGroupMargin', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2923, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2923, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2920, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2920, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2920, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2920, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2919
 * 
 *   try:
 *     if pInvestorProductGroupMargin != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryInvestorProductGroupMargin(None if pInvestorProductGroupMargin is NULL else py_ApiStructure.InvestorProductGroupMarginField.from_address(<size_t> pInvestorProductGroupMargin)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2918
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInvestorProductGroupMargin != NULL:
 *       self.OnRspQryInvestorProductGroupMargin(None if pInvestorProductGroupMargin is NULL else py_ApiStructure.InvestorProductGroupMarginField.from_address(<size_t> pInvestorProductGroupMargin)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2924
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryInvestorProductGroupMargin', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryInvestorProductGroupMargin", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2924, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2925
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInvestorProductGroupMargin', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2925, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2925, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2925, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2925, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2925, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__138, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2925, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2924
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryInvestorProductGroupMargin', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2918
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInvestorProductGroupMargin != NULL:
 *       self.OnRspQryInvestorProductGroupMargin(None if pInvestorProductGroupMargin is NULL else py_ApiStructure.InvestorProductGroupMarginField.from_address(<size_t> pInvestorProductGroupMargin)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2927
 *       myEnv.logger.error('OnRspQryInvestorProductGroupMargin', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2912
 * /
 * """
 * cdef extern int   TraderSpi_OnRspQryInvestorProductGroupMargin(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInvestorProductGroupMarginField *pInvestorProductGroupMargin
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryInvestorProductGroupMargin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2933
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryExchangeMarginRate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcExchangeMarginRateField *pExchangeMarginRate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryExchangeMarginRate(PyObject *__pyx_v_self, struct CThostFtdcExchangeMarginRateField *__pyx_v_pExchangeMarginRate, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryExchangeMarginRate", 0);

  /* "ptp/TraderApi.pyx":2939
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pExchangeMarginRate != NULL:
 *       self.OnRspQryExchangeMarginRate(None if pExchangeMarginRate is NULL else py_ApiStructure.ExchangeMarginRateField.from_address(<size_t> pExchangeMarginRate)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2940
 * 
 *   try:
 *     if pExchangeMarginRate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryExchangeMarginRate(None if pExchangeMarginRate is NULL else py_ApiStructure.ExchangeMarginRateField.from_address(<size_t> pExchangeMarginRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pExchangeMarginRate != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2941
 *   try:
 *     if pExchangeMarginRate != NULL:
 *       self.OnRspQryExchangeMarginRate(None if pExchangeMarginRate is NULL else py_ApiStructure.ExchangeMarginRateField.from_address(<size_t> pExchangeMarginRate)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryExchangeMarginRate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2941, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pExchangeMarginRate == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2941, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ExchangeMarginRateField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2941, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2941, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pExchangeMarginRate)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2941, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2941, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2941, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2941, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2941, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2941, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2942
 *     if pExchangeMarginRate != NULL:
 *       self.OnRspQryExchangeMarginRate(None if pExchangeMarginRate is NULL else py_ApiStructure.ExchangeMarginRateField.from_address(<size_t> pExchangeMarginRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2942, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2942, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2942, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2942, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2942, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2942, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2942, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2942, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2942, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2944
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryExchangeMarginRate', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2944, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2944, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2941, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2941, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2941, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2941, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2940
 * 
 *   try:
 *     if pExchangeMarginRate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryExchangeMarginRate(None if pExchangeMarginRate is NULL else py_ApiStructure.ExchangeMarginRateField.from_address(<size_t> pExchangeMarginRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2939
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pExchangeMarginRate != NULL:
 *       self.OnRspQryExchangeMarginRate(None if pExchangeMarginRate is NULL else py_ApiStructure.ExchangeMarginRateField.from_address(<size_t> pExchangeMarginRate)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2945
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryExchangeMarginRate', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryExchangeMarginRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2945, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2946
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryExchangeMarginRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2946, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2946, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2946, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2946, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2946, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__139, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2946, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2945
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryExchangeMarginRate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2939
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pExchangeMarginRate != NULL:
 *       self.OnRspQryExchangeMarginRate(None if pExchangeMarginRate is NULL else py_ApiStructure.ExchangeMarginRateField.from_address(<size_t> pExchangeMarginRate)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2948
 *       myEnv.logger.error('OnRspQryExchangeMarginRate', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2933
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryExchangeMarginRate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcExchangeMarginRateField *pExchangeMarginRate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryExchangeMarginRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2954
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryExchangeMarginRateAdjust(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcExchangeMarginRateAdjustField *pExchangeMarginRateAdjust
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryExchangeMarginRateAdjust(PyObject *__pyx_v_self, struct CThostFtdcExchangeMarginRateAdjustField *__pyx_v_pExchangeMarginRateAdjust, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryExchangeMarginRateAdjust", 0);

  /* "ptp/TraderApi.pyx":2960
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pExchangeMarginRateAdjust != NULL:
 *       self.OnRspQryExchangeMarginRateAdjust(None if pExchangeMarginRateAdjust is NULL else py_ApiStructure.ExchangeMarginRateAdjustField.from_address(<size_t> pExchangeMarginRateAdjust)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2961
 * 
 *   try:
 *     if pExchangeMarginRateAdjust != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryExchangeMarginRateAdjust(None if pExchangeMarginRateAdjust is NULL else py_ApiStructure.ExchangeMarginRateAdjustField.from_address(<size_t> pExchangeMarginRateAdjust)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pExchangeMarginRateAdjust != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2962
 *   try:
 *     if pExchangeMarginRateAdjust != NULL:
 *       self.OnRspQryExchangeMarginRateAdjust(None if pExchangeMarginRateAdjust is NULL else py_ApiStructure.ExchangeMarginRateAdjustField.from_address(<size_t> pExchangeMarginRateAdjust)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryExchangeMarginRateAdjust); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2962, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pExchangeMarginRateAdjust == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2962, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ExchangeMarginRateAdjustField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2962, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2962, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pExchangeMarginRateAdjust)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2962, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2962, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2962, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2962, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2962, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2962, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2963
 *     if pExchangeMarginRateAdjust != NULL:
 *       self.OnRspQryExchangeMarginRateAdjust(None if pExchangeMarginRateAdjust is NULL else py_ApiStructure.ExchangeMarginRateAdjustField.from_address(<size_t> pExchangeMarginRateAdjust)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2963, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2963, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2963, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2963, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2963, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2963, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2963, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2963, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2963, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2965
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryExchangeMarginRateAdjust', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2965, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2965, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2962, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2962, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2962, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2962, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2961
 * 
 *   try:
 *     if pExchangeMarginRateAdjust != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryExchangeMarginRateAdjust(None if pExchangeMarginRateAdjust is NULL else py_ApiStructure.ExchangeMarginRateAdjustField.from_address(<size_t> pExchangeMarginRateAdjust)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2960
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pExchangeMarginRateAdjust != NULL:
 *       self.OnRspQryExchangeMarginRateAdjust(None if pExchangeMarginRateAdjust is NULL else py_ApiStructure.ExchangeMarginRateAdjustField.from_address(<size_t> pExchangeMarginRateAdjust)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2966
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryExchangeMarginRateAdjust', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryExchangeMarginRateAdjust", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2966, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2967
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryExchangeMarginRateAdjust', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2967, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2967, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2967, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2967, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2967, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__140, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2967, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2966
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryExchangeMarginRateAdjust', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2960
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pExchangeMarginRateAdjust != NULL:
 *       self.OnRspQryExchangeMarginRateAdjust(None if pExchangeMarginRateAdjust is NULL else py_ApiStructure.ExchangeMarginRateAdjustField.from_address(<size_t> pExchangeMarginRateAdjust)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2969
 *       myEnv.logger.error('OnRspQryExchangeMarginRateAdjust', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2954
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryExchangeMarginRateAdjust(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcExchangeMarginRateAdjustField *pExchangeMarginRateAdjust
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryExchangeMarginRateAdjust", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2975
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryExchangeRate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcExchangeRateField *pExchangeRate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryExchangeRate(PyObject *__pyx_v_self, struct CThostFtdcExchangeRateField *__pyx_v_pExchangeRate, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryExchangeRate", 0);

  /* "ptp/TraderApi.pyx":2981
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pExchangeRate != NULL:
 *       self.OnRspQryExchangeRate(None if pExchangeRate is NULL else py_ApiStructure.ExchangeRateField.from_address(<size_t> pExchangeRate)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":2982
 * 
 *   try:
 *     if pExchangeRate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryExchangeRate(None if pExchangeRate is NULL else py_ApiStructure.ExchangeRateField.from_address(<size_t> pExchangeRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pExchangeRate != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":2983
 *   try:
 *     if pExchangeRate != NULL:
 *       self.OnRspQryExchangeRate(None if pExchangeRate is NULL else py_ApiStructure.ExchangeRateField.from_address(<size_t> pExchangeRate)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryExchangeRate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2983, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pExchangeRate == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2983, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ExchangeRateField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2983, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2983, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pExchangeRate)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2983, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2983, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2983, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2983, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2983, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2983, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":2984
 *     if pExchangeRate != NULL:
 *       self.OnRspQryExchangeRate(None if pExchangeRate is NULL else py_ApiStructure.ExchangeRateField.from_address(<size_t> pExchangeRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2984, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2984, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2984, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2984, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2984, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2984, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2984, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2984, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2984, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":2986
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryExchangeRate', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2986, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2986, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2983, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2983, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2983, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2983, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":2982
 * 
 *   try:
 *     if pExchangeRate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryExchangeRate(None if pExchangeRate is NULL else py_ApiStructure.ExchangeRateField.from_address(<size_t> pExchangeRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":2981
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pExchangeRate != NULL:
 *       self.OnRspQryExchangeRate(None if pExchangeRate is NULL else py_ApiStructure.ExchangeRateField.from_address(<size_t> pExchangeRate)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":2987
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryExchangeRate', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryExchangeRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 2987, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":2988
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryExchangeRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2988, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2988, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2988, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2988, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 2988, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__141, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2988, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":2987
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryExchangeRate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":2981
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pExchangeRate != NULL:
 *       self.OnRspQryExchangeRate(None if pExchangeRate is NULL else py_ApiStructure.ExchangeRateField.from_address(<size_t> pExchangeRate)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":2990
 *       myEnv.logger.error('OnRspQryExchangeRate', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2975
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryExchangeRate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcExchangeRateField *pExchangeRate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryExchangeRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":2996
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQrySecAgentACIDMap(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcSecAgentACIDMapField *pSecAgentACIDMap
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQrySecAgentACIDMap(PyObject *__pyx_v_self, struct CThostFtdcSecAgentACIDMapField *__pyx_v_pSecAgentACIDMap, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQrySecAgentACIDMap", 0);

  /* "ptp/TraderApi.pyx":3002
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pSecAgentACIDMap != NULL:
 *       self.OnRspQrySecAgentACIDMap(None if pSecAgentACIDMap is NULL else py_ApiStructure.SecAgentACIDMapField.from_address(<size_t> pSecAgentACIDMap)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3003
 * 
 *   try:
 *     if pSecAgentACIDMap != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQrySecAgentACIDMap(None if pSecAgentACIDMap is NULL else py_ApiStructure.SecAgentACIDMapField.from_address(<size_t> pSecAgentACIDMap)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pSecAgentACIDMap != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3004
 *   try:
 *     if pSecAgentACIDMap != NULL:
 *       self.OnRspQrySecAgentACIDMap(None if pSecAgentACIDMap is NULL else py_ApiStructure.SecAgentACIDMapField.from_address(<size_t> pSecAgentACIDMap)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQrySecAgentACIDMap); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3004, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pSecAgentACIDMap == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3004, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_SecAgentACIDMapField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3004, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3004, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pSecAgentACIDMap)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3004, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3004, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3004, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3004, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3004, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3004, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3005
 *     if pSecAgentACIDMap != NULL:
 *       self.OnRspQrySecAgentACIDMap(None if pSecAgentACIDMap is NULL else py_ApiStructure.SecAgentACIDMapField.from_address(<size_t> pSecAgentACIDMap)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3005, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3005, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3005, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3005, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3005, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3005, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3005, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3005, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3005, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3007
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQrySecAgentACIDMap', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3007, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3007, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3004, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3004, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3004, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3004, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3003
 * 
 *   try:
 *     if pSecAgentACIDMap != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQrySecAgentACIDMap(None if pSecAgentACIDMap is NULL else py_ApiStructure.SecAgentACIDMapField.from_address(<size_t> pSecAgentACIDMap)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3002
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pSecAgentACIDMap != NULL:
 *       self.OnRspQrySecAgentACIDMap(None if pSecAgentACIDMap is NULL else py_ApiStructure.SecAgentACIDMapField.from_address(<size_t> pSecAgentACIDMap)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3008
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQrySecAgentACIDMap', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQrySecAgentACIDMap", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3008, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3009
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQrySecAgentACIDMap', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3009, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3009, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3009, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3009, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3009, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__142, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3009, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3008
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQrySecAgentACIDMap', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3002
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pSecAgentACIDMap != NULL:
 *       self.OnRspQrySecAgentACIDMap(None if pSecAgentACIDMap is NULL else py_ApiStructure.SecAgentACIDMapField.from_address(<size_t> pSecAgentACIDMap)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3011
 *       myEnv.logger.error('OnRspQrySecAgentACIDMap', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":2996
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQrySecAgentACIDMap(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcSecAgentACIDMapField *pSecAgentACIDMap
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQrySecAgentACIDMap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3017
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryProductExchRate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcProductExchRateField *pProductExchRate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryProductExchRate(PyObject *__pyx_v_self, struct CThostFtdcProductExchRateField *__pyx_v_pProductExchRate, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryProductExchRate", 0);

  /* "ptp/TraderApi.pyx":3023
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pProductExchRate != NULL:
 *       self.OnRspQryProductExchRate(None if pProductExchRate is NULL else py_ApiStructure.ProductExchRateField.from_address(<size_t> pProductExchRate)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3024
 * 
 *   try:
 *     if pProductExchRate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryProductExchRate(None if pProductExchRate is NULL else py_ApiStructure.ProductExchRateField.from_address(<size_t> pProductExchRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pProductExchRate != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3025
 *   try:
 *     if pProductExchRate != NULL:
 *       self.OnRspQryProductExchRate(None if pProductExchRate is NULL else py_ApiStructure.ProductExchRateField.from_address(<size_t> pProductExchRate)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryProductExchRate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3025, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pProductExchRate == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3025, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ProductExchRateField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3025, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3025, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pProductExchRate)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3025, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3025, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3025, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3025, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3025, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3025, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3026
 *     if pProductExchRate != NULL:
 *       self.OnRspQryProductExchRate(None if pProductExchRate is NULL else py_ApiStructure.ProductExchRateField.from_address(<size_t> pProductExchRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3026, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3026, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3026, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3026, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3026, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3026, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3026, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3026, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3026, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3028
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryProductExchRate', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3028, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3028, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3025, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3025, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3025, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3025, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3024
 * 
 *   try:
 *     if pProductExchRate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryProductExchRate(None if pProductExchRate is NULL else py_ApiStructure.ProductExchRateField.from_address(<size_t> pProductExchRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3023
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pProductExchRate != NULL:
 *       self.OnRspQryProductExchRate(None if pProductExchRate is NULL else py_ApiStructure.ProductExchRateField.from_address(<size_t> pProductExchRate)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3029
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryProductExchRate', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryProductExchRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3029, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3030
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryProductExchRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3030, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3030, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3030, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3030, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3030, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__143, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3030, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3029
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryProductExchRate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3023
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pProductExchRate != NULL:
 *       self.OnRspQryProductExchRate(None if pProductExchRate is NULL else py_ApiStructure.ProductExchRateField.from_address(<size_t> pProductExchRate)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3032
 *       myEnv.logger.error('OnRspQryProductExchRate', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3017
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryProductExchRate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcProductExchRateField *pProductExchRate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryProductExchRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3038
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryProductGroup(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcProductGroupField *pProductGroup
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryProductGroup(PyObject *__pyx_v_self, struct CThostFtdcProductGroupField *__pyx_v_pProductGroup, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryProductGroup", 0);

  /* "ptp/TraderApi.pyx":3044
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pProductGroup != NULL:
 *       self.OnRspQryProductGroup(None if pProductGroup is NULL else py_ApiStructure.ProductGroupField.from_address(<size_t> pProductGroup)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3045
 * 
 *   try:
 *     if pProductGroup != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryProductGroup(None if pProductGroup is NULL else py_ApiStructure.ProductGroupField.from_address(<size_t> pProductGroup)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pProductGroup != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3046
 *   try:
 *     if pProductGroup != NULL:
 *       self.OnRspQryProductGroup(None if pProductGroup is NULL else py_ApiStructure.ProductGroupField.from_address(<size_t> pProductGroup)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryProductGroup); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3046, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pProductGroup == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3046, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ProductGroupField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3046, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3046, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pProductGroup)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3046, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3046, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3046, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3046, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3046, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3046, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3047
 *     if pProductGroup != NULL:
 *       self.OnRspQryProductGroup(None if pProductGroup is NULL else py_ApiStructure.ProductGroupField.from_address(<size_t> pProductGroup)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3047, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3047, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3047, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3047, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3047, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3047, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3047, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3047, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3047, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3049
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryProductGroup', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3049, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3049, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3046, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3046, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3046, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3046, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3045
 * 
 *   try:
 *     if pProductGroup != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryProductGroup(None if pProductGroup is NULL else py_ApiStructure.ProductGroupField.from_address(<size_t> pProductGroup)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3044
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pProductGroup != NULL:
 *       self.OnRspQryProductGroup(None if pProductGroup is NULL else py_ApiStructure.ProductGroupField.from_address(<size_t> pProductGroup)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3050
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryProductGroup', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryProductGroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3050, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3051
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryProductGroup', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3051, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3051, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3051, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3051, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3051, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__144, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3051, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3050
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryProductGroup', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3044
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pProductGroup != NULL:
 *       self.OnRspQryProductGroup(None if pProductGroup is NULL else py_ApiStructure.ProductGroupField.from_address(<size_t> pProductGroup)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3053
 *       myEnv.logger.error('OnRspQryProductGroup', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3038
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryProductGroup(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcProductGroupField *pProductGroup
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryProductGroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3059
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryMMInstrumentCommissionRate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcMMInstrumentCommissionRateField *pMMInstrumentCommissionRate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryMMInstrumentCommissionRate(PyObject *__pyx_v_self, struct CThostFtdcMMInstrumentCommissionRateField *__pyx_v_pMMInstrumentCommissionRate, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryMMInstrumentCommissionRate", 0);

  /* "ptp/TraderApi.pyx":3065
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pMMInstrumentCommissionRate != NULL:
 *       self.OnRspQryMMInstrumentCommissionRate(None if pMMInstrumentCommissionRate is NULL else py_ApiStructure.MMInstrumentCommissionRateField.from_address(<size_t> pMMInstrumentCommissionRate)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3066
 * 
 *   try:
 *     if pMMInstrumentCommissionRate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryMMInstrumentCommissionRate(None if pMMInstrumentCommissionRate is NULL else py_ApiStructure.MMInstrumentCommissionRateField.from_address(<size_t> pMMInstrumentCommissionRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pMMInstrumentCommissionRate != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3067
 *   try:
 *     if pMMInstrumentCommissionRate != NULL:
 *       self.OnRspQryMMInstrumentCommissionRate(None if pMMInstrumentCommissionRate is NULL else py_ApiStructure.MMInstrumentCommissionRateField.from_address(<size_t> pMMInstrumentCommissionRate)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryMMInstrumentCommissionRa); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3067, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pMMInstrumentCommissionRate == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3067, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_MMInstrumentCommissionRateField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3067, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3067, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pMMInstrumentCommissionRate)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3067, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3067, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3067, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3067, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3067, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3067, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3068
 *     if pMMInstrumentCommissionRate != NULL:
 *       self.OnRspQryMMInstrumentCommissionRate(None if pMMInstrumentCommissionRate is NULL else py_ApiStructure.MMInstrumentCommissionRateField.from_address(<size_t> pMMInstrumentCommissionRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3068, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3068, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3068, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3068, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3068, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3068, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3068, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3068, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3068, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3070
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryMMInstrumentCommissionRate', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3070, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3070, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3067, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3067, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3067, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3067, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3066
 * 
 *   try:
 *     if pMMInstrumentCommissionRate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryMMInstrumentCommissionRate(None if pMMInstrumentCommissionRate is NULL else py_ApiStructure.MMInstrumentCommissionRateField.from_address(<size_t> pMMInstrumentCommissionRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3065
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pMMInstrumentCommissionRate != NULL:
 *       self.OnRspQryMMInstrumentCommissionRate(None if pMMInstrumentCommissionRate is NULL else py_ApiStructure.MMInstrumentCommissionRateField.from_address(<size_t> pMMInstrumentCommissionRate)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3071
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryMMInstrumentCommissionRate', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryMMInstrumentCommissionRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3071, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3072
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryMMInstrumentCommissionRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3072, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3072, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3072, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3072, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3072, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__145, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3072, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3071
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryMMInstrumentCommissionRate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3065
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pMMInstrumentCommissionRate != NULL:
 *       self.OnRspQryMMInstrumentCommissionRate(None if pMMInstrumentCommissionRate is NULL else py_ApiStructure.MMInstrumentCommissionRateField.from_address(<size_t> pMMInstrumentCommissionRate)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3074
 *       myEnv.logger.error('OnRspQryMMInstrumentCommissionRate', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3059
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryMMInstrumentCommissionRate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcMMInstrumentCommissionRateField *pMMInstrumentCommissionRate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryMMInstrumentCommissionRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3080
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryMMOptionInstrCommRate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcMMOptionInstrCommRateField *pMMOptionInstrCommRate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryMMOptionInstrCommRate(PyObject *__pyx_v_self, struct CThostFtdcMMOptionInstrCommRateField *__pyx_v_pMMOptionInstrCommRate, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryMMOptionInstrCommRate", 0);

  /* "ptp/TraderApi.pyx":3086
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pMMOptionInstrCommRate != NULL:
 *       self.OnRspQryMMOptionInstrCommRate(None if pMMOptionInstrCommRate is NULL else py_ApiStructure.MMOptionInstrCommRateField.from_address(<size_t> pMMOptionInstrCommRate)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3087
 * 
 *   try:
 *     if pMMOptionInstrCommRate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryMMOptionInstrCommRate(None if pMMOptionInstrCommRate is NULL else py_ApiStructure.MMOptionInstrCommRateField.from_address(<size_t> pMMOptionInstrCommRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pMMOptionInstrCommRate != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3088
 *   try:
 *     if pMMOptionInstrCommRate != NULL:
 *       self.OnRspQryMMOptionInstrCommRate(None if pMMOptionInstrCommRate is NULL else py_ApiStructure.MMOptionInstrCommRateField.from_address(<size_t> pMMOptionInstrCommRate)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryMMOptionInstrCommRate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3088, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pMMOptionInstrCommRate == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3088, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_MMOptionInstrCommRateField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3088, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3088, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pMMOptionInstrCommRate)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3088, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3088, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3088, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3088, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3088, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3088, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3089
 *     if pMMOptionInstrCommRate != NULL:
 *       self.OnRspQryMMOptionInstrCommRate(None if pMMOptionInstrCommRate is NULL else py_ApiStructure.MMOptionInstrCommRateField.from_address(<size_t> pMMOptionInstrCommRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3089, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3089, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3089, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3089, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3089, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3089, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3089, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3089, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3089, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3091
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryMMOptionInstrCommRate', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3091, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3091, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3088, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3088, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3088, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3088, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3087
 * 
 *   try:
 *     if pMMOptionInstrCommRate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryMMOptionInstrCommRate(None if pMMOptionInstrCommRate is NULL else py_ApiStructure.MMOptionInstrCommRateField.from_address(<size_t> pMMOptionInstrCommRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3086
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pMMOptionInstrCommRate != NULL:
 *       self.OnRspQryMMOptionInstrCommRate(None if pMMOptionInstrCommRate is NULL else py_ApiStructure.MMOptionInstrCommRateField.from_address(<size_t> pMMOptionInstrCommRate)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3092
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryMMOptionInstrCommRate', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryMMOptionInstrCommRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3092, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3093
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryMMOptionInstrCommRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3093, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3093, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3093, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3093, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3093, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__146, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3093, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3092
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryMMOptionInstrCommRate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3086
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pMMOptionInstrCommRate != NULL:
 *       self.OnRspQryMMOptionInstrCommRate(None if pMMOptionInstrCommRate is NULL else py_ApiStructure.MMOptionInstrCommRateField.from_address(<size_t> pMMOptionInstrCommRate)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3095
 *       myEnv.logger.error('OnRspQryMMOptionInstrCommRate', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3080
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryMMOptionInstrCommRate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcMMOptionInstrCommRateField *pMMOptionInstrCommRate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryMMOptionInstrCommRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3101
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryInstrumentOrderCommRate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInstrumentOrderCommRateField *pInstrumentOrderCommRate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryInstrumentOrderCommRate(PyObject *__pyx_v_self, struct CThostFtdcInstrumentOrderCommRateField *__pyx_v_pInstrumentOrderCommRate, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryInstrumentOrderCommRate", 0);

  /* "ptp/TraderApi.pyx":3107
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInstrumentOrderCommRate != NULL:
 *       self.OnRspQryInstrumentOrderCommRate(None if pInstrumentOrderCommRate is NULL else py_ApiStructure.InstrumentOrderCommRateField.from_address(<size_t> pInstrumentOrderCommRate)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3108
 * 
 *   try:
 *     if pInstrumentOrderCommRate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryInstrumentOrderCommRate(None if pInstrumentOrderCommRate is NULL else py_ApiStructure.InstrumentOrderCommRateField.from_address(<size_t> pInstrumentOrderCommRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pInstrumentOrderCommRate != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3109
 *   try:
 *     if pInstrumentOrderCommRate != NULL:
 *       self.OnRspQryInstrumentOrderCommRate(None if pInstrumentOrderCommRate is NULL else py_ApiStructure.InstrumentOrderCommRateField.from_address(<size_t> pInstrumentOrderCommRate)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryInstrumentOrderCommRate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3109, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInstrumentOrderCommRate == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3109, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InstrumentOrderCommRateField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3109, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3109, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInstrumentOrderCommRate)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3109, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3109, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3109, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3109, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3109, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3109, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3110
 *     if pInstrumentOrderCommRate != NULL:
 *       self.OnRspQryInstrumentOrderCommRate(None if pInstrumentOrderCommRate is NULL else py_ApiStructure.InstrumentOrderCommRateField.from_address(<size_t> pInstrumentOrderCommRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3110, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3110, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3110, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3110, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3110, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3110, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3110, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3110, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3110, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3112
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInstrumentOrderCommRate', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3112, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3112, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3109, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3109, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3109, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3109, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3108
 * 
 *   try:
 *     if pInstrumentOrderCommRate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryInstrumentOrderCommRate(None if pInstrumentOrderCommRate is NULL else py_ApiStructure.InstrumentOrderCommRateField.from_address(<size_t> pInstrumentOrderCommRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3107
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInstrumentOrderCommRate != NULL:
 *       self.OnRspQryInstrumentOrderCommRate(None if pInstrumentOrderCommRate is NULL else py_ApiStructure.InstrumentOrderCommRateField.from_address(<size_t> pInstrumentOrderCommRate)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3113
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryInstrumentOrderCommRate', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryInstrumentOrderCommRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3113, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3114
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInstrumentOrderCommRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3114, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3114, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3114, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3114, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3114, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__147, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3114, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3113
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryInstrumentOrderCommRate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3107
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInstrumentOrderCommRate != NULL:
 *       self.OnRspQryInstrumentOrderCommRate(None if pInstrumentOrderCommRate is NULL else py_ApiStructure.InstrumentOrderCommRateField.from_address(<size_t> pInstrumentOrderCommRate)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3116
 *       myEnv.logger.error('OnRspQryInstrumentOrderCommRate', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3101
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryInstrumentOrderCommRate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInstrumentOrderCommRateField *pInstrumentOrderCommRate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryInstrumentOrderCommRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3122
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQrySecAgentTradingAccount(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcTradingAccountField *pTradingAccount
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQrySecAgentTradingAccount(PyObject *__pyx_v_self, struct CThostFtdcTradingAccountField *__pyx_v_pTradingAccount, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQrySecAgentTradingAccount", 0);

  /* "ptp/TraderApi.pyx":3128
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTradingAccount != NULL:
 *       self.OnRspQrySecAgentTradingAccount(None if pTradingAccount is NULL else py_ApiStructure.TradingAccountField.from_address(<size_t> pTradingAccount)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3129
 * 
 *   try:
 *     if pTradingAccount != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQrySecAgentTradingAccount(None if pTradingAccount is NULL else py_ApiStructure.TradingAccountField.from_address(<size_t> pTradingAccount)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pTradingAccount != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3130
 *   try:
 *     if pTradingAccount != NULL:
 *       self.OnRspQrySecAgentTradingAccount(None if pTradingAccount is NULL else py_ApiStructure.TradingAccountField.from_address(<size_t> pTradingAccount)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQrySecAgentTradingAccount); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3130, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pTradingAccount == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3130, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_TradingAccountField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3130, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3130, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pTradingAccount)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3130, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3130, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3130, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3130, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3130, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3130, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3131
 *     if pTradingAccount != NULL:
 *       self.OnRspQrySecAgentTradingAccount(None if pTradingAccount is NULL else py_ApiStructure.TradingAccountField.from_address(<size_t> pTradingAccount)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3131, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3131, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3131, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3131, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3131, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3131, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3131, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3131, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3131, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3133
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQrySecAgentTradingAccount', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3133, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3133, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3130, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3130, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3130, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3130, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3129
 * 
 *   try:
 *     if pTradingAccount != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQrySecAgentTradingAccount(None if pTradingAccount is NULL else py_ApiStructure.TradingAccountField.from_address(<size_t> pTradingAccount)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3128
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTradingAccount != NULL:
 *       self.OnRspQrySecAgentTradingAccount(None if pTradingAccount is NULL else py_ApiStructure.TradingAccountField.from_address(<size_t> pTradingAccount)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3134
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQrySecAgentTradingAccount', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQrySecAgentTradingAccount", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3134, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3135
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQrySecAgentTradingAccount', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3135, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3135, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3135, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3135, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3135, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__148, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3135, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3134
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQrySecAgentTradingAccount', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3128
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTradingAccount != NULL:
 *       self.OnRspQrySecAgentTradingAccount(None if pTradingAccount is NULL else py_ApiStructure.TradingAccountField.from_address(<size_t> pTradingAccount)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3137
 *       myEnv.logger.error('OnRspQrySecAgentTradingAccount', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3122
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQrySecAgentTradingAccount(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcTradingAccountField *pTradingAccount
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQrySecAgentTradingAccount", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3143
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQrySecAgentCheckMode(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcSecAgentCheckModeField *pSecAgentCheckMode
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQrySecAgentCheckMode(PyObject *__pyx_v_self, struct CThostFtdcSecAgentCheckModeField *__pyx_v_pSecAgentCheckMode, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQrySecAgentCheckMode", 0);

  /* "ptp/TraderApi.pyx":3149
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pSecAgentCheckMode != NULL:
 *       self.OnRspQrySecAgentCheckMode(None if pSecAgentCheckMode is NULL else py_ApiStructure.SecAgentCheckModeField.from_address(<size_t> pSecAgentCheckMode)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3150
 * 
 *   try:
 *     if pSecAgentCheckMode != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQrySecAgentCheckMode(None if pSecAgentCheckMode is NULL else py_ApiStructure.SecAgentCheckModeField.from_address(<size_t> pSecAgentCheckMode)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pSecAgentCheckMode != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3151
 *   try:
 *     if pSecAgentCheckMode != NULL:
 *       self.OnRspQrySecAgentCheckMode(None if pSecAgentCheckMode is NULL else py_ApiStructure.SecAgentCheckModeField.from_address(<size_t> pSecAgentCheckMode)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQrySecAgentCheckMode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3151, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pSecAgentCheckMode == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3151, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_SecAgentCheckModeField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3151, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3151, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pSecAgentCheckMode)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3151, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3151, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3151, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3151, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3151, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3151, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3152
 *     if pSecAgentCheckMode != NULL:
 *       self.OnRspQrySecAgentCheckMode(None if pSecAgentCheckMode is NULL else py_ApiStructure.SecAgentCheckModeField.from_address(<size_t> pSecAgentCheckMode)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3152, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3152, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3152, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3152, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3152, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3152, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3152, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3152, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3152, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3154
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQrySecAgentCheckMode', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3154, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3154, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3151, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3151, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3151, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3151, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3150
 * 
 *   try:
 *     if pSecAgentCheckMode != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQrySecAgentCheckMode(None if pSecAgentCheckMode is NULL else py_ApiStructure.SecAgentCheckModeField.from_address(<size_t> pSecAgentCheckMode)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3149
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pSecAgentCheckMode != NULL:
 *       self.OnRspQrySecAgentCheckMode(None if pSecAgentCheckMode is NULL else py_ApiStructure.SecAgentCheckModeField.from_address(<size_t> pSecAgentCheckMode)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3155
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQrySecAgentCheckMode', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQrySecAgentCheckMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3155, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3156
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQrySecAgentCheckMode', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3156, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3156, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3156, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3156, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3156, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__149, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3156, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3155
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQrySecAgentCheckMode', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3149
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pSecAgentCheckMode != NULL:
 *       self.OnRspQrySecAgentCheckMode(None if pSecAgentCheckMode is NULL else py_ApiStructure.SecAgentCheckModeField.from_address(<size_t> pSecAgentCheckMode)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3158
 *       myEnv.logger.error('OnRspQrySecAgentCheckMode', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3143
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQrySecAgentCheckMode(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcSecAgentCheckModeField *pSecAgentCheckMode
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQrySecAgentCheckMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3164
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryOptionInstrTradeCost(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcOptionInstrTradeCostField *pOptionInstrTradeCost
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryOptionInstrTradeCost(PyObject *__pyx_v_self, struct CThostFtdcOptionInstrTradeCostField *__pyx_v_pOptionInstrTradeCost, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryOptionInstrTradeCost", 0);

  /* "ptp/TraderApi.pyx":3170
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOptionInstrTradeCost != NULL:
 *       self.OnRspQryOptionInstrTradeCost(None if pOptionInstrTradeCost is NULL else py_ApiStructure.OptionInstrTradeCostField.from_address(<size_t> pOptionInstrTradeCost)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3171
 * 
 *   try:
 *     if pOptionInstrTradeCost != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryOptionInstrTradeCost(None if pOptionInstrTradeCost is NULL else py_ApiStructure.OptionInstrTradeCostField.from_address(<size_t> pOptionInstrTradeCost)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pOptionInstrTradeCost != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3172
 *   try:
 *     if pOptionInstrTradeCost != NULL:
 *       self.OnRspQryOptionInstrTradeCost(None if pOptionInstrTradeCost is NULL else py_ApiStructure.OptionInstrTradeCostField.from_address(<size_t> pOptionInstrTradeCost)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryOptionInstrTradeCost); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3172, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pOptionInstrTradeCost == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3172, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_OptionInstrTradeCostField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3172, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3172, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pOptionInstrTradeCost)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3172, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3172, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3172, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3172, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3172, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3172, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3173
 *     if pOptionInstrTradeCost != NULL:
 *       self.OnRspQryOptionInstrTradeCost(None if pOptionInstrTradeCost is NULL else py_ApiStructure.OptionInstrTradeCostField.from_address(<size_t> pOptionInstrTradeCost)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3173, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3173, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3173, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3173, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3173, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3173, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3173, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3173, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3173, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3175
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryOptionInstrTradeCost', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3175, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3175, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3172, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3172, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3172, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3172, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3171
 * 
 *   try:
 *     if pOptionInstrTradeCost != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryOptionInstrTradeCost(None if pOptionInstrTradeCost is NULL else py_ApiStructure.OptionInstrTradeCostField.from_address(<size_t> pOptionInstrTradeCost)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3170
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOptionInstrTradeCost != NULL:
 *       self.OnRspQryOptionInstrTradeCost(None if pOptionInstrTradeCost is NULL else py_ApiStructure.OptionInstrTradeCostField.from_address(<size_t> pOptionInstrTradeCost)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3176
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryOptionInstrTradeCost', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryOptionInstrTradeCost", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3176, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3177
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryOptionInstrTradeCost', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3177, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3177, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3177, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3177, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3177, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__150, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3177, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3176
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryOptionInstrTradeCost', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3170
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOptionInstrTradeCost != NULL:
 *       self.OnRspQryOptionInstrTradeCost(None if pOptionInstrTradeCost is NULL else py_ApiStructure.OptionInstrTradeCostField.from_address(<size_t> pOptionInstrTradeCost)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3179
 *       myEnv.logger.error('OnRspQryOptionInstrTradeCost', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3164
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryOptionInstrTradeCost(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcOptionInstrTradeCostField *pOptionInstrTradeCost
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryOptionInstrTradeCost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3185
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryOptionInstrCommRate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcOptionInstrCommRateField *pOptionInstrCommRate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryOptionInstrCommRate(PyObject *__pyx_v_self, struct CThostFtdcOptionInstrCommRateField *__pyx_v_pOptionInstrCommRate, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryOptionInstrCommRate", 0);

  /* "ptp/TraderApi.pyx":3191
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOptionInstrCommRate != NULL:
 *       self.OnRspQryOptionInstrCommRate(None if pOptionInstrCommRate is NULL else py_ApiStructure.OptionInstrCommRateField.from_address(<size_t> pOptionInstrCommRate)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3192
 * 
 *   try:
 *     if pOptionInstrCommRate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryOptionInstrCommRate(None if pOptionInstrCommRate is NULL else py_ApiStructure.OptionInstrCommRateField.from_address(<size_t> pOptionInstrCommRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pOptionInstrCommRate != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3193
 *   try:
 *     if pOptionInstrCommRate != NULL:
 *       self.OnRspQryOptionInstrCommRate(None if pOptionInstrCommRate is NULL else py_ApiStructure.OptionInstrCommRateField.from_address(<size_t> pOptionInstrCommRate)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryOptionInstrCommRate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3193, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pOptionInstrCommRate == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3193, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_OptionInstrCommRateField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3193, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3193, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pOptionInstrCommRate)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3193, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3193, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3193, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3193, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3193, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3193, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3194
 *     if pOptionInstrCommRate != NULL:
 *       self.OnRspQryOptionInstrCommRate(None if pOptionInstrCommRate is NULL else py_ApiStructure.OptionInstrCommRateField.from_address(<size_t> pOptionInstrCommRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3194, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3194, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3194, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3194, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3194, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3194, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3194, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3194, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3194, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3196
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryOptionInstrCommRate', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3196, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3196, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3193, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3193, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3193, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3193, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3192
 * 
 *   try:
 *     if pOptionInstrCommRate != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryOptionInstrCommRate(None if pOptionInstrCommRate is NULL else py_ApiStructure.OptionInstrCommRateField.from_address(<size_t> pOptionInstrCommRate)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3191
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOptionInstrCommRate != NULL:
 *       self.OnRspQryOptionInstrCommRate(None if pOptionInstrCommRate is NULL else py_ApiStructure.OptionInstrCommRateField.from_address(<size_t> pOptionInstrCommRate)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3197
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryOptionInstrCommRate', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryOptionInstrCommRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3197, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3198
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryOptionInstrCommRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3198, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3198, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3198, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3198, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3198, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__151, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3198, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3197
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryOptionInstrCommRate', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3191
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOptionInstrCommRate != NULL:
 *       self.OnRspQryOptionInstrCommRate(None if pOptionInstrCommRate is NULL else py_ApiStructure.OptionInstrCommRateField.from_address(<size_t> pOptionInstrCommRate)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3200
 *       myEnv.logger.error('OnRspQryOptionInstrCommRate', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3185
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryOptionInstrCommRate(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcOptionInstrCommRateField *pOptionInstrCommRate
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryOptionInstrCommRate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3206
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryExecOrder(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcExecOrderField *pExecOrder
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryExecOrder(PyObject *__pyx_v_self, struct CThostFtdcExecOrderField *__pyx_v_pExecOrder, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryExecOrder", 0);

  /* "ptp/TraderApi.pyx":3212
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pExecOrder != NULL:
 *       self.OnRspQryExecOrder(None if pExecOrder is NULL else py_ApiStructure.ExecOrderField.from_address(<size_t> pExecOrder)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3213
 * 
 *   try:
 *     if pExecOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryExecOrder(None if pExecOrder is NULL else py_ApiStructure.ExecOrderField.from_address(<size_t> pExecOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pExecOrder != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3214
 *   try:
 *     if pExecOrder != NULL:
 *       self.OnRspQryExecOrder(None if pExecOrder is NULL else py_ApiStructure.ExecOrderField.from_address(<size_t> pExecOrder)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryExecOrder); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3214, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pExecOrder == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3214, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ExecOrderField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3214, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3214, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pExecOrder)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3214, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3214, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3214, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3214, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3214, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3214, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3215
 *     if pExecOrder != NULL:
 *       self.OnRspQryExecOrder(None if pExecOrder is NULL else py_ApiStructure.ExecOrderField.from_address(<size_t> pExecOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3215, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3215, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3215, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3215, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3215, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3215, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3215, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3215, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3215, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3217
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryExecOrder', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3217, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3217, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3214, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3214, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3214, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3214, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3213
 * 
 *   try:
 *     if pExecOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryExecOrder(None if pExecOrder is NULL else py_ApiStructure.ExecOrderField.from_address(<size_t> pExecOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3212
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pExecOrder != NULL:
 *       self.OnRspQryExecOrder(None if pExecOrder is NULL else py_ApiStructure.ExecOrderField.from_address(<size_t> pExecOrder)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3218
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryExecOrder', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryExecOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3218, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3219
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryExecOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3219, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3219, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3219, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3219, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3219, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__152, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3219, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3218
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryExecOrder', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3212
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pExecOrder != NULL:
 *       self.OnRspQryExecOrder(None if pExecOrder is NULL else py_ApiStructure.ExecOrderField.from_address(<size_t> pExecOrder)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3221
 *       myEnv.logger.error('OnRspQryExecOrder', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3206
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryExecOrder(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcExecOrderField *pExecOrder
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryExecOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3227
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryForQuote(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcForQuoteField *pForQuote
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryForQuote(PyObject *__pyx_v_self, struct CThostFtdcForQuoteField *__pyx_v_pForQuote, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryForQuote", 0);

  /* "ptp/TraderApi.pyx":3233
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pForQuote != NULL:
 *       self.OnRspQryForQuote(None if pForQuote is NULL else py_ApiStructure.ForQuoteField.from_address(<size_t> pForQuote)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3234
 * 
 *   try:
 *     if pForQuote != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryForQuote(None if pForQuote is NULL else py_ApiStructure.ForQuoteField.from_address(<size_t> pForQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pForQuote != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3235
 *   try:
 *     if pForQuote != NULL:
 *       self.OnRspQryForQuote(None if pForQuote is NULL else py_ApiStructure.ForQuoteField.from_address(<size_t> pForQuote)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryForQuote); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3235, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pForQuote == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3235, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ForQuoteField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3235, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3235, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pForQuote)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3235, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3235, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3235, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3235, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3235, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3235, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3236
 *     if pForQuote != NULL:
 *       self.OnRspQryForQuote(None if pForQuote is NULL else py_ApiStructure.ForQuoteField.from_address(<size_t> pForQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3236, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3236, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3236, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3236, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3236, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3236, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3236, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3236, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3236, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3238
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryForQuote', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3238, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3238, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3235, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3235, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3235, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3235, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3234
 * 
 *   try:
 *     if pForQuote != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryForQuote(None if pForQuote is NULL else py_ApiStructure.ForQuoteField.from_address(<size_t> pForQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3233
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pForQuote != NULL:
 *       self.OnRspQryForQuote(None if pForQuote is NULL else py_ApiStructure.ForQuoteField.from_address(<size_t> pForQuote)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3239
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryForQuote', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryForQuote", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3239, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3240
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryForQuote', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3240, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3240, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3240, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3240, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3240, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__153, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3240, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3239
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryForQuote', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3233
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pForQuote != NULL:
 *       self.OnRspQryForQuote(None if pForQuote is NULL else py_ApiStructure.ForQuoteField.from_address(<size_t> pForQuote)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3242
 *       myEnv.logger.error('OnRspQryForQuote', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3227
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryForQuote(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcForQuoteField *pForQuote
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryForQuote", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3248
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryQuote(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcQuoteField *pQuote
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryQuote(PyObject *__pyx_v_self, struct CThostFtdcQuoteField *__pyx_v_pQuote, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryQuote", 0);

  /* "ptp/TraderApi.pyx":3254
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pQuote != NULL:
 *       self.OnRspQryQuote(None if pQuote is NULL else py_ApiStructure.QuoteField.from_address(<size_t> pQuote)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3255
 * 
 *   try:
 *     if pQuote != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryQuote(None if pQuote is NULL else py_ApiStructure.QuoteField.from_address(<size_t> pQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pQuote != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3256
 *   try:
 *     if pQuote != NULL:
 *       self.OnRspQryQuote(None if pQuote is NULL else py_ApiStructure.QuoteField.from_address(<size_t> pQuote)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryQuote); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3256, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pQuote == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3256, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_QuoteField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3256, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3256, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pQuote)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3256, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3256, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3256, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3256, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3256, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3256, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3257
 *     if pQuote != NULL:
 *       self.OnRspQryQuote(None if pQuote is NULL else py_ApiStructure.QuoteField.from_address(<size_t> pQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3257, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3257, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3257, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3257, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3257, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3257, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3257, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3257, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3257, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3259
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryQuote', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3259, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3259, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3256, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3256, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3256, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3256, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3255
 * 
 *   try:
 *     if pQuote != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryQuote(None if pQuote is NULL else py_ApiStructure.QuoteField.from_address(<size_t> pQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3254
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pQuote != NULL:
 *       self.OnRspQryQuote(None if pQuote is NULL else py_ApiStructure.QuoteField.from_address(<size_t> pQuote)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3260
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryQuote', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryQuote", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3260, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3261
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryQuote', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3261, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3261, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3261, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3261, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3261, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__154, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3261, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3260
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryQuote', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3254
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pQuote != NULL:
 *       self.OnRspQryQuote(None if pQuote is NULL else py_ApiStructure.QuoteField.from_address(<size_t> pQuote)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3263
 *       myEnv.logger.error('OnRspQryQuote', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3248
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryQuote(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcQuoteField *pQuote
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryQuote", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3269
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryOptionSelfClose(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcOptionSelfCloseField *pOptionSelfClose
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryOptionSelfClose(PyObject *__pyx_v_self, struct CThostFtdcOptionSelfCloseField *__pyx_v_pOptionSelfClose, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryOptionSelfClose", 0);

  /* "ptp/TraderApi.pyx":3275
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOptionSelfClose != NULL:
 *       self.OnRspQryOptionSelfClose(None if pOptionSelfClose is NULL else py_ApiStructure.OptionSelfCloseField.from_address(<size_t> pOptionSelfClose)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3276
 * 
 *   try:
 *     if pOptionSelfClose != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryOptionSelfClose(None if pOptionSelfClose is NULL else py_ApiStructure.OptionSelfCloseField.from_address(<size_t> pOptionSelfClose)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pOptionSelfClose != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3277
 *   try:
 *     if pOptionSelfClose != NULL:
 *       self.OnRspQryOptionSelfClose(None if pOptionSelfClose is NULL else py_ApiStructure.OptionSelfCloseField.from_address(<size_t> pOptionSelfClose)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryOptionSelfClose); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3277, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pOptionSelfClose == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3277, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_OptionSelfCloseField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3277, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3277, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pOptionSelfClose)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3277, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3277, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3277, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3277, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3277, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3277, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3278
 *     if pOptionSelfClose != NULL:
 *       self.OnRspQryOptionSelfClose(None if pOptionSelfClose is NULL else py_ApiStructure.OptionSelfCloseField.from_address(<size_t> pOptionSelfClose)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3278, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3278, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3278, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3278, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3278, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3278, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3278, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3278, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3278, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3280
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryOptionSelfClose', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3280, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3280, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3277, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3277, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3277, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3277, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3276
 * 
 *   try:
 *     if pOptionSelfClose != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryOptionSelfClose(None if pOptionSelfClose is NULL else py_ApiStructure.OptionSelfCloseField.from_address(<size_t> pOptionSelfClose)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3275
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOptionSelfClose != NULL:
 *       self.OnRspQryOptionSelfClose(None if pOptionSelfClose is NULL else py_ApiStructure.OptionSelfCloseField.from_address(<size_t> pOptionSelfClose)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3281
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryOptionSelfClose', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryOptionSelfClose", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3281, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3282
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryOptionSelfClose', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3282, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3282, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3282, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3282, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3282, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__155, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3282, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3281
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryOptionSelfClose', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3275
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOptionSelfClose != NULL:
 *       self.OnRspQryOptionSelfClose(None if pOptionSelfClose is NULL else py_ApiStructure.OptionSelfCloseField.from_address(<size_t> pOptionSelfClose)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3284
 *       myEnv.logger.error('OnRspQryOptionSelfClose', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3269
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryOptionSelfClose(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcOptionSelfCloseField *pOptionSelfClose
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryOptionSelfClose", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3290
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryInvestUnit(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInvestUnitField *pInvestUnit
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryInvestUnit(PyObject *__pyx_v_self, struct CThostFtdcInvestUnitField *__pyx_v_pInvestUnit, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryInvestUnit", 0);

  /* "ptp/TraderApi.pyx":3296
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInvestUnit != NULL:
 *       self.OnRspQryInvestUnit(None if pInvestUnit is NULL else py_ApiStructure.InvestUnitField.from_address(<size_t> pInvestUnit)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3297
 * 
 *   try:
 *     if pInvestUnit != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryInvestUnit(None if pInvestUnit is NULL else py_ApiStructure.InvestUnitField.from_address(<size_t> pInvestUnit)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pInvestUnit != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3298
 *   try:
 *     if pInvestUnit != NULL:
 *       self.OnRspQryInvestUnit(None if pInvestUnit is NULL else py_ApiStructure.InvestUnitField.from_address(<size_t> pInvestUnit)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryInvestUnit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3298, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInvestUnit == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3298, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InvestUnitField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3298, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3298, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInvestUnit)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3298, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3298, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3298, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3298, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3298, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3298, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3299
 *     if pInvestUnit != NULL:
 *       self.OnRspQryInvestUnit(None if pInvestUnit is NULL else py_ApiStructure.InvestUnitField.from_address(<size_t> pInvestUnit)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3299, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3299, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3299, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3299, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3299, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3299, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3299, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3299, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3299, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3301
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInvestUnit', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3301, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3301, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3298, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3298, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3298, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3298, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3297
 * 
 *   try:
 *     if pInvestUnit != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryInvestUnit(None if pInvestUnit is NULL else py_ApiStructure.InvestUnitField.from_address(<size_t> pInvestUnit)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3296
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInvestUnit != NULL:
 *       self.OnRspQryInvestUnit(None if pInvestUnit is NULL else py_ApiStructure.InvestUnitField.from_address(<size_t> pInvestUnit)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3302
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryInvestUnit', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryInvestUnit", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3302, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3303
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInvestUnit', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3303, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3303, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3303, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3303, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3303, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__156, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3303, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3302
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryInvestUnit', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3296
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInvestUnit != NULL:
 *       self.OnRspQryInvestUnit(None if pInvestUnit is NULL else py_ApiStructure.InvestUnitField.from_address(<size_t> pInvestUnit)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3305
 *       myEnv.logger.error('OnRspQryInvestUnit', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3290
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryInvestUnit(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInvestUnitField *pInvestUnit
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryInvestUnit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3311
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryCombInstrumentGuard(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcCombInstrumentGuardField *pCombInstrumentGuard
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryCombInstrumentGuard(PyObject *__pyx_v_self, struct CThostFtdcCombInstrumentGuardField *__pyx_v_pCombInstrumentGuard, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryCombInstrumentGuard", 0);

  /* "ptp/TraderApi.pyx":3317
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pCombInstrumentGuard != NULL:
 *       self.OnRspQryCombInstrumentGuard(None if pCombInstrumentGuard is NULL else py_ApiStructure.CombInstrumentGuardField.from_address(<size_t> pCombInstrumentGuard)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3318
 * 
 *   try:
 *     if pCombInstrumentGuard != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryCombInstrumentGuard(None if pCombInstrumentGuard is NULL else py_ApiStructure.CombInstrumentGuardField.from_address(<size_t> pCombInstrumentGuard)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pCombInstrumentGuard != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3319
 *   try:
 *     if pCombInstrumentGuard != NULL:
 *       self.OnRspQryCombInstrumentGuard(None if pCombInstrumentGuard is NULL else py_ApiStructure.CombInstrumentGuardField.from_address(<size_t> pCombInstrumentGuard)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryCombInstrumentGuard); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3319, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pCombInstrumentGuard == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3319, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_CombInstrumentGuardField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3319, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3319, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pCombInstrumentGuard)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3319, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3319, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3319, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3319, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3319, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3319, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3320
 *     if pCombInstrumentGuard != NULL:
 *       self.OnRspQryCombInstrumentGuard(None if pCombInstrumentGuard is NULL else py_ApiStructure.CombInstrumentGuardField.from_address(<size_t> pCombInstrumentGuard)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3320, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3320, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3320, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3320, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3320, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3320, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3320, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3320, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3320, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3322
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryCombInstrumentGuard', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3322, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3322, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3319, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3319, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3319, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3319, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3318
 * 
 *   try:
 *     if pCombInstrumentGuard != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryCombInstrumentGuard(None if pCombInstrumentGuard is NULL else py_ApiStructure.CombInstrumentGuardField.from_address(<size_t> pCombInstrumentGuard)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3317
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pCombInstrumentGuard != NULL:
 *       self.OnRspQryCombInstrumentGuard(None if pCombInstrumentGuard is NULL else py_ApiStructure.CombInstrumentGuardField.from_address(<size_t> pCombInstrumentGuard)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3323
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryCombInstrumentGuard', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryCombInstrumentGuard", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3323, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3324
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryCombInstrumentGuard', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3324, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3324, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3324, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3324, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3324, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__157, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3324, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3323
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryCombInstrumentGuard', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3317
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pCombInstrumentGuard != NULL:
 *       self.OnRspQryCombInstrumentGuard(None if pCombInstrumentGuard is NULL else py_ApiStructure.CombInstrumentGuardField.from_address(<size_t> pCombInstrumentGuard)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3326
 *       myEnv.logger.error('OnRspQryCombInstrumentGuard', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3311
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryCombInstrumentGuard(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcCombInstrumentGuardField *pCombInstrumentGuard
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryCombInstrumentGuard", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3332
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryCombAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcCombActionField *pCombAction
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryCombAction(PyObject *__pyx_v_self, struct CThostFtdcCombActionField *__pyx_v_pCombAction, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryCombAction", 0);

  /* "ptp/TraderApi.pyx":3338
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pCombAction != NULL:
 *       self.OnRspQryCombAction(None if pCombAction is NULL else py_ApiStructure.CombActionField.from_address(<size_t> pCombAction)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3339
 * 
 *   try:
 *     if pCombAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryCombAction(None if pCombAction is NULL else py_ApiStructure.CombActionField.from_address(<size_t> pCombAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pCombAction != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3340
 *   try:
 *     if pCombAction != NULL:
 *       self.OnRspQryCombAction(None if pCombAction is NULL else py_ApiStructure.CombActionField.from_address(<size_t> pCombAction)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryCombAction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3340, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pCombAction == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3340, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_CombActionField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3340, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3340, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pCombAction)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3340, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3340, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3340, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3340, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3340, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3340, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3341
 *     if pCombAction != NULL:
 *       self.OnRspQryCombAction(None if pCombAction is NULL else py_ApiStructure.CombActionField.from_address(<size_t> pCombAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3341, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3341, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3341, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3341, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3341, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3341, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3341, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3341, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3341, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3343
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryCombAction', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3343, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3343, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3340, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3340, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3340, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3340, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3339
 * 
 *   try:
 *     if pCombAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryCombAction(None if pCombAction is NULL else py_ApiStructure.CombActionField.from_address(<size_t> pCombAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3338
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pCombAction != NULL:
 *       self.OnRspQryCombAction(None if pCombAction is NULL else py_ApiStructure.CombActionField.from_address(<size_t> pCombAction)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3344
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryCombAction', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryCombAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3344, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3345
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryCombAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3345, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3345, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3345, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3345, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3345, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__158, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3345, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3344
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryCombAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3338
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pCombAction != NULL:
 *       self.OnRspQryCombAction(None if pCombAction is NULL else py_ApiStructure.CombActionField.from_address(<size_t> pCombAction)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3347
 *       myEnv.logger.error('OnRspQryCombAction', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3332
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryCombAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcCombActionField *pCombAction
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryCombAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3353
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryTransferSerial(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcTransferSerialField *pTransferSerial
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryTransferSerial(PyObject *__pyx_v_self, struct CThostFtdcTransferSerialField *__pyx_v_pTransferSerial, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryTransferSerial", 0);

  /* "ptp/TraderApi.pyx":3359
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTransferSerial != NULL:
 *       self.OnRspQryTransferSerial(None if pTransferSerial is NULL else py_ApiStructure.TransferSerialField.from_address(<size_t> pTransferSerial)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3360
 * 
 *   try:
 *     if pTransferSerial != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryTransferSerial(None if pTransferSerial is NULL else py_ApiStructure.TransferSerialField.from_address(<size_t> pTransferSerial)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pTransferSerial != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3361
 *   try:
 *     if pTransferSerial != NULL:
 *       self.OnRspQryTransferSerial(None if pTransferSerial is NULL else py_ApiStructure.TransferSerialField.from_address(<size_t> pTransferSerial)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryTransferSerial); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3361, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pTransferSerial == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3361, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_TransferSerialField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3361, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3361, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pTransferSerial)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3361, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3361, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3361, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3361, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3361, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3361, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3362
 *     if pTransferSerial != NULL:
 *       self.OnRspQryTransferSerial(None if pTransferSerial is NULL else py_ApiStructure.TransferSerialField.from_address(<size_t> pTransferSerial)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3362, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3362, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3362, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3362, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3362, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3362, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3362, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3362, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3362, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3364
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryTransferSerial', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3364, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3364, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3361, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3361, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3361, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3361, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3360
 * 
 *   try:
 *     if pTransferSerial != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryTransferSerial(None if pTransferSerial is NULL else py_ApiStructure.TransferSerialField.from_address(<size_t> pTransferSerial)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3359
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTransferSerial != NULL:
 *       self.OnRspQryTransferSerial(None if pTransferSerial is NULL else py_ApiStructure.TransferSerialField.from_address(<size_t> pTransferSerial)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3365
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryTransferSerial', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryTransferSerial", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3365, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3366
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryTransferSerial', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3366, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3366, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3366, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3366, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3366, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__159, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3366, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3365
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryTransferSerial', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3359
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTransferSerial != NULL:
 *       self.OnRspQryTransferSerial(None if pTransferSerial is NULL else py_ApiStructure.TransferSerialField.from_address(<size_t> pTransferSerial)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3368
 *       myEnv.logger.error('OnRspQryTransferSerial', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3353
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryTransferSerial(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcTransferSerialField *pTransferSerial
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryTransferSerial", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3374
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryAccountregister(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcAccountregisterField *pAccountregister
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryAccountregister(PyObject *__pyx_v_self, struct CThostFtdcAccountregisterField *__pyx_v_pAccountregister, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryAccountregister", 0);

  /* "ptp/TraderApi.pyx":3380
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pAccountregister != NULL:
 *       self.OnRspQryAccountregister(None if pAccountregister is NULL else py_ApiStructure.AccountregisterField.from_address(<size_t> pAccountregister)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3381
 * 
 *   try:
 *     if pAccountregister != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryAccountregister(None if pAccountregister is NULL else py_ApiStructure.AccountregisterField.from_address(<size_t> pAccountregister)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pAccountregister != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3382
 *   try:
 *     if pAccountregister != NULL:
 *       self.OnRspQryAccountregister(None if pAccountregister is NULL else py_ApiStructure.AccountregisterField.from_address(<size_t> pAccountregister)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryAccountregister); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3382, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pAccountregister == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3382, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_AccountregisterField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3382, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3382, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pAccountregister)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3382, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3382, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3382, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3382, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3382, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3382, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3383
 *     if pAccountregister != NULL:
 *       self.OnRspQryAccountregister(None if pAccountregister is NULL else py_ApiStructure.AccountregisterField.from_address(<size_t> pAccountregister)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3383, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3383, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3383, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3383, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3383, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3383, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3383, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3383, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3383, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3385
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryAccountregister', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3385, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3385, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3382, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3382, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3382, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3382, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3381
 * 
 *   try:
 *     if pAccountregister != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryAccountregister(None if pAccountregister is NULL else py_ApiStructure.AccountregisterField.from_address(<size_t> pAccountregister)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3380
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pAccountregister != NULL:
 *       self.OnRspQryAccountregister(None if pAccountregister is NULL else py_ApiStructure.AccountregisterField.from_address(<size_t> pAccountregister)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3386
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryAccountregister', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryAccountregister", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3386, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3387
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryAccountregister', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3387, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3387, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3387, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3387, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3387, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__160, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3387, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3386
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryAccountregister', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3380
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pAccountregister != NULL:
 *       self.OnRspQryAccountregister(None if pAccountregister is NULL else py_ApiStructure.AccountregisterField.from_address(<size_t> pAccountregister)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3389
 *       myEnv.logger.error('OnRspQryAccountregister', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3374
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryAccountregister(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcAccountregisterField *pAccountregister
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryAccountregister", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3395
 * 
 * """
 * cdef extern int   TraderSpi_OnRspError(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspInfoField *pRspInfo
 *     , int nRequestID
 */

int TraderSpi_OnRspError(PyObject *__pyx_v_self, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspError", 0);

  /* "ptp/TraderApi.pyx":3400
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspInfo != NULL:
 *       self.OnRspError(None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3401
 * 
 *   try:
 *     if pRspInfo != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspError(None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
      __pyx_t_4 = ((__pyx_v_pRspInfo != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3402
 *   try:
 *     if pRspInfo != NULL:
 *       self.OnRspError(None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3402, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3402, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3402, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3402, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3402, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3402, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3402, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3402, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3402, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3402, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3404
 *       self.OnRspError(None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspError', exc_info=True)
 */
        __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3404, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3404, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = NULL;
        __pyx_t_13 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_13 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_12, __pyx_t_7, __pyx_t_8, __pyx_t_9};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3402, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_12, __pyx_t_7, __pyx_t_8, __pyx_t_9};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3402, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3402, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_12) {
            __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12); __pyx_t_12 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_13, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_13, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_13, __pyx_t_9);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3402, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3401
 * 
 *   try:
 *     if pRspInfo != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspError(None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
      }

      /* "ptp/TraderApi.pyx":3400
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspInfo != NULL:
 *       self.OnRspError(None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3405
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspError', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspError", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3405, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3406
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspError', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3406, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3406, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3406, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3406, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3406, __pyx_L15_error)
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__161, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3406, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }

      /* "ptp/TraderApi.pyx":3405
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspError', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3400
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspInfo != NULL:
 *       self.OnRspError(None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3408
 *       myEnv.logger.error('OnRspError', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3395
 * 
 * """
 * cdef extern int   TraderSpi_OnRspError(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspInfoField *pRspInfo
 *     , int nRequestID
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3414
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnOrder(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcOrderField *pOrder) except -1:
 * 
 */

int TraderSpi_OnRtnOrder(PyObject *__pyx_v_self, struct CThostFtdcOrderField *__pyx_v_pOrder) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnOrder", 0);

  /* "ptp/TraderApi.pyx":3417
 *     , CThostFtdcOrderField *pOrder) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOrder != NULL:
 *       self.OnRtnOrder(None if pOrder is NULL else py_ApiStructure.OrderField.from_address(<size_t> pOrder))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3418
 * 
 *   try:
 *     if pOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnOrder(None if pOrder is NULL else py_ApiStructure.OrderField.from_address(<size_t> pOrder))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pOrder != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3419
 *   try:
 *     if pOrder != NULL:
 *       self.OnRtnOrder(None if pOrder is NULL else py_ApiStructure.OrderField.from_address(<size_t> pOrder))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnOrder', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnOrder); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3419, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pOrder == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3419, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_OrderField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3419, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3419, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pOrder)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3419, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3419, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3419, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3419, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3419, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3419, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3419, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3419, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3419, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3419, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3419, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3418
 * 
 *   try:
 *     if pOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnOrder(None if pOrder is NULL else py_ApiStructure.OrderField.from_address(<size_t> pOrder))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":3417
 *     , CThostFtdcOrderField *pOrder) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOrder != NULL:
 *       self.OnRtnOrder(None if pOrder is NULL else py_ApiStructure.OrderField.from_address(<size_t> pOrder))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3420
 *     if pOrder != NULL:
 *       self.OnRtnOrder(None if pOrder is NULL else py_ApiStructure.OrderField.from_address(<size_t> pOrder))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnOrder', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 3420, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3421
 *       self.OnRtnOrder(None if pOrder is NULL else py_ApiStructure.OrderField.from_address(<size_t> pOrder))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3421, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3421, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3421, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3421, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3421, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__162, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3421, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":3420
 *     if pOrder != NULL:
 *       self.OnRtnOrder(None if pOrder is NULL else py_ApiStructure.OrderField.from_address(<size_t> pOrder))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnOrder', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3417
 *     , CThostFtdcOrderField *pOrder) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOrder != NULL:
 *       self.OnRtnOrder(None if pOrder is NULL else py_ApiStructure.OrderField.from_address(<size_t> pOrder))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3423
 *       myEnv.logger.error('OnRtnOrder', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3414
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnOrder(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcOrderField *pOrder) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3429
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnTrade(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcTradeField *pTrade) except -1:
 * 
 */

int TraderSpi_OnRtnTrade(PyObject *__pyx_v_self, struct CThostFtdcTradeField *__pyx_v_pTrade) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnTrade", 0);

  /* "ptp/TraderApi.pyx":3432
 *     , CThostFtdcTradeField *pTrade) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTrade != NULL:
 *       self.OnRtnTrade(None if pTrade is NULL else py_ApiStructure.TradeField.from_address(<size_t> pTrade))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3433
 * 
 *   try:
 *     if pTrade != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnTrade(None if pTrade is NULL else py_ApiStructure.TradeField.from_address(<size_t> pTrade))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pTrade != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3434
 *   try:
 *     if pTrade != NULL:
 *       self.OnRtnTrade(None if pTrade is NULL else py_ApiStructure.TradeField.from_address(<size_t> pTrade))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnTrade', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnTrade); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3434, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pTrade == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3434, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_TradeField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3434, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3434, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pTrade)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3434, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3434, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3434, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3434, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3434, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3434, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3434, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3434, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3434, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3434, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3434, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3433
 * 
 *   try:
 *     if pTrade != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnTrade(None if pTrade is NULL else py_ApiStructure.TradeField.from_address(<size_t> pTrade))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":3432
 *     , CThostFtdcTradeField *pTrade) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTrade != NULL:
 *       self.OnRtnTrade(None if pTrade is NULL else py_ApiStructure.TradeField.from_address(<size_t> pTrade))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3435
 *     if pTrade != NULL:
 *       self.OnRtnTrade(None if pTrade is NULL else py_ApiStructure.TradeField.from_address(<size_t> pTrade))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnTrade', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnTrade", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 3435, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3436
 *       self.OnRtnTrade(None if pTrade is NULL else py_ApiStructure.TradeField.from_address(<size_t> pTrade))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnTrade', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3436, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3436, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3436, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3436, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3436, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__163, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3436, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":3435
 *     if pTrade != NULL:
 *       self.OnRtnTrade(None if pTrade is NULL else py_ApiStructure.TradeField.from_address(<size_t> pTrade))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnTrade', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3432
 *     , CThostFtdcTradeField *pTrade) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTrade != NULL:
 *       self.OnRtnTrade(None if pTrade is NULL else py_ApiStructure.TradeField.from_address(<size_t> pTrade))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3438
 *       myEnv.logger.error('OnRtnTrade', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3429
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnTrade(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcTradeField *pTrade) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnTrade", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3444
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnOrderInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputOrderField *pInputOrder
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

int TraderSpi_OnErrRtnOrderInsert(PyObject *__pyx_v_self, struct CThostFtdcInputOrderField *__pyx_v_pInputOrder, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnErrRtnOrderInsert", 0);

  /* "ptp/TraderApi.pyx":3448
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputOrder != NULL:
 *       self.OnErrRtnOrderInsert(None if pInputOrder is NULL else py_ApiStructure.InputOrderField.from_address(<size_t> pInputOrder)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3449
 * 
 *   try:
 *     if pInputOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnOrderInsert(None if pInputOrder is NULL else py_ApiStructure.InputOrderField.from_address(<size_t> pInputOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      __pyx_t_4 = ((__pyx_v_pInputOrder != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3450
 *   try:
 *     if pInputOrder != NULL:
 *       self.OnErrRtnOrderInsert(None if pInputOrder is NULL else py_ApiStructure.InputOrderField.from_address(<size_t> pInputOrder)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnErrRtnOrderInsert); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3450, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInputOrder == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3450, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InputOrderField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3450, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3450, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInputOrder)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3450, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3450, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3450, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3450, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3450, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3450, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3451
 *     if pInputOrder != NULL:
 *       self.OnErrRtnOrderInsert(None if pInputOrder is NULL else py_ApiStructure.InputOrderField.from_address(<size_t> pInputOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnOrderInsert', exc_info=True)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3451, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3451, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3451, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3451, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3451, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3451, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3451, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3451, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3451, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }
        __pyx_t_9 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3450, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3450, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3450, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_9) {
            __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_14, __pyx_t_8);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3450, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3449
 * 
 *   try:
 *     if pInputOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnOrderInsert(None if pInputOrder is NULL else py_ApiStructure.InputOrderField.from_address(<size_t> pInputOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      }

      /* "ptp/TraderApi.pyx":3448
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputOrder != NULL:
 *       self.OnErrRtnOrderInsert(None if pInputOrder is NULL else py_ApiStructure.InputOrderField.from_address(<size_t> pInputOrder)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3452
 *       self.OnErrRtnOrderInsert(None if pInputOrder is NULL else py_ApiStructure.InputOrderField.from_address(<size_t> pInputOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnOrderInsert', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnOrderInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_12) < 0) __PYX_ERR(0, 3452, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3453
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnOrderInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3453, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3453, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3453, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3453, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3453, __pyx_L15_error)
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__164, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3453, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }

      /* "ptp/TraderApi.pyx":3452
 *       self.OnErrRtnOrderInsert(None if pInputOrder is NULL else py_ApiStructure.InputOrderField.from_address(<size_t> pInputOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnOrderInsert', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3448
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputOrder != NULL:
 *       self.OnErrRtnOrderInsert(None if pInputOrder is NULL else py_ApiStructure.InputOrderField.from_address(<size_t> pInputOrder)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3455
 *       myEnv.logger.error('OnErrRtnOrderInsert', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3444
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnOrderInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputOrderField *pInputOrder
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnOrderInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3461
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnOrderAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcOrderActionField *pOrderAction
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

int TraderSpi_OnErrRtnOrderAction(PyObject *__pyx_v_self, struct CThostFtdcOrderActionField *__pyx_v_pOrderAction, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnErrRtnOrderAction", 0);

  /* "ptp/TraderApi.pyx":3465
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOrderAction != NULL:
 *       self.OnErrRtnOrderAction(None if pOrderAction is NULL else py_ApiStructure.OrderActionField.from_address(<size_t> pOrderAction)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3466
 * 
 *   try:
 *     if pOrderAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnOrderAction(None if pOrderAction is NULL else py_ApiStructure.OrderActionField.from_address(<size_t> pOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      __pyx_t_4 = ((__pyx_v_pOrderAction != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3467
 *   try:
 *     if pOrderAction != NULL:
 *       self.OnErrRtnOrderAction(None if pOrderAction is NULL else py_ApiStructure.OrderActionField.from_address(<size_t> pOrderAction)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnErrRtnOrderAction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3467, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pOrderAction == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3467, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_OrderActionField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3467, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3467, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pOrderAction)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3467, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3467, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3467, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3467, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3467, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3467, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3468
 *     if pOrderAction != NULL:
 *       self.OnErrRtnOrderAction(None if pOrderAction is NULL else py_ApiStructure.OrderActionField.from_address(<size_t> pOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnOrderAction', exc_info=True)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3468, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3468, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3468, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3468, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3468, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3468, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3468, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3468, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3468, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }
        __pyx_t_9 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3467, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3467, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3467, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_9) {
            __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_14, __pyx_t_8);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3467, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3466
 * 
 *   try:
 *     if pOrderAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnOrderAction(None if pOrderAction is NULL else py_ApiStructure.OrderActionField.from_address(<size_t> pOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      }

      /* "ptp/TraderApi.pyx":3465
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOrderAction != NULL:
 *       self.OnErrRtnOrderAction(None if pOrderAction is NULL else py_ApiStructure.OrderActionField.from_address(<size_t> pOrderAction)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3469
 *       self.OnErrRtnOrderAction(None if pOrderAction is NULL else py_ApiStructure.OrderActionField.from_address(<size_t> pOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnOrderAction', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_12) < 0) __PYX_ERR(0, 3469, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3470
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3470, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3470, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3470, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3470, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3470, __pyx_L15_error)
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__165, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3470, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }

      /* "ptp/TraderApi.pyx":3469
 *       self.OnErrRtnOrderAction(None if pOrderAction is NULL else py_ApiStructure.OrderActionField.from_address(<size_t> pOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnOrderAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3465
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOrderAction != NULL:
 *       self.OnErrRtnOrderAction(None if pOrderAction is NULL else py_ApiStructure.OrderActionField.from_address(<size_t> pOrderAction)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3472
 *       myEnv.logger.error('OnErrRtnOrderAction', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3461
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnOrderAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcOrderActionField *pOrderAction
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3478
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnInstrumentStatus(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInstrumentStatusField *pInstrumentStatus) except -1:
 * 
 */

int TraderSpi_OnRtnInstrumentStatus(PyObject *__pyx_v_self, struct CThostFtdcInstrumentStatusField *__pyx_v_pInstrumentStatus) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnInstrumentStatus", 0);

  /* "ptp/TraderApi.pyx":3481
 *     , CThostFtdcInstrumentStatusField *pInstrumentStatus) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInstrumentStatus != NULL:
 *       self.OnRtnInstrumentStatus(None if pInstrumentStatus is NULL else py_ApiStructure.InstrumentStatusField.from_address(<size_t> pInstrumentStatus))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3482
 * 
 *   try:
 *     if pInstrumentStatus != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnInstrumentStatus(None if pInstrumentStatus is NULL else py_ApiStructure.InstrumentStatusField.from_address(<size_t> pInstrumentStatus))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pInstrumentStatus != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3483
 *   try:
 *     if pInstrumentStatus != NULL:
 *       self.OnRtnInstrumentStatus(None if pInstrumentStatus is NULL else py_ApiStructure.InstrumentStatusField.from_address(<size_t> pInstrumentStatus))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnInstrumentStatus', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnInstrumentStatus); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3483, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInstrumentStatus == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3483, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InstrumentStatusField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3483, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3483, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInstrumentStatus)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3483, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3483, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3483, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3483, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3483, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3483, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3483, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3483, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3483, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3483, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3483, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3482
 * 
 *   try:
 *     if pInstrumentStatus != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnInstrumentStatus(None if pInstrumentStatus is NULL else py_ApiStructure.InstrumentStatusField.from_address(<size_t> pInstrumentStatus))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":3481
 *     , CThostFtdcInstrumentStatusField *pInstrumentStatus) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInstrumentStatus != NULL:
 *       self.OnRtnInstrumentStatus(None if pInstrumentStatus is NULL else py_ApiStructure.InstrumentStatusField.from_address(<size_t> pInstrumentStatus))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3484
 *     if pInstrumentStatus != NULL:
 *       self.OnRtnInstrumentStatus(None if pInstrumentStatus is NULL else py_ApiStructure.InstrumentStatusField.from_address(<size_t> pInstrumentStatus))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnInstrumentStatus', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnInstrumentStatus", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 3484, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3485
 *       self.OnRtnInstrumentStatus(None if pInstrumentStatus is NULL else py_ApiStructure.InstrumentStatusField.from_address(<size_t> pInstrumentStatus))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnInstrumentStatus', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3485, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3485, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3485, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3485, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3485, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__166, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3485, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":3484
 *     if pInstrumentStatus != NULL:
 *       self.OnRtnInstrumentStatus(None if pInstrumentStatus is NULL else py_ApiStructure.InstrumentStatusField.from_address(<size_t> pInstrumentStatus))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnInstrumentStatus', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3481
 *     , CThostFtdcInstrumentStatusField *pInstrumentStatus) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInstrumentStatus != NULL:
 *       self.OnRtnInstrumentStatus(None if pInstrumentStatus is NULL else py_ApiStructure.InstrumentStatusField.from_address(<size_t> pInstrumentStatus))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3487
 *       myEnv.logger.error('OnRtnInstrumentStatus', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3478
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnInstrumentStatus(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInstrumentStatusField *pInstrumentStatus) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnInstrumentStatus", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3493
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnBulletin(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcBulletinField *pBulletin) except -1:
 * 
 */

int TraderSpi_OnRtnBulletin(PyObject *__pyx_v_self, struct CThostFtdcBulletinField *__pyx_v_pBulletin) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnBulletin", 0);

  /* "ptp/TraderApi.pyx":3496
 *     , CThostFtdcBulletinField *pBulletin) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pBulletin != NULL:
 *       self.OnRtnBulletin(None if pBulletin is NULL else py_ApiStructure.BulletinField.from_address(<size_t> pBulletin))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3497
 * 
 *   try:
 *     if pBulletin != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnBulletin(None if pBulletin is NULL else py_ApiStructure.BulletinField.from_address(<size_t> pBulletin))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pBulletin != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3498
 *   try:
 *     if pBulletin != NULL:
 *       self.OnRtnBulletin(None if pBulletin is NULL else py_ApiStructure.BulletinField.from_address(<size_t> pBulletin))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnBulletin', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnBulletin); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3498, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pBulletin == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3498, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_BulletinField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3498, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3498, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pBulletin)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3498, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3498, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3498, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3498, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3498, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3498, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3498, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3498, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3498, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3498, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3498, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3497
 * 
 *   try:
 *     if pBulletin != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnBulletin(None if pBulletin is NULL else py_ApiStructure.BulletinField.from_address(<size_t> pBulletin))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":3496
 *     , CThostFtdcBulletinField *pBulletin) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pBulletin != NULL:
 *       self.OnRtnBulletin(None if pBulletin is NULL else py_ApiStructure.BulletinField.from_address(<size_t> pBulletin))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3499
 *     if pBulletin != NULL:
 *       self.OnRtnBulletin(None if pBulletin is NULL else py_ApiStructure.BulletinField.from_address(<size_t> pBulletin))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnBulletin', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnBulletin", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 3499, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3500
 *       self.OnRtnBulletin(None if pBulletin is NULL else py_ApiStructure.BulletinField.from_address(<size_t> pBulletin))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnBulletin', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3500, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3500, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3500, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3500, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3500, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__167, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3500, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":3499
 *     if pBulletin != NULL:
 *       self.OnRtnBulletin(None if pBulletin is NULL else py_ApiStructure.BulletinField.from_address(<size_t> pBulletin))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnBulletin', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3496
 *     , CThostFtdcBulletinField *pBulletin) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pBulletin != NULL:
 *       self.OnRtnBulletin(None if pBulletin is NULL else py_ApiStructure.BulletinField.from_address(<size_t> pBulletin))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3502
 *       myEnv.logger.error('OnRtnBulletin', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3493
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnBulletin(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcBulletinField *pBulletin) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnBulletin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3508
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnTradingNotice(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcTradingNoticeInfoField *pTradingNoticeInfo) except -1:
 * 
 */

int TraderSpi_OnRtnTradingNotice(PyObject *__pyx_v_self, struct CThostFtdcTradingNoticeInfoField *__pyx_v_pTradingNoticeInfo) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnTradingNotice", 0);

  /* "ptp/TraderApi.pyx":3511
 *     , CThostFtdcTradingNoticeInfoField *pTradingNoticeInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTradingNoticeInfo != NULL:
 *       self.OnRtnTradingNotice(None if pTradingNoticeInfo is NULL else py_ApiStructure.TradingNoticeInfoField.from_address(<size_t> pTradingNoticeInfo))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3512
 * 
 *   try:
 *     if pTradingNoticeInfo != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnTradingNotice(None if pTradingNoticeInfo is NULL else py_ApiStructure.TradingNoticeInfoField.from_address(<size_t> pTradingNoticeInfo))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pTradingNoticeInfo != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3513
 *   try:
 *     if pTradingNoticeInfo != NULL:
 *       self.OnRtnTradingNotice(None if pTradingNoticeInfo is NULL else py_ApiStructure.TradingNoticeInfoField.from_address(<size_t> pTradingNoticeInfo))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnTradingNotice', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnTradingNotice); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3513, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pTradingNoticeInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3513, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_TradingNoticeInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3513, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3513, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pTradingNoticeInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3513, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3513, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3513, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3513, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3513, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3513, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3513, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3513, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3513, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3513, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3513, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3512
 * 
 *   try:
 *     if pTradingNoticeInfo != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnTradingNotice(None if pTradingNoticeInfo is NULL else py_ApiStructure.TradingNoticeInfoField.from_address(<size_t> pTradingNoticeInfo))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":3511
 *     , CThostFtdcTradingNoticeInfoField *pTradingNoticeInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTradingNoticeInfo != NULL:
 *       self.OnRtnTradingNotice(None if pTradingNoticeInfo is NULL else py_ApiStructure.TradingNoticeInfoField.from_address(<size_t> pTradingNoticeInfo))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3514
 *     if pTradingNoticeInfo != NULL:
 *       self.OnRtnTradingNotice(None if pTradingNoticeInfo is NULL else py_ApiStructure.TradingNoticeInfoField.from_address(<size_t> pTradingNoticeInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnTradingNotice', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnTradingNotice", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 3514, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3515
 *       self.OnRtnTradingNotice(None if pTradingNoticeInfo is NULL else py_ApiStructure.TradingNoticeInfoField.from_address(<size_t> pTradingNoticeInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnTradingNotice', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3515, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3515, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3515, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3515, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3515, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__168, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3515, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":3514
 *     if pTradingNoticeInfo != NULL:
 *       self.OnRtnTradingNotice(None if pTradingNoticeInfo is NULL else py_ApiStructure.TradingNoticeInfoField.from_address(<size_t> pTradingNoticeInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnTradingNotice', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3511
 *     , CThostFtdcTradingNoticeInfoField *pTradingNoticeInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTradingNoticeInfo != NULL:
 *       self.OnRtnTradingNotice(None if pTradingNoticeInfo is NULL else py_ApiStructure.TradingNoticeInfoField.from_address(<size_t> pTradingNoticeInfo))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3517
 *       myEnv.logger.error('OnRtnTradingNotice', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3508
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnTradingNotice(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcTradingNoticeInfoField *pTradingNoticeInfo) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnTradingNotice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3523
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnErrorConditionalOrder(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcErrorConditionalOrderField *pErrorConditionalOrder) except -1:
 * 
 */

int TraderSpi_OnRtnErrorConditionalOrder(PyObject *__pyx_v_self, struct CThostFtdcErrorConditionalOrderField *__pyx_v_pErrorConditionalOrder) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnErrorConditionalOrder", 0);

  /* "ptp/TraderApi.pyx":3526
 *     , CThostFtdcErrorConditionalOrderField *pErrorConditionalOrder) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pErrorConditionalOrder != NULL:
 *       self.OnRtnErrorConditionalOrder(None if pErrorConditionalOrder is NULL else py_ApiStructure.ErrorConditionalOrderField.from_address(<size_t> pErrorConditionalOrder))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3527
 * 
 *   try:
 *     if pErrorConditionalOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnErrorConditionalOrder(None if pErrorConditionalOrder is NULL else py_ApiStructure.ErrorConditionalOrderField.from_address(<size_t> pErrorConditionalOrder))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pErrorConditionalOrder != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3528
 *   try:
 *     if pErrorConditionalOrder != NULL:
 *       self.OnRtnErrorConditionalOrder(None if pErrorConditionalOrder is NULL else py_ApiStructure.ErrorConditionalOrderField.from_address(<size_t> pErrorConditionalOrder))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnErrorConditionalOrder', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnErrorConditionalOrder); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3528, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pErrorConditionalOrder == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3528, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ErrorConditionalOrderField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3528, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3528, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pErrorConditionalOrder)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3528, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3528, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3528, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3528, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3528, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3528, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3528, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3528, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3528, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3528, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3528, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3527
 * 
 *   try:
 *     if pErrorConditionalOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnErrorConditionalOrder(None if pErrorConditionalOrder is NULL else py_ApiStructure.ErrorConditionalOrderField.from_address(<size_t> pErrorConditionalOrder))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":3526
 *     , CThostFtdcErrorConditionalOrderField *pErrorConditionalOrder) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pErrorConditionalOrder != NULL:
 *       self.OnRtnErrorConditionalOrder(None if pErrorConditionalOrder is NULL else py_ApiStructure.ErrorConditionalOrderField.from_address(<size_t> pErrorConditionalOrder))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3529
 *     if pErrorConditionalOrder != NULL:
 *       self.OnRtnErrorConditionalOrder(None if pErrorConditionalOrder is NULL else py_ApiStructure.ErrorConditionalOrderField.from_address(<size_t> pErrorConditionalOrder))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnErrorConditionalOrder', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnErrorConditionalOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 3529, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3530
 *       self.OnRtnErrorConditionalOrder(None if pErrorConditionalOrder is NULL else py_ApiStructure.ErrorConditionalOrderField.from_address(<size_t> pErrorConditionalOrder))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnErrorConditionalOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3530, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3530, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3530, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3530, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3530, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__169, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3530, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":3529
 *     if pErrorConditionalOrder != NULL:
 *       self.OnRtnErrorConditionalOrder(None if pErrorConditionalOrder is NULL else py_ApiStructure.ErrorConditionalOrderField.from_address(<size_t> pErrorConditionalOrder))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnErrorConditionalOrder', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3526
 *     , CThostFtdcErrorConditionalOrderField *pErrorConditionalOrder) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pErrorConditionalOrder != NULL:
 *       self.OnRtnErrorConditionalOrder(None if pErrorConditionalOrder is NULL else py_ApiStructure.ErrorConditionalOrderField.from_address(<size_t> pErrorConditionalOrder))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3532
 *       myEnv.logger.error('OnRtnErrorConditionalOrder', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3523
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnErrorConditionalOrder(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcErrorConditionalOrderField *pErrorConditionalOrder) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnErrorConditionalOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3538
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnExecOrder(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcExecOrderField *pExecOrder) except -1:
 * 
 */

int TraderSpi_OnRtnExecOrder(PyObject *__pyx_v_self, struct CThostFtdcExecOrderField *__pyx_v_pExecOrder) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnExecOrder", 0);

  /* "ptp/TraderApi.pyx":3541
 *     , CThostFtdcExecOrderField *pExecOrder) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pExecOrder != NULL:
 *       self.OnRtnExecOrder(None if pExecOrder is NULL else py_ApiStructure.ExecOrderField.from_address(<size_t> pExecOrder))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3542
 * 
 *   try:
 *     if pExecOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnExecOrder(None if pExecOrder is NULL else py_ApiStructure.ExecOrderField.from_address(<size_t> pExecOrder))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pExecOrder != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3543
 *   try:
 *     if pExecOrder != NULL:
 *       self.OnRtnExecOrder(None if pExecOrder is NULL else py_ApiStructure.ExecOrderField.from_address(<size_t> pExecOrder))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnExecOrder', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnExecOrder); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3543, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pExecOrder == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3543, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ExecOrderField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3543, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3543, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pExecOrder)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3543, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3543, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3543, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3543, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3543, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3543, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3543, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3543, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3543, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3543, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3543, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3542
 * 
 *   try:
 *     if pExecOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnExecOrder(None if pExecOrder is NULL else py_ApiStructure.ExecOrderField.from_address(<size_t> pExecOrder))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":3541
 *     , CThostFtdcExecOrderField *pExecOrder) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pExecOrder != NULL:
 *       self.OnRtnExecOrder(None if pExecOrder is NULL else py_ApiStructure.ExecOrderField.from_address(<size_t> pExecOrder))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3544
 *     if pExecOrder != NULL:
 *       self.OnRtnExecOrder(None if pExecOrder is NULL else py_ApiStructure.ExecOrderField.from_address(<size_t> pExecOrder))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnExecOrder', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnExecOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 3544, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3545
 *       self.OnRtnExecOrder(None if pExecOrder is NULL else py_ApiStructure.ExecOrderField.from_address(<size_t> pExecOrder))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnExecOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3545, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3545, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3545, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3545, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3545, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__170, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3545, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":3544
 *     if pExecOrder != NULL:
 *       self.OnRtnExecOrder(None if pExecOrder is NULL else py_ApiStructure.ExecOrderField.from_address(<size_t> pExecOrder))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnExecOrder', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3541
 *     , CThostFtdcExecOrderField *pExecOrder) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pExecOrder != NULL:
 *       self.OnRtnExecOrder(None if pExecOrder is NULL else py_ApiStructure.ExecOrderField.from_address(<size_t> pExecOrder))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3547
 *       myEnv.logger.error('OnRtnExecOrder', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3538
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnExecOrder(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcExecOrderField *pExecOrder) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnExecOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3553
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnExecOrderInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputExecOrderField *pInputExecOrder
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

int TraderSpi_OnErrRtnExecOrderInsert(PyObject *__pyx_v_self, struct CThostFtdcInputExecOrderField *__pyx_v_pInputExecOrder, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnErrRtnExecOrderInsert", 0);

  /* "ptp/TraderApi.pyx":3557
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputExecOrder != NULL:
 *       self.OnErrRtnExecOrderInsert(None if pInputExecOrder is NULL else py_ApiStructure.InputExecOrderField.from_address(<size_t> pInputExecOrder)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3558
 * 
 *   try:
 *     if pInputExecOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnExecOrderInsert(None if pInputExecOrder is NULL else py_ApiStructure.InputExecOrderField.from_address(<size_t> pInputExecOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      __pyx_t_4 = ((__pyx_v_pInputExecOrder != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3559
 *   try:
 *     if pInputExecOrder != NULL:
 *       self.OnErrRtnExecOrderInsert(None if pInputExecOrder is NULL else py_ApiStructure.InputExecOrderField.from_address(<size_t> pInputExecOrder)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnErrRtnExecOrderInsert); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3559, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInputExecOrder == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3559, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InputExecOrderField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3559, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3559, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInputExecOrder)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3559, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3559, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3559, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3559, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3559, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3559, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3560
 *     if pInputExecOrder != NULL:
 *       self.OnErrRtnExecOrderInsert(None if pInputExecOrder is NULL else py_ApiStructure.InputExecOrderField.from_address(<size_t> pInputExecOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnExecOrderInsert', exc_info=True)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3560, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3560, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3560, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3560, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3560, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3560, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3560, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3560, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3560, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }
        __pyx_t_9 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3559, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3559, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3559, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_9) {
            __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_14, __pyx_t_8);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3559, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3558
 * 
 *   try:
 *     if pInputExecOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnExecOrderInsert(None if pInputExecOrder is NULL else py_ApiStructure.InputExecOrderField.from_address(<size_t> pInputExecOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      }

      /* "ptp/TraderApi.pyx":3557
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputExecOrder != NULL:
 *       self.OnErrRtnExecOrderInsert(None if pInputExecOrder is NULL else py_ApiStructure.InputExecOrderField.from_address(<size_t> pInputExecOrder)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3561
 *       self.OnErrRtnExecOrderInsert(None if pInputExecOrder is NULL else py_ApiStructure.InputExecOrderField.from_address(<size_t> pInputExecOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnExecOrderInsert', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnExecOrderInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_12) < 0) __PYX_ERR(0, 3561, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3562
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnExecOrderInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3562, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3562, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3562, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3562, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3562, __pyx_L15_error)
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__171, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3562, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }

      /* "ptp/TraderApi.pyx":3561
 *       self.OnErrRtnExecOrderInsert(None if pInputExecOrder is NULL else py_ApiStructure.InputExecOrderField.from_address(<size_t> pInputExecOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnExecOrderInsert', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3557
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputExecOrder != NULL:
 *       self.OnErrRtnExecOrderInsert(None if pInputExecOrder is NULL else py_ApiStructure.InputExecOrderField.from_address(<size_t> pInputExecOrder)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3564
 *       myEnv.logger.error('OnErrRtnExecOrderInsert', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3553
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnExecOrderInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputExecOrderField *pInputExecOrder
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnExecOrderInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3570
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnExecOrderAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcExecOrderActionField *pExecOrderAction
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

int TraderSpi_OnErrRtnExecOrderAction(PyObject *__pyx_v_self, struct CThostFtdcExecOrderActionField *__pyx_v_pExecOrderAction, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnErrRtnExecOrderAction", 0);

  /* "ptp/TraderApi.pyx":3574
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pExecOrderAction != NULL:
 *       self.OnErrRtnExecOrderAction(None if pExecOrderAction is NULL else py_ApiStructure.ExecOrderActionField.from_address(<size_t> pExecOrderAction)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3575
 * 
 *   try:
 *     if pExecOrderAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnExecOrderAction(None if pExecOrderAction is NULL else py_ApiStructure.ExecOrderActionField.from_address(<size_t> pExecOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      __pyx_t_4 = ((__pyx_v_pExecOrderAction != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3576
 *   try:
 *     if pExecOrderAction != NULL:
 *       self.OnErrRtnExecOrderAction(None if pExecOrderAction is NULL else py_ApiStructure.ExecOrderActionField.from_address(<size_t> pExecOrderAction)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnErrRtnExecOrderAction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3576, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pExecOrderAction == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3576, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ExecOrderActionField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3576, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3576, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pExecOrderAction)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3576, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3576, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3576, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3576, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3576, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3576, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3577
 *     if pExecOrderAction != NULL:
 *       self.OnErrRtnExecOrderAction(None if pExecOrderAction is NULL else py_ApiStructure.ExecOrderActionField.from_address(<size_t> pExecOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnExecOrderAction', exc_info=True)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3577, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3577, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3577, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3577, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3577, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3577, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3577, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3577, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3577, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }
        __pyx_t_9 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3576, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3576, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3576, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_9) {
            __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_14, __pyx_t_8);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3576, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3575
 * 
 *   try:
 *     if pExecOrderAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnExecOrderAction(None if pExecOrderAction is NULL else py_ApiStructure.ExecOrderActionField.from_address(<size_t> pExecOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      }

      /* "ptp/TraderApi.pyx":3574
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pExecOrderAction != NULL:
 *       self.OnErrRtnExecOrderAction(None if pExecOrderAction is NULL else py_ApiStructure.ExecOrderActionField.from_address(<size_t> pExecOrderAction)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3578
 *       self.OnErrRtnExecOrderAction(None if pExecOrderAction is NULL else py_ApiStructure.ExecOrderActionField.from_address(<size_t> pExecOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnExecOrderAction', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnExecOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_12) < 0) __PYX_ERR(0, 3578, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3579
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnExecOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3579, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3579, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3579, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3579, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3579, __pyx_L15_error)
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__172, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3579, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }

      /* "ptp/TraderApi.pyx":3578
 *       self.OnErrRtnExecOrderAction(None if pExecOrderAction is NULL else py_ApiStructure.ExecOrderActionField.from_address(<size_t> pExecOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnExecOrderAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3574
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pExecOrderAction != NULL:
 *       self.OnErrRtnExecOrderAction(None if pExecOrderAction is NULL else py_ApiStructure.ExecOrderActionField.from_address(<size_t> pExecOrderAction)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3581
 *       myEnv.logger.error('OnErrRtnExecOrderAction', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3570
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnExecOrderAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcExecOrderActionField *pExecOrderAction
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnExecOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3587
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnForQuoteInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputForQuoteField *pInputForQuote
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

int TraderSpi_OnErrRtnForQuoteInsert(PyObject *__pyx_v_self, struct CThostFtdcInputForQuoteField *__pyx_v_pInputForQuote, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnErrRtnForQuoteInsert", 0);

  /* "ptp/TraderApi.pyx":3591
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputForQuote != NULL:
 *       self.OnErrRtnForQuoteInsert(None if pInputForQuote is NULL else py_ApiStructure.InputForQuoteField.from_address(<size_t> pInputForQuote)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3592
 * 
 *   try:
 *     if pInputForQuote != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnForQuoteInsert(None if pInputForQuote is NULL else py_ApiStructure.InputForQuoteField.from_address(<size_t> pInputForQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      __pyx_t_4 = ((__pyx_v_pInputForQuote != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3593
 *   try:
 *     if pInputForQuote != NULL:
 *       self.OnErrRtnForQuoteInsert(None if pInputForQuote is NULL else py_ApiStructure.InputForQuoteField.from_address(<size_t> pInputForQuote)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnErrRtnForQuoteInsert); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3593, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInputForQuote == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3593, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InputForQuoteField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3593, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3593, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInputForQuote)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3593, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3593, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3593, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3593, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3593, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3593, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3594
 *     if pInputForQuote != NULL:
 *       self.OnErrRtnForQuoteInsert(None if pInputForQuote is NULL else py_ApiStructure.InputForQuoteField.from_address(<size_t> pInputForQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnForQuoteInsert', exc_info=True)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3594, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3594, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3594, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3594, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3594, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3594, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3594, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3594, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3594, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }
        __pyx_t_9 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3593, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3593, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3593, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_9) {
            __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_14, __pyx_t_8);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3593, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3592
 * 
 *   try:
 *     if pInputForQuote != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnForQuoteInsert(None if pInputForQuote is NULL else py_ApiStructure.InputForQuoteField.from_address(<size_t> pInputForQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      }

      /* "ptp/TraderApi.pyx":3591
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputForQuote != NULL:
 *       self.OnErrRtnForQuoteInsert(None if pInputForQuote is NULL else py_ApiStructure.InputForQuoteField.from_address(<size_t> pInputForQuote)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3595
 *       self.OnErrRtnForQuoteInsert(None if pInputForQuote is NULL else py_ApiStructure.InputForQuoteField.from_address(<size_t> pInputForQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnForQuoteInsert', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnForQuoteInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_12) < 0) __PYX_ERR(0, 3595, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3596
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnForQuoteInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3596, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3596, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3596, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3596, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3596, __pyx_L15_error)
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__173, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3596, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }

      /* "ptp/TraderApi.pyx":3595
 *       self.OnErrRtnForQuoteInsert(None if pInputForQuote is NULL else py_ApiStructure.InputForQuoteField.from_address(<size_t> pInputForQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnForQuoteInsert', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3591
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputForQuote != NULL:
 *       self.OnErrRtnForQuoteInsert(None if pInputForQuote is NULL else py_ApiStructure.InputForQuoteField.from_address(<size_t> pInputForQuote)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3598
 *       myEnv.logger.error('OnErrRtnForQuoteInsert', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3587
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnForQuoteInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputForQuoteField *pInputForQuote
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnForQuoteInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3604
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnQuote(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcQuoteField *pQuote) except -1:
 * 
 */

int TraderSpi_OnRtnQuote(PyObject *__pyx_v_self, struct CThostFtdcQuoteField *__pyx_v_pQuote) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnQuote", 0);

  /* "ptp/TraderApi.pyx":3607
 *     , CThostFtdcQuoteField *pQuote) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pQuote != NULL:
 *       self.OnRtnQuote(None if pQuote is NULL else py_ApiStructure.QuoteField.from_address(<size_t> pQuote))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3608
 * 
 *   try:
 *     if pQuote != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnQuote(None if pQuote is NULL else py_ApiStructure.QuoteField.from_address(<size_t> pQuote))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pQuote != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3609
 *   try:
 *     if pQuote != NULL:
 *       self.OnRtnQuote(None if pQuote is NULL else py_ApiStructure.QuoteField.from_address(<size_t> pQuote))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnQuote', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnQuote); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3609, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pQuote == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3609, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_QuoteField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3609, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3609, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pQuote)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3609, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3609, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3609, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3609, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3609, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3609, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3609, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3609, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3609, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3609, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3609, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3608
 * 
 *   try:
 *     if pQuote != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnQuote(None if pQuote is NULL else py_ApiStructure.QuoteField.from_address(<size_t> pQuote))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":3607
 *     , CThostFtdcQuoteField *pQuote) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pQuote != NULL:
 *       self.OnRtnQuote(None if pQuote is NULL else py_ApiStructure.QuoteField.from_address(<size_t> pQuote))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3610
 *     if pQuote != NULL:
 *       self.OnRtnQuote(None if pQuote is NULL else py_ApiStructure.QuoteField.from_address(<size_t> pQuote))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnQuote', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnQuote", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 3610, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3611
 *       self.OnRtnQuote(None if pQuote is NULL else py_ApiStructure.QuoteField.from_address(<size_t> pQuote))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnQuote', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3611, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3611, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3611, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3611, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3611, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__174, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3611, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":3610
 *     if pQuote != NULL:
 *       self.OnRtnQuote(None if pQuote is NULL else py_ApiStructure.QuoteField.from_address(<size_t> pQuote))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnQuote', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3607
 *     , CThostFtdcQuoteField *pQuote) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pQuote != NULL:
 *       self.OnRtnQuote(None if pQuote is NULL else py_ApiStructure.QuoteField.from_address(<size_t> pQuote))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3613
 *       myEnv.logger.error('OnRtnQuote', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3604
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnQuote(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcQuoteField *pQuote) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnQuote", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3619
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnQuoteInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputQuoteField *pInputQuote
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

int TraderSpi_OnErrRtnQuoteInsert(PyObject *__pyx_v_self, struct CThostFtdcInputQuoteField *__pyx_v_pInputQuote, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnErrRtnQuoteInsert", 0);

  /* "ptp/TraderApi.pyx":3623
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputQuote != NULL:
 *       self.OnErrRtnQuoteInsert(None if pInputQuote is NULL else py_ApiStructure.InputQuoteField.from_address(<size_t> pInputQuote)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3624
 * 
 *   try:
 *     if pInputQuote != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnQuoteInsert(None if pInputQuote is NULL else py_ApiStructure.InputQuoteField.from_address(<size_t> pInputQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      __pyx_t_4 = ((__pyx_v_pInputQuote != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3625
 *   try:
 *     if pInputQuote != NULL:
 *       self.OnErrRtnQuoteInsert(None if pInputQuote is NULL else py_ApiStructure.InputQuoteField.from_address(<size_t> pInputQuote)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnErrRtnQuoteInsert); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3625, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInputQuote == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3625, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InputQuoteField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3625, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3625, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInputQuote)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3625, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3625, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3625, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3625, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3625, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3625, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3626
 *     if pInputQuote != NULL:
 *       self.OnErrRtnQuoteInsert(None if pInputQuote is NULL else py_ApiStructure.InputQuoteField.from_address(<size_t> pInputQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnQuoteInsert', exc_info=True)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3626, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3626, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3626, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3626, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3626, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3626, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3626, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3626, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3626, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }
        __pyx_t_9 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3625, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3625, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3625, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_9) {
            __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_14, __pyx_t_8);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3625, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3624
 * 
 *   try:
 *     if pInputQuote != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnQuoteInsert(None if pInputQuote is NULL else py_ApiStructure.InputQuoteField.from_address(<size_t> pInputQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      }

      /* "ptp/TraderApi.pyx":3623
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputQuote != NULL:
 *       self.OnErrRtnQuoteInsert(None if pInputQuote is NULL else py_ApiStructure.InputQuoteField.from_address(<size_t> pInputQuote)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3627
 *       self.OnErrRtnQuoteInsert(None if pInputQuote is NULL else py_ApiStructure.InputQuoteField.from_address(<size_t> pInputQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnQuoteInsert', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnQuoteInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_12) < 0) __PYX_ERR(0, 3627, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3628
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnQuoteInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3628, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3628, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3628, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3628, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3628, __pyx_L15_error)
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__175, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3628, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }

      /* "ptp/TraderApi.pyx":3627
 *       self.OnErrRtnQuoteInsert(None if pInputQuote is NULL else py_ApiStructure.InputQuoteField.from_address(<size_t> pInputQuote)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnQuoteInsert', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3623
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputQuote != NULL:
 *       self.OnErrRtnQuoteInsert(None if pInputQuote is NULL else py_ApiStructure.InputQuoteField.from_address(<size_t> pInputQuote)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3630
 *       myEnv.logger.error('OnErrRtnQuoteInsert', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3619
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnQuoteInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputQuoteField *pInputQuote
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnQuoteInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3636
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnQuoteAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcQuoteActionField *pQuoteAction
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

int TraderSpi_OnErrRtnQuoteAction(PyObject *__pyx_v_self, struct CThostFtdcQuoteActionField *__pyx_v_pQuoteAction, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnErrRtnQuoteAction", 0);

  /* "ptp/TraderApi.pyx":3640
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pQuoteAction != NULL:
 *       self.OnErrRtnQuoteAction(None if pQuoteAction is NULL else py_ApiStructure.QuoteActionField.from_address(<size_t> pQuoteAction)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3641
 * 
 *   try:
 *     if pQuoteAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnQuoteAction(None if pQuoteAction is NULL else py_ApiStructure.QuoteActionField.from_address(<size_t> pQuoteAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      __pyx_t_4 = ((__pyx_v_pQuoteAction != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3642
 *   try:
 *     if pQuoteAction != NULL:
 *       self.OnErrRtnQuoteAction(None if pQuoteAction is NULL else py_ApiStructure.QuoteActionField.from_address(<size_t> pQuoteAction)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnErrRtnQuoteAction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3642, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pQuoteAction == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3642, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_QuoteActionField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3642, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3642, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pQuoteAction)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3642, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3642, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3642, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3642, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3642, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3642, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3643
 *     if pQuoteAction != NULL:
 *       self.OnErrRtnQuoteAction(None if pQuoteAction is NULL else py_ApiStructure.QuoteActionField.from_address(<size_t> pQuoteAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnQuoteAction', exc_info=True)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3643, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3643, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3643, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3643, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3643, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3643, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3643, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3643, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3643, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }
        __pyx_t_9 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3642, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3642, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3642, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_9) {
            __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_14, __pyx_t_8);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3642, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3641
 * 
 *   try:
 *     if pQuoteAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnQuoteAction(None if pQuoteAction is NULL else py_ApiStructure.QuoteActionField.from_address(<size_t> pQuoteAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      }

      /* "ptp/TraderApi.pyx":3640
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pQuoteAction != NULL:
 *       self.OnErrRtnQuoteAction(None if pQuoteAction is NULL else py_ApiStructure.QuoteActionField.from_address(<size_t> pQuoteAction)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3644
 *       self.OnErrRtnQuoteAction(None if pQuoteAction is NULL else py_ApiStructure.QuoteActionField.from_address(<size_t> pQuoteAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnQuoteAction', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnQuoteAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_12) < 0) __PYX_ERR(0, 3644, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3645
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnQuoteAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3645, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3645, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3645, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3645, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3645, __pyx_L15_error)
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__176, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3645, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }

      /* "ptp/TraderApi.pyx":3644
 *       self.OnErrRtnQuoteAction(None if pQuoteAction is NULL else py_ApiStructure.QuoteActionField.from_address(<size_t> pQuoteAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnQuoteAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3640
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pQuoteAction != NULL:
 *       self.OnErrRtnQuoteAction(None if pQuoteAction is NULL else py_ApiStructure.QuoteActionField.from_address(<size_t> pQuoteAction)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3647
 *       myEnv.logger.error('OnErrRtnQuoteAction', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3636
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnQuoteAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcQuoteActionField *pQuoteAction
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnQuoteAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3653
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnForQuoteRsp(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcForQuoteRspField *pForQuoteRsp) except -1:
 * 
 */

int TraderSpi_OnRtnForQuoteRsp(PyObject *__pyx_v_self, struct CThostFtdcForQuoteRspField *__pyx_v_pForQuoteRsp) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnForQuoteRsp", 0);

  /* "ptp/TraderApi.pyx":3656
 *     , CThostFtdcForQuoteRspField *pForQuoteRsp) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pForQuoteRsp != NULL:
 *       self.OnRtnForQuoteRsp(None if pForQuoteRsp is NULL else py_ApiStructure.ForQuoteRspField.from_address(<size_t> pForQuoteRsp))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3657
 * 
 *   try:
 *     if pForQuoteRsp != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnForQuoteRsp(None if pForQuoteRsp is NULL else py_ApiStructure.ForQuoteRspField.from_address(<size_t> pForQuoteRsp))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pForQuoteRsp != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3658
 *   try:
 *     if pForQuoteRsp != NULL:
 *       self.OnRtnForQuoteRsp(None if pForQuoteRsp is NULL else py_ApiStructure.ForQuoteRspField.from_address(<size_t> pForQuoteRsp))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnForQuoteRsp', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnForQuoteRsp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3658, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pForQuoteRsp == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3658, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ForQuoteRspField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3658, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3658, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pForQuoteRsp)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3658, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3658, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3658, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3658, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3658, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3658, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3658, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3658, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3658, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3658, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3658, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3657
 * 
 *   try:
 *     if pForQuoteRsp != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnForQuoteRsp(None if pForQuoteRsp is NULL else py_ApiStructure.ForQuoteRspField.from_address(<size_t> pForQuoteRsp))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":3656
 *     , CThostFtdcForQuoteRspField *pForQuoteRsp) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pForQuoteRsp != NULL:
 *       self.OnRtnForQuoteRsp(None if pForQuoteRsp is NULL else py_ApiStructure.ForQuoteRspField.from_address(<size_t> pForQuoteRsp))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3659
 *     if pForQuoteRsp != NULL:
 *       self.OnRtnForQuoteRsp(None if pForQuoteRsp is NULL else py_ApiStructure.ForQuoteRspField.from_address(<size_t> pForQuoteRsp))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnForQuoteRsp', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnForQuoteRsp", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 3659, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3660
 *       self.OnRtnForQuoteRsp(None if pForQuoteRsp is NULL else py_ApiStructure.ForQuoteRspField.from_address(<size_t> pForQuoteRsp))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnForQuoteRsp', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3660, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3660, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3660, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3660, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3660, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__177, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3660, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":3659
 *     if pForQuoteRsp != NULL:
 *       self.OnRtnForQuoteRsp(None if pForQuoteRsp is NULL else py_ApiStructure.ForQuoteRspField.from_address(<size_t> pForQuoteRsp))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnForQuoteRsp', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3656
 *     , CThostFtdcForQuoteRspField *pForQuoteRsp) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pForQuoteRsp != NULL:
 *       self.OnRtnForQuoteRsp(None if pForQuoteRsp is NULL else py_ApiStructure.ForQuoteRspField.from_address(<size_t> pForQuoteRsp))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3662
 *       myEnv.logger.error('OnRtnForQuoteRsp', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3653
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnForQuoteRsp(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcForQuoteRspField *pForQuoteRsp) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnForQuoteRsp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3668
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnCFMMCTradingAccountToken(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcCFMMCTradingAccountTokenField *pCFMMCTradingAccountToken) except -1:
 * 
 */

int TraderSpi_OnRtnCFMMCTradingAccountToken(PyObject *__pyx_v_self, struct CThostFtdcCFMMCTradingAccountTokenField *__pyx_v_pCFMMCTradingAccountToken) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnCFMMCTradingAccountToken", 0);

  /* "ptp/TraderApi.pyx":3671
 *     , CThostFtdcCFMMCTradingAccountTokenField *pCFMMCTradingAccountToken) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pCFMMCTradingAccountToken != NULL:
 *       self.OnRtnCFMMCTradingAccountToken(None if pCFMMCTradingAccountToken is NULL else py_ApiStructure.CFMMCTradingAccountTokenField.from_address(<size_t> pCFMMCTradingAccountToken))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3672
 * 
 *   try:
 *     if pCFMMCTradingAccountToken != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnCFMMCTradingAccountToken(None if pCFMMCTradingAccountToken is NULL else py_ApiStructure.CFMMCTradingAccountTokenField.from_address(<size_t> pCFMMCTradingAccountToken))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pCFMMCTradingAccountToken != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3673
 *   try:
 *     if pCFMMCTradingAccountToken != NULL:
 *       self.OnRtnCFMMCTradingAccountToken(None if pCFMMCTradingAccountToken is NULL else py_ApiStructure.CFMMCTradingAccountTokenField.from_address(<size_t> pCFMMCTradingAccountToken))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnCFMMCTradingAccountToken', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnCFMMCTradingAccountToken); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3673, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pCFMMCTradingAccountToken == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3673, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_CFMMCTradingAccountTokenField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3673, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3673, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pCFMMCTradingAccountToken)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3673, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3673, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3673, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3673, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3673, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3673, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3673, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3673, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3673, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3673, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3673, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3672
 * 
 *   try:
 *     if pCFMMCTradingAccountToken != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnCFMMCTradingAccountToken(None if pCFMMCTradingAccountToken is NULL else py_ApiStructure.CFMMCTradingAccountTokenField.from_address(<size_t> pCFMMCTradingAccountToken))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":3671
 *     , CThostFtdcCFMMCTradingAccountTokenField *pCFMMCTradingAccountToken) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pCFMMCTradingAccountToken != NULL:
 *       self.OnRtnCFMMCTradingAccountToken(None if pCFMMCTradingAccountToken is NULL else py_ApiStructure.CFMMCTradingAccountTokenField.from_address(<size_t> pCFMMCTradingAccountToken))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3674
 *     if pCFMMCTradingAccountToken != NULL:
 *       self.OnRtnCFMMCTradingAccountToken(None if pCFMMCTradingAccountToken is NULL else py_ApiStructure.CFMMCTradingAccountTokenField.from_address(<size_t> pCFMMCTradingAccountToken))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnCFMMCTradingAccountToken', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnCFMMCTradingAccountToken", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 3674, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3675
 *       self.OnRtnCFMMCTradingAccountToken(None if pCFMMCTradingAccountToken is NULL else py_ApiStructure.CFMMCTradingAccountTokenField.from_address(<size_t> pCFMMCTradingAccountToken))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnCFMMCTradingAccountToken', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3675, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3675, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3675, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3675, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3675, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__178, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3675, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":3674
 *     if pCFMMCTradingAccountToken != NULL:
 *       self.OnRtnCFMMCTradingAccountToken(None if pCFMMCTradingAccountToken is NULL else py_ApiStructure.CFMMCTradingAccountTokenField.from_address(<size_t> pCFMMCTradingAccountToken))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnCFMMCTradingAccountToken', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3671
 *     , CThostFtdcCFMMCTradingAccountTokenField *pCFMMCTradingAccountToken) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pCFMMCTradingAccountToken != NULL:
 *       self.OnRtnCFMMCTradingAccountToken(None if pCFMMCTradingAccountToken is NULL else py_ApiStructure.CFMMCTradingAccountTokenField.from_address(<size_t> pCFMMCTradingAccountToken))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3677
 *       myEnv.logger.error('OnRtnCFMMCTradingAccountToken', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3668
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnCFMMCTradingAccountToken(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcCFMMCTradingAccountTokenField *pCFMMCTradingAccountToken) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnCFMMCTradingAccountToken", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3683
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnBatchOrderAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcBatchOrderActionField *pBatchOrderAction
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

int TraderSpi_OnErrRtnBatchOrderAction(PyObject *__pyx_v_self, struct CThostFtdcBatchOrderActionField *__pyx_v_pBatchOrderAction, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnErrRtnBatchOrderAction", 0);

  /* "ptp/TraderApi.pyx":3687
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pBatchOrderAction != NULL:
 *       self.OnErrRtnBatchOrderAction(None if pBatchOrderAction is NULL else py_ApiStructure.BatchOrderActionField.from_address(<size_t> pBatchOrderAction)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3688
 * 
 *   try:
 *     if pBatchOrderAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnBatchOrderAction(None if pBatchOrderAction is NULL else py_ApiStructure.BatchOrderActionField.from_address(<size_t> pBatchOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      __pyx_t_4 = ((__pyx_v_pBatchOrderAction != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3689
 *   try:
 *     if pBatchOrderAction != NULL:
 *       self.OnErrRtnBatchOrderAction(None if pBatchOrderAction is NULL else py_ApiStructure.BatchOrderActionField.from_address(<size_t> pBatchOrderAction)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnErrRtnBatchOrderAction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3689, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pBatchOrderAction == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3689, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_BatchOrderActionField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3689, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3689, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pBatchOrderAction)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3689, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3689, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3689, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3689, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3689, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3689, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3690
 *     if pBatchOrderAction != NULL:
 *       self.OnErrRtnBatchOrderAction(None if pBatchOrderAction is NULL else py_ApiStructure.BatchOrderActionField.from_address(<size_t> pBatchOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnBatchOrderAction', exc_info=True)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3690, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3690, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3690, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3690, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3690, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3690, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3690, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3690, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3690, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }
        __pyx_t_9 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3689, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3689, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3689, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_9) {
            __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_14, __pyx_t_8);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3689, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3688
 * 
 *   try:
 *     if pBatchOrderAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnBatchOrderAction(None if pBatchOrderAction is NULL else py_ApiStructure.BatchOrderActionField.from_address(<size_t> pBatchOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      }

      /* "ptp/TraderApi.pyx":3687
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pBatchOrderAction != NULL:
 *       self.OnErrRtnBatchOrderAction(None if pBatchOrderAction is NULL else py_ApiStructure.BatchOrderActionField.from_address(<size_t> pBatchOrderAction)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3691
 *       self.OnErrRtnBatchOrderAction(None if pBatchOrderAction is NULL else py_ApiStructure.BatchOrderActionField.from_address(<size_t> pBatchOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnBatchOrderAction', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnBatchOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_12) < 0) __PYX_ERR(0, 3691, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3692
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnBatchOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3692, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3692, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3692, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3692, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3692, __pyx_L15_error)
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__179, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3692, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }

      /* "ptp/TraderApi.pyx":3691
 *       self.OnErrRtnBatchOrderAction(None if pBatchOrderAction is NULL else py_ApiStructure.BatchOrderActionField.from_address(<size_t> pBatchOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnBatchOrderAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3687
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pBatchOrderAction != NULL:
 *       self.OnErrRtnBatchOrderAction(None if pBatchOrderAction is NULL else py_ApiStructure.BatchOrderActionField.from_address(<size_t> pBatchOrderAction)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3694
 *       myEnv.logger.error('OnErrRtnBatchOrderAction', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3683
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnBatchOrderAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcBatchOrderActionField *pBatchOrderAction
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnBatchOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3700
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnOptionSelfClose(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcOptionSelfCloseField *pOptionSelfClose) except -1:
 * 
 */

int TraderSpi_OnRtnOptionSelfClose(PyObject *__pyx_v_self, struct CThostFtdcOptionSelfCloseField *__pyx_v_pOptionSelfClose) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnOptionSelfClose", 0);

  /* "ptp/TraderApi.pyx":3703
 *     , CThostFtdcOptionSelfCloseField *pOptionSelfClose) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOptionSelfClose != NULL:
 *       self.OnRtnOptionSelfClose(None if pOptionSelfClose is NULL else py_ApiStructure.OptionSelfCloseField.from_address(<size_t> pOptionSelfClose))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3704
 * 
 *   try:
 *     if pOptionSelfClose != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnOptionSelfClose(None if pOptionSelfClose is NULL else py_ApiStructure.OptionSelfCloseField.from_address(<size_t> pOptionSelfClose))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pOptionSelfClose != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3705
 *   try:
 *     if pOptionSelfClose != NULL:
 *       self.OnRtnOptionSelfClose(None if pOptionSelfClose is NULL else py_ApiStructure.OptionSelfCloseField.from_address(<size_t> pOptionSelfClose))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnOptionSelfClose', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnOptionSelfClose); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3705, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pOptionSelfClose == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3705, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_OptionSelfCloseField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3705, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3705, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pOptionSelfClose)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3705, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3705, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3705, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3705, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3705, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3705, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3705, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3705, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3705, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3705, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3705, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3704
 * 
 *   try:
 *     if pOptionSelfClose != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnOptionSelfClose(None if pOptionSelfClose is NULL else py_ApiStructure.OptionSelfCloseField.from_address(<size_t> pOptionSelfClose))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":3703
 *     , CThostFtdcOptionSelfCloseField *pOptionSelfClose) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOptionSelfClose != NULL:
 *       self.OnRtnOptionSelfClose(None if pOptionSelfClose is NULL else py_ApiStructure.OptionSelfCloseField.from_address(<size_t> pOptionSelfClose))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3706
 *     if pOptionSelfClose != NULL:
 *       self.OnRtnOptionSelfClose(None if pOptionSelfClose is NULL else py_ApiStructure.OptionSelfCloseField.from_address(<size_t> pOptionSelfClose))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnOptionSelfClose', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnOptionSelfClose", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 3706, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3707
 *       self.OnRtnOptionSelfClose(None if pOptionSelfClose is NULL else py_ApiStructure.OptionSelfCloseField.from_address(<size_t> pOptionSelfClose))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnOptionSelfClose', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3707, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3707, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3707, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3707, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3707, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__180, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3707, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":3706
 *     if pOptionSelfClose != NULL:
 *       self.OnRtnOptionSelfClose(None if pOptionSelfClose is NULL else py_ApiStructure.OptionSelfCloseField.from_address(<size_t> pOptionSelfClose))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnOptionSelfClose', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3703
 *     , CThostFtdcOptionSelfCloseField *pOptionSelfClose) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOptionSelfClose != NULL:
 *       self.OnRtnOptionSelfClose(None if pOptionSelfClose is NULL else py_ApiStructure.OptionSelfCloseField.from_address(<size_t> pOptionSelfClose))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3709
 *       myEnv.logger.error('OnRtnOptionSelfClose', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3700
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnOptionSelfClose(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcOptionSelfCloseField *pOptionSelfClose) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnOptionSelfClose", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3715
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnOptionSelfCloseInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputOptionSelfCloseField *pInputOptionSelfClose
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

int TraderSpi_OnErrRtnOptionSelfCloseInsert(PyObject *__pyx_v_self, struct CThostFtdcInputOptionSelfCloseField *__pyx_v_pInputOptionSelfClose, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnErrRtnOptionSelfCloseInsert", 0);

  /* "ptp/TraderApi.pyx":3719
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputOptionSelfClose != NULL:
 *       self.OnErrRtnOptionSelfCloseInsert(None if pInputOptionSelfClose is NULL else py_ApiStructure.InputOptionSelfCloseField.from_address(<size_t> pInputOptionSelfClose)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3720
 * 
 *   try:
 *     if pInputOptionSelfClose != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnOptionSelfCloseInsert(None if pInputOptionSelfClose is NULL else py_ApiStructure.InputOptionSelfCloseField.from_address(<size_t> pInputOptionSelfClose)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      __pyx_t_4 = ((__pyx_v_pInputOptionSelfClose != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3721
 *   try:
 *     if pInputOptionSelfClose != NULL:
 *       self.OnErrRtnOptionSelfCloseInsert(None if pInputOptionSelfClose is NULL else py_ApiStructure.InputOptionSelfCloseField.from_address(<size_t> pInputOptionSelfClose)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnErrRtnOptionSelfCloseInsert); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3721, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInputOptionSelfClose == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3721, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InputOptionSelfCloseField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3721, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3721, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInputOptionSelfClose)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3721, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3721, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3721, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3721, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3721, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3721, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3722
 *     if pInputOptionSelfClose != NULL:
 *       self.OnErrRtnOptionSelfCloseInsert(None if pInputOptionSelfClose is NULL else py_ApiStructure.InputOptionSelfCloseField.from_address(<size_t> pInputOptionSelfClose)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnOptionSelfCloseInsert', exc_info=True)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3722, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3722, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3722, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3722, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3722, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3722, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3722, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3722, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3722, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }
        __pyx_t_9 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3721, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3721, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3721, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_9) {
            __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_14, __pyx_t_8);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3721, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3720
 * 
 *   try:
 *     if pInputOptionSelfClose != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnOptionSelfCloseInsert(None if pInputOptionSelfClose is NULL else py_ApiStructure.InputOptionSelfCloseField.from_address(<size_t> pInputOptionSelfClose)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      }

      /* "ptp/TraderApi.pyx":3719
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputOptionSelfClose != NULL:
 *       self.OnErrRtnOptionSelfCloseInsert(None if pInputOptionSelfClose is NULL else py_ApiStructure.InputOptionSelfCloseField.from_address(<size_t> pInputOptionSelfClose)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3723
 *       self.OnErrRtnOptionSelfCloseInsert(None if pInputOptionSelfClose is NULL else py_ApiStructure.InputOptionSelfCloseField.from_address(<size_t> pInputOptionSelfClose)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnOptionSelfCloseInsert', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnOptionSelfCloseInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_12) < 0) __PYX_ERR(0, 3723, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3724
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnOptionSelfCloseInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3724, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3724, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3724, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3724, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3724, __pyx_L15_error)
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__181, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3724, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }

      /* "ptp/TraderApi.pyx":3723
 *       self.OnErrRtnOptionSelfCloseInsert(None if pInputOptionSelfClose is NULL else py_ApiStructure.InputOptionSelfCloseField.from_address(<size_t> pInputOptionSelfClose)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnOptionSelfCloseInsert', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3719
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputOptionSelfClose != NULL:
 *       self.OnErrRtnOptionSelfCloseInsert(None if pInputOptionSelfClose is NULL else py_ApiStructure.InputOptionSelfCloseField.from_address(<size_t> pInputOptionSelfClose)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3726
 *       myEnv.logger.error('OnErrRtnOptionSelfCloseInsert', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3715
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnOptionSelfCloseInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputOptionSelfCloseField *pInputOptionSelfClose
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnOptionSelfCloseInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3732
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnOptionSelfCloseAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcOptionSelfCloseActionField *pOptionSelfCloseAction
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

int TraderSpi_OnErrRtnOptionSelfCloseAction(PyObject *__pyx_v_self, struct CThostFtdcOptionSelfCloseActionField *__pyx_v_pOptionSelfCloseAction, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnErrRtnOptionSelfCloseAction", 0);

  /* "ptp/TraderApi.pyx":3736
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOptionSelfCloseAction != NULL:
 *       self.OnErrRtnOptionSelfCloseAction(None if pOptionSelfCloseAction is NULL else py_ApiStructure.OptionSelfCloseActionField.from_address(<size_t> pOptionSelfCloseAction)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3737
 * 
 *   try:
 *     if pOptionSelfCloseAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnOptionSelfCloseAction(None if pOptionSelfCloseAction is NULL else py_ApiStructure.OptionSelfCloseActionField.from_address(<size_t> pOptionSelfCloseAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      __pyx_t_4 = ((__pyx_v_pOptionSelfCloseAction != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3738
 *   try:
 *     if pOptionSelfCloseAction != NULL:
 *       self.OnErrRtnOptionSelfCloseAction(None if pOptionSelfCloseAction is NULL else py_ApiStructure.OptionSelfCloseActionField.from_address(<size_t> pOptionSelfCloseAction)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnErrRtnOptionSelfCloseAction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3738, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pOptionSelfCloseAction == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3738, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_OptionSelfCloseActionField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3738, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3738, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pOptionSelfCloseAction)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3738, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3738, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3738, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3738, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3738, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3738, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3739
 *     if pOptionSelfCloseAction != NULL:
 *       self.OnErrRtnOptionSelfCloseAction(None if pOptionSelfCloseAction is NULL else py_ApiStructure.OptionSelfCloseActionField.from_address(<size_t> pOptionSelfCloseAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnOptionSelfCloseAction', exc_info=True)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3739, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3739, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3739, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3739, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3739, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3739, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3739, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3739, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3739, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }
        __pyx_t_9 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3738, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3738, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3738, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_9) {
            __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_14, __pyx_t_8);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3738, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3737
 * 
 *   try:
 *     if pOptionSelfCloseAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnOptionSelfCloseAction(None if pOptionSelfCloseAction is NULL else py_ApiStructure.OptionSelfCloseActionField.from_address(<size_t> pOptionSelfCloseAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      }

      /* "ptp/TraderApi.pyx":3736
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOptionSelfCloseAction != NULL:
 *       self.OnErrRtnOptionSelfCloseAction(None if pOptionSelfCloseAction is NULL else py_ApiStructure.OptionSelfCloseActionField.from_address(<size_t> pOptionSelfCloseAction)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3740
 *       self.OnErrRtnOptionSelfCloseAction(None if pOptionSelfCloseAction is NULL else py_ApiStructure.OptionSelfCloseActionField.from_address(<size_t> pOptionSelfCloseAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnOptionSelfCloseAction', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnOptionSelfCloseAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_12) < 0) __PYX_ERR(0, 3740, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3741
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnOptionSelfCloseAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3741, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3741, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3741, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3741, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3741, __pyx_L15_error)
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__182, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3741, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }

      /* "ptp/TraderApi.pyx":3740
 *       self.OnErrRtnOptionSelfCloseAction(None if pOptionSelfCloseAction is NULL else py_ApiStructure.OptionSelfCloseActionField.from_address(<size_t> pOptionSelfCloseAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnOptionSelfCloseAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3736
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOptionSelfCloseAction != NULL:
 *       self.OnErrRtnOptionSelfCloseAction(None if pOptionSelfCloseAction is NULL else py_ApiStructure.OptionSelfCloseActionField.from_address(<size_t> pOptionSelfCloseAction)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3743
 *       myEnv.logger.error('OnErrRtnOptionSelfCloseAction', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3732
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnOptionSelfCloseAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcOptionSelfCloseActionField *pOptionSelfCloseAction
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnOptionSelfCloseAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3749
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnCombAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcCombActionField *pCombAction) except -1:
 * 
 */

int TraderSpi_OnRtnCombAction(PyObject *__pyx_v_self, struct CThostFtdcCombActionField *__pyx_v_pCombAction) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnCombAction", 0);

  /* "ptp/TraderApi.pyx":3752
 *     , CThostFtdcCombActionField *pCombAction) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pCombAction != NULL:
 *       self.OnRtnCombAction(None if pCombAction is NULL else py_ApiStructure.CombActionField.from_address(<size_t> pCombAction))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3753
 * 
 *   try:
 *     if pCombAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnCombAction(None if pCombAction is NULL else py_ApiStructure.CombActionField.from_address(<size_t> pCombAction))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pCombAction != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3754
 *   try:
 *     if pCombAction != NULL:
 *       self.OnRtnCombAction(None if pCombAction is NULL else py_ApiStructure.CombActionField.from_address(<size_t> pCombAction))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnCombAction', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnCombAction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3754, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pCombAction == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3754, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_CombActionField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3754, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3754, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pCombAction)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3754, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3754, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3754, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3754, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3754, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3754, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3754, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3754, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3754, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3754, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3754, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3753
 * 
 *   try:
 *     if pCombAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnCombAction(None if pCombAction is NULL else py_ApiStructure.CombActionField.from_address(<size_t> pCombAction))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":3752
 *     , CThostFtdcCombActionField *pCombAction) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pCombAction != NULL:
 *       self.OnRtnCombAction(None if pCombAction is NULL else py_ApiStructure.CombActionField.from_address(<size_t> pCombAction))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3755
 *     if pCombAction != NULL:
 *       self.OnRtnCombAction(None if pCombAction is NULL else py_ApiStructure.CombActionField.from_address(<size_t> pCombAction))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnCombAction', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnCombAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 3755, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3756
 *       self.OnRtnCombAction(None if pCombAction is NULL else py_ApiStructure.CombActionField.from_address(<size_t> pCombAction))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnCombAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3756, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3756, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3756, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3756, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3756, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__183, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3756, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":3755
 *     if pCombAction != NULL:
 *       self.OnRtnCombAction(None if pCombAction is NULL else py_ApiStructure.CombActionField.from_address(<size_t> pCombAction))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnCombAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3752
 *     , CThostFtdcCombActionField *pCombAction) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pCombAction != NULL:
 *       self.OnRtnCombAction(None if pCombAction is NULL else py_ApiStructure.CombActionField.from_address(<size_t> pCombAction))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3758
 *       myEnv.logger.error('OnRtnCombAction', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3749
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnCombAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcCombActionField *pCombAction) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnCombAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3764
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnCombActionInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputCombActionField *pInputCombAction
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

int TraderSpi_OnErrRtnCombActionInsert(PyObject *__pyx_v_self, struct CThostFtdcInputCombActionField *__pyx_v_pInputCombAction, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnErrRtnCombActionInsert", 0);

  /* "ptp/TraderApi.pyx":3768
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputCombAction != NULL:
 *       self.OnErrRtnCombActionInsert(None if pInputCombAction is NULL else py_ApiStructure.InputCombActionField.from_address(<size_t> pInputCombAction)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3769
 * 
 *   try:
 *     if pInputCombAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnCombActionInsert(None if pInputCombAction is NULL else py_ApiStructure.InputCombActionField.from_address(<size_t> pInputCombAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      __pyx_t_4 = ((__pyx_v_pInputCombAction != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3770
 *   try:
 *     if pInputCombAction != NULL:
 *       self.OnErrRtnCombActionInsert(None if pInputCombAction is NULL else py_ApiStructure.InputCombActionField.from_address(<size_t> pInputCombAction)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnErrRtnCombActionInsert); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3770, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pInputCombAction == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3770, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InputCombActionField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3770, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3770, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pInputCombAction)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3770, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3770, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3770, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3770, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3770, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3770, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3771
 *     if pInputCombAction != NULL:
 *       self.OnErrRtnCombActionInsert(None if pInputCombAction is NULL else py_ApiStructure.InputCombActionField.from_address(<size_t> pInputCombAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnCombActionInsert', exc_info=True)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3771, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3771, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3771, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3771, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3771, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3771, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3771, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3771, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3771, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }
        __pyx_t_9 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3770, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3770, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3770, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_9) {
            __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_14, __pyx_t_8);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3770, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3769
 * 
 *   try:
 *     if pInputCombAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnCombActionInsert(None if pInputCombAction is NULL else py_ApiStructure.InputCombActionField.from_address(<size_t> pInputCombAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      }

      /* "ptp/TraderApi.pyx":3768
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputCombAction != NULL:
 *       self.OnErrRtnCombActionInsert(None if pInputCombAction is NULL else py_ApiStructure.InputCombActionField.from_address(<size_t> pInputCombAction)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3772
 *       self.OnErrRtnCombActionInsert(None if pInputCombAction is NULL else py_ApiStructure.InputCombActionField.from_address(<size_t> pInputCombAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnCombActionInsert', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnCombActionInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_12) < 0) __PYX_ERR(0, 3772, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3773
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnCombActionInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3773, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3773, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3773, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3773, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3773, __pyx_L15_error)
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__184, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3773, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }

      /* "ptp/TraderApi.pyx":3772
 *       self.OnErrRtnCombActionInsert(None if pInputCombAction is NULL else py_ApiStructure.InputCombActionField.from_address(<size_t> pInputCombAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnCombActionInsert', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3768
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pInputCombAction != NULL:
 *       self.OnErrRtnCombActionInsert(None if pInputCombAction is NULL else py_ApiStructure.InputCombActionField.from_address(<size_t> pInputCombAction)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3775
 *       myEnv.logger.error('OnErrRtnCombActionInsert', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3764
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnCombActionInsert(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcInputCombActionField *pInputCombAction
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnCombActionInsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3781
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryContractBank(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcContractBankField *pContractBank
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryContractBank(PyObject *__pyx_v_self, struct CThostFtdcContractBankField *__pyx_v_pContractBank, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryContractBank", 0);

  /* "ptp/TraderApi.pyx":3787
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pContractBank != NULL:
 *       self.OnRspQryContractBank(None if pContractBank is NULL else py_ApiStructure.ContractBankField.from_address(<size_t> pContractBank)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3788
 * 
 *   try:
 *     if pContractBank != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryContractBank(None if pContractBank is NULL else py_ApiStructure.ContractBankField.from_address(<size_t> pContractBank)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pContractBank != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3789
 *   try:
 *     if pContractBank != NULL:
 *       self.OnRspQryContractBank(None if pContractBank is NULL else py_ApiStructure.ContractBankField.from_address(<size_t> pContractBank)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryContractBank); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3789, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pContractBank == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3789, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ContractBankField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3789, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3789, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pContractBank)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3789, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3789, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3789, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3789, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3789, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3789, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3790
 *     if pContractBank != NULL:
 *       self.OnRspQryContractBank(None if pContractBank is NULL else py_ApiStructure.ContractBankField.from_address(<size_t> pContractBank)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3790, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3790, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3790, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3790, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3790, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3790, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3790, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3790, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3790, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3792
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryContractBank', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3792, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3792, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3789, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3789, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3789, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3789, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3788
 * 
 *   try:
 *     if pContractBank != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryContractBank(None if pContractBank is NULL else py_ApiStructure.ContractBankField.from_address(<size_t> pContractBank)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3787
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pContractBank != NULL:
 *       self.OnRspQryContractBank(None if pContractBank is NULL else py_ApiStructure.ContractBankField.from_address(<size_t> pContractBank)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3793
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryContractBank', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryContractBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3793, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3794
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryContractBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3794, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3794, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3794, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3794, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3794, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__185, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3794, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3793
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryContractBank', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3787
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pContractBank != NULL:
 *       self.OnRspQryContractBank(None if pContractBank is NULL else py_ApiStructure.ContractBankField.from_address(<size_t> pContractBank)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3796
 *       myEnv.logger.error('OnRspQryContractBank', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3781
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryContractBank(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcContractBankField *pContractBank
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryContractBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3802
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryParkedOrder(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcParkedOrderField *pParkedOrder
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryParkedOrder(PyObject *__pyx_v_self, struct CThostFtdcParkedOrderField *__pyx_v_pParkedOrder, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryParkedOrder", 0);

  /* "ptp/TraderApi.pyx":3808
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pParkedOrder != NULL:
 *       self.OnRspQryParkedOrder(None if pParkedOrder is NULL else py_ApiStructure.ParkedOrderField.from_address(<size_t> pParkedOrder)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3809
 * 
 *   try:
 *     if pParkedOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryParkedOrder(None if pParkedOrder is NULL else py_ApiStructure.ParkedOrderField.from_address(<size_t> pParkedOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pParkedOrder != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3810
 *   try:
 *     if pParkedOrder != NULL:
 *       self.OnRspQryParkedOrder(None if pParkedOrder is NULL else py_ApiStructure.ParkedOrderField.from_address(<size_t> pParkedOrder)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryParkedOrder); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3810, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pParkedOrder == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3810, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ParkedOrderField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3810, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3810, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pParkedOrder)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3810, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3810, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3810, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3810, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3810, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3810, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3811
 *     if pParkedOrder != NULL:
 *       self.OnRspQryParkedOrder(None if pParkedOrder is NULL else py_ApiStructure.ParkedOrderField.from_address(<size_t> pParkedOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3811, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3811, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3811, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3811, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3811, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3811, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3811, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3811, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3811, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3813
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryParkedOrder', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3813, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3813, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3810, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3810, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3810, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3810, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3809
 * 
 *   try:
 *     if pParkedOrder != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryParkedOrder(None if pParkedOrder is NULL else py_ApiStructure.ParkedOrderField.from_address(<size_t> pParkedOrder)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3808
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pParkedOrder != NULL:
 *       self.OnRspQryParkedOrder(None if pParkedOrder is NULL else py_ApiStructure.ParkedOrderField.from_address(<size_t> pParkedOrder)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3814
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryParkedOrder', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryParkedOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3814, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3815
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryParkedOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3815, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3815, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3815, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3815, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3815, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__186, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3815, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3814
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryParkedOrder', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3808
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pParkedOrder != NULL:
 *       self.OnRspQryParkedOrder(None if pParkedOrder is NULL else py_ApiStructure.ParkedOrderField.from_address(<size_t> pParkedOrder)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3817
 *       myEnv.logger.error('OnRspQryParkedOrder', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3802
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryParkedOrder(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcParkedOrderField *pParkedOrder
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryParkedOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3823
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryParkedOrderAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcParkedOrderActionField *pParkedOrderAction
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryParkedOrderAction(PyObject *__pyx_v_self, struct CThostFtdcParkedOrderActionField *__pyx_v_pParkedOrderAction, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryParkedOrderAction", 0);

  /* "ptp/TraderApi.pyx":3829
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pParkedOrderAction != NULL:
 *       self.OnRspQryParkedOrderAction(None if pParkedOrderAction is NULL else py_ApiStructure.ParkedOrderActionField.from_address(<size_t> pParkedOrderAction)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3830
 * 
 *   try:
 *     if pParkedOrderAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryParkedOrderAction(None if pParkedOrderAction is NULL else py_ApiStructure.ParkedOrderActionField.from_address(<size_t> pParkedOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pParkedOrderAction != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3831
 *   try:
 *     if pParkedOrderAction != NULL:
 *       self.OnRspQryParkedOrderAction(None if pParkedOrderAction is NULL else py_ApiStructure.ParkedOrderActionField.from_address(<size_t> pParkedOrderAction)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryParkedOrderAction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3831, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pParkedOrderAction == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3831, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ParkedOrderActionField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3831, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3831, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pParkedOrderAction)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3831, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3831, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3831, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3831, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3831, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3831, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3832
 *     if pParkedOrderAction != NULL:
 *       self.OnRspQryParkedOrderAction(None if pParkedOrderAction is NULL else py_ApiStructure.ParkedOrderActionField.from_address(<size_t> pParkedOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3832, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3832, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3832, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3832, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3832, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3832, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3832, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3832, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3832, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3834
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryParkedOrderAction', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3834, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3834, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3831, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3831, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3831, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3831, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3830
 * 
 *   try:
 *     if pParkedOrderAction != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryParkedOrderAction(None if pParkedOrderAction is NULL else py_ApiStructure.ParkedOrderActionField.from_address(<size_t> pParkedOrderAction)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3829
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pParkedOrderAction != NULL:
 *       self.OnRspQryParkedOrderAction(None if pParkedOrderAction is NULL else py_ApiStructure.ParkedOrderActionField.from_address(<size_t> pParkedOrderAction)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3835
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryParkedOrderAction', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryParkedOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3835, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3836
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryParkedOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3836, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3836, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3836, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3836, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3836, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__187, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3836, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3835
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryParkedOrderAction', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3829
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pParkedOrderAction != NULL:
 *       self.OnRspQryParkedOrderAction(None if pParkedOrderAction is NULL else py_ApiStructure.ParkedOrderActionField.from_address(<size_t> pParkedOrderAction)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3838
 *       myEnv.logger.error('OnRspQryParkedOrderAction', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3823
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryParkedOrderAction(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcParkedOrderActionField *pParkedOrderAction
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryParkedOrderAction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3844
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryTradingNotice(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcTradingNoticeField *pTradingNotice
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryTradingNotice(PyObject *__pyx_v_self, struct CThostFtdcTradingNoticeField *__pyx_v_pTradingNotice, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryTradingNotice", 0);

  /* "ptp/TraderApi.pyx":3850
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTradingNotice != NULL:
 *       self.OnRspQryTradingNotice(None if pTradingNotice is NULL else py_ApiStructure.TradingNoticeField.from_address(<size_t> pTradingNotice)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3851
 * 
 *   try:
 *     if pTradingNotice != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryTradingNotice(None if pTradingNotice is NULL else py_ApiStructure.TradingNoticeField.from_address(<size_t> pTradingNotice)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pTradingNotice != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3852
 *   try:
 *     if pTradingNotice != NULL:
 *       self.OnRspQryTradingNotice(None if pTradingNotice is NULL else py_ApiStructure.TradingNoticeField.from_address(<size_t> pTradingNotice)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryTradingNotice); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3852, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pTradingNotice == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3852, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_TradingNoticeField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3852, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3852, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pTradingNotice)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3852, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3852, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3852, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3852, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3852, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3852, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3853
 *     if pTradingNotice != NULL:
 *       self.OnRspQryTradingNotice(None if pTradingNotice is NULL else py_ApiStructure.TradingNoticeField.from_address(<size_t> pTradingNotice)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3853, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3853, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3853, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3853, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3853, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3853, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3853, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3853, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3853, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3855
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryTradingNotice', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3855, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3855, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3852, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3852, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3852, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3852, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3851
 * 
 *   try:
 *     if pTradingNotice != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryTradingNotice(None if pTradingNotice is NULL else py_ApiStructure.TradingNoticeField.from_address(<size_t> pTradingNotice)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3850
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTradingNotice != NULL:
 *       self.OnRspQryTradingNotice(None if pTradingNotice is NULL else py_ApiStructure.TradingNoticeField.from_address(<size_t> pTradingNotice)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3856
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryTradingNotice', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryTradingNotice", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3856, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3857
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryTradingNotice', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3857, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3857, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3857, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3857, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3857, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__188, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3857, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3856
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryTradingNotice', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3850
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pTradingNotice != NULL:
 *       self.OnRspQryTradingNotice(None if pTradingNotice is NULL else py_ApiStructure.TradingNoticeField.from_address(<size_t> pTradingNotice)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3859
 *       myEnv.logger.error('OnRspQryTradingNotice', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3844
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryTradingNotice(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcTradingNoticeField *pTradingNotice
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryTradingNotice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3865
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryBrokerTradingParams(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcBrokerTradingParamsField *pBrokerTradingParams
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryBrokerTradingParams(PyObject *__pyx_v_self, struct CThostFtdcBrokerTradingParamsField *__pyx_v_pBrokerTradingParams, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryBrokerTradingParams", 0);

  /* "ptp/TraderApi.pyx":3871
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pBrokerTradingParams != NULL:
 *       self.OnRspQryBrokerTradingParams(None if pBrokerTradingParams is NULL else py_ApiStructure.BrokerTradingParamsField.from_address(<size_t> pBrokerTradingParams)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3872
 * 
 *   try:
 *     if pBrokerTradingParams != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryBrokerTradingParams(None if pBrokerTradingParams is NULL else py_ApiStructure.BrokerTradingParamsField.from_address(<size_t> pBrokerTradingParams)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pBrokerTradingParams != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3873
 *   try:
 *     if pBrokerTradingParams != NULL:
 *       self.OnRspQryBrokerTradingParams(None if pBrokerTradingParams is NULL else py_ApiStructure.BrokerTradingParamsField.from_address(<size_t> pBrokerTradingParams)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryBrokerTradingParams); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3873, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pBrokerTradingParams == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3873, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_BrokerTradingParamsField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3873, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3873, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pBrokerTradingParams)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3873, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3873, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3873, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3873, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3873, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3873, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3874
 *     if pBrokerTradingParams != NULL:
 *       self.OnRspQryBrokerTradingParams(None if pBrokerTradingParams is NULL else py_ApiStructure.BrokerTradingParamsField.from_address(<size_t> pBrokerTradingParams)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3874, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3874, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3874, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3874, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3874, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3874, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3874, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3874, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3874, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3876
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryBrokerTradingParams', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3876, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3876, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3873, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3873, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3873, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3873, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3872
 * 
 *   try:
 *     if pBrokerTradingParams != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryBrokerTradingParams(None if pBrokerTradingParams is NULL else py_ApiStructure.BrokerTradingParamsField.from_address(<size_t> pBrokerTradingParams)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3871
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pBrokerTradingParams != NULL:
 *       self.OnRspQryBrokerTradingParams(None if pBrokerTradingParams is NULL else py_ApiStructure.BrokerTradingParamsField.from_address(<size_t> pBrokerTradingParams)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3877
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryBrokerTradingParams', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryBrokerTradingParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3877, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3878
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryBrokerTradingParams', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3878, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3878, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3878, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3878, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3878, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__189, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3878, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3877
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryBrokerTradingParams', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3871
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pBrokerTradingParams != NULL:
 *       self.OnRspQryBrokerTradingParams(None if pBrokerTradingParams is NULL else py_ApiStructure.BrokerTradingParamsField.from_address(<size_t> pBrokerTradingParams)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3880
 *       myEnv.logger.error('OnRspQryBrokerTradingParams', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3865
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryBrokerTradingParams(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcBrokerTradingParamsField *pBrokerTradingParams
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryBrokerTradingParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3886
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryBrokerTradingAlgos(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcBrokerTradingAlgosField *pBrokerTradingAlgos
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQryBrokerTradingAlgos(PyObject *__pyx_v_self, struct CThostFtdcBrokerTradingAlgosField *__pyx_v_pBrokerTradingAlgos, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQryBrokerTradingAlgos", 0);

  /* "ptp/TraderApi.pyx":3892
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pBrokerTradingAlgos != NULL:
 *       self.OnRspQryBrokerTradingAlgos(None if pBrokerTradingAlgos is NULL else py_ApiStructure.BrokerTradingAlgosField.from_address(<size_t> pBrokerTradingAlgos)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3893
 * 
 *   try:
 *     if pBrokerTradingAlgos != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryBrokerTradingAlgos(None if pBrokerTradingAlgos is NULL else py_ApiStructure.BrokerTradingAlgosField.from_address(<size_t> pBrokerTradingAlgos)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pBrokerTradingAlgos != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3894
 *   try:
 *     if pBrokerTradingAlgos != NULL:
 *       self.OnRspQryBrokerTradingAlgos(None if pBrokerTradingAlgos is NULL else py_ApiStructure.BrokerTradingAlgosField.from_address(<size_t> pBrokerTradingAlgos)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQryBrokerTradingAlgos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3894, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pBrokerTradingAlgos == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3894, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_BrokerTradingAlgosField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3894, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3894, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pBrokerTradingAlgos)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3894, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3894, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3894, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3894, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3894, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3894, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3895
 *     if pBrokerTradingAlgos != NULL:
 *       self.OnRspQryBrokerTradingAlgos(None if pBrokerTradingAlgos is NULL else py_ApiStructure.BrokerTradingAlgosField.from_address(<size_t> pBrokerTradingAlgos)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3895, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3895, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3895, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3895, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3895, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3895, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3895, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3895, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3895, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3897
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryBrokerTradingAlgos', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3897, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3897, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3894, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3894, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3894, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3894, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3893
 * 
 *   try:
 *     if pBrokerTradingAlgos != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQryBrokerTradingAlgos(None if pBrokerTradingAlgos is NULL else py_ApiStructure.BrokerTradingAlgosField.from_address(<size_t> pBrokerTradingAlgos)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3892
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pBrokerTradingAlgos != NULL:
 *       self.OnRspQryBrokerTradingAlgos(None if pBrokerTradingAlgos is NULL else py_ApiStructure.BrokerTradingAlgosField.from_address(<size_t> pBrokerTradingAlgos)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3898
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryBrokerTradingAlgos', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryBrokerTradingAlgos", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3898, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3899
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryBrokerTradingAlgos', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3899, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3899, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3899, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3899, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3899, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__190, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3899, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3898
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQryBrokerTradingAlgos', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3892
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pBrokerTradingAlgos != NULL:
 *       self.OnRspQryBrokerTradingAlgos(None if pBrokerTradingAlgos is NULL else py_ApiStructure.BrokerTradingAlgosField.from_address(<size_t> pBrokerTradingAlgos)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3901
 *       myEnv.logger.error('OnRspQryBrokerTradingAlgos', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3886
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQryBrokerTradingAlgos(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcBrokerTradingAlgosField *pBrokerTradingAlgos
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQryBrokerTradingAlgos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3907
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQueryCFMMCTradingAccountToken(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQueryCFMMCTradingAccountToken(PyObject *__pyx_v_self, struct CThostFtdcQueryCFMMCTradingAccountTokenField *__pyx_v_pQueryCFMMCTradingAccountToken, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQueryCFMMCTradingAccountToken", 0);

  /* "ptp/TraderApi.pyx":3913
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pQueryCFMMCTradingAccountToken != NULL:
 *       self.OnRspQueryCFMMCTradingAccountToken(None if pQueryCFMMCTradingAccountToken is NULL else py_ApiStructure.QueryCFMMCTradingAccountTokenField.from_address(<size_t> pQueryCFMMCTradingAccountToken)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3914
 * 
 *   try:
 *     if pQueryCFMMCTradingAccountToken != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQueryCFMMCTradingAccountToken(None if pQueryCFMMCTradingAccountToken is NULL else py_ApiStructure.QueryCFMMCTradingAccountTokenField.from_address(<size_t> pQueryCFMMCTradingAccountToken)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pQueryCFMMCTradingAccountToken != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3915
 *   try:
 *     if pQueryCFMMCTradingAccountToken != NULL:
 *       self.OnRspQueryCFMMCTradingAccountToken(None if pQueryCFMMCTradingAccountToken is NULL else py_ApiStructure.QueryCFMMCTradingAccountTokenField.from_address(<size_t> pQueryCFMMCTradingAccountToken)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQueryCFMMCTradingAccountTok); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3915, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pQueryCFMMCTradingAccountToken == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3915, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_QueryCFMMCTradingAccountTokenFie); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3915, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3915, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pQueryCFMMCTradingAccountToken)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3915, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3915, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3915, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3915, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3915, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3915, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":3916
 *     if pQueryCFMMCTradingAccountToken != NULL:
 *       self.OnRspQueryCFMMCTradingAccountToken(None if pQueryCFMMCTradingAccountToken is NULL else py_ApiStructure.QueryCFMMCTradingAccountTokenField.from_address(<size_t> pQueryCFMMCTradingAccountToken)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3916, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3916, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3916, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3916, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3916, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3916, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3916, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3916, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3916, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":3918
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQueryCFMMCTradingAccountToken', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3918, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3918, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3915, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3915, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3915, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3915, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3914
 * 
 *   try:
 *     if pQueryCFMMCTradingAccountToken != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQueryCFMMCTradingAccountToken(None if pQueryCFMMCTradingAccountToken is NULL else py_ApiStructure.QueryCFMMCTradingAccountTokenField.from_address(<size_t> pQueryCFMMCTradingAccountToken)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":3913
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pQueryCFMMCTradingAccountToken != NULL:
 *       self.OnRspQueryCFMMCTradingAccountToken(None if pQueryCFMMCTradingAccountToken is NULL else py_ApiStructure.QueryCFMMCTradingAccountTokenField.from_address(<size_t> pQueryCFMMCTradingAccountToken)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3919
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQueryCFMMCTradingAccountToken', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQueryCFMMCTradingAccountToken", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 3919, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3920
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQueryCFMMCTradingAccountToken', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3920, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3920, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3920, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3920, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3920, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__191, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3920, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":3919
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQueryCFMMCTradingAccountToken', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3913
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pQueryCFMMCTradingAccountToken != NULL:
 *       self.OnRspQueryCFMMCTradingAccountToken(None if pQueryCFMMCTradingAccountToken is NULL else py_ApiStructure.QueryCFMMCTradingAccountTokenField.from_address(<size_t> pQueryCFMMCTradingAccountToken)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3922
 *       myEnv.logger.error('OnRspQueryCFMMCTradingAccountToken', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3907
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQueryCFMMCTradingAccountToken(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQueryCFMMCTradingAccountToken", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3928
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnFromBankToFutureByBank(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspTransferField *pRspTransfer) except -1:
 * 
 */

int TraderSpi_OnRtnFromBankToFutureByBank(PyObject *__pyx_v_self, struct CThostFtdcRspTransferField *__pyx_v_pRspTransfer) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnFromBankToFutureByBank", 0);

  /* "ptp/TraderApi.pyx":3931
 *     , CThostFtdcRspTransferField *pRspTransfer) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromBankToFutureByBank(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3932
 * 
 *   try:
 *     if pRspTransfer != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnFromBankToFutureByBank(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pRspTransfer != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3933
 *   try:
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromBankToFutureByBank(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnFromBankToFutureByBank', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnFromBankToFutureByBank); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3933, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pRspTransfer == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3933, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_RspTransferField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3933, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3933, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspTransfer)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3933, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3933, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3933, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3933, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3933, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3933, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3933, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3933, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3933, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3933, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3933, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3932
 * 
 *   try:
 *     if pRspTransfer != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnFromBankToFutureByBank(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":3931
 *     , CThostFtdcRspTransferField *pRspTransfer) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromBankToFutureByBank(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3934
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromBankToFutureByBank(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnFromBankToFutureByBank', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnFromBankToFutureByBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 3934, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3935
 *       self.OnRtnFromBankToFutureByBank(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnFromBankToFutureByBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3935, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3935, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3935, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3935, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3935, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__192, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3935, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":3934
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromBankToFutureByBank(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnFromBankToFutureByBank', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3931
 *     , CThostFtdcRspTransferField *pRspTransfer) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromBankToFutureByBank(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3937
 *       myEnv.logger.error('OnRtnFromBankToFutureByBank', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3928
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnFromBankToFutureByBank(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspTransferField *pRspTransfer) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnFromBankToFutureByBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3943
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnFromFutureToBankByBank(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspTransferField *pRspTransfer) except -1:
 * 
 */

int TraderSpi_OnRtnFromFutureToBankByBank(PyObject *__pyx_v_self, struct CThostFtdcRspTransferField *__pyx_v_pRspTransfer) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnFromFutureToBankByBank", 0);

  /* "ptp/TraderApi.pyx":3946
 *     , CThostFtdcRspTransferField *pRspTransfer) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromFutureToBankByBank(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3947
 * 
 *   try:
 *     if pRspTransfer != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnFromFutureToBankByBank(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pRspTransfer != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3948
 *   try:
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromFutureToBankByBank(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnFromFutureToBankByBank', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnFromFutureToBankByBank); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3948, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pRspTransfer == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3948, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_RspTransferField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3948, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3948, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspTransfer)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3948, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3948, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3948, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3948, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3948, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3948, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3948, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3948, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3948, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3948, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3948, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3947
 * 
 *   try:
 *     if pRspTransfer != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnFromFutureToBankByBank(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":3946
 *     , CThostFtdcRspTransferField *pRspTransfer) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromFutureToBankByBank(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3949
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromFutureToBankByBank(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnFromFutureToBankByBank', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnFromFutureToBankByBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 3949, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3950
 *       self.OnRtnFromFutureToBankByBank(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnFromFutureToBankByBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3950, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3950, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3950, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3950, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3950, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__193, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3950, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":3949
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromFutureToBankByBank(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnFromFutureToBankByBank', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3946
 *     , CThostFtdcRspTransferField *pRspTransfer) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromFutureToBankByBank(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3952
 *       myEnv.logger.error('OnRtnFromFutureToBankByBank', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3943
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnFromFutureToBankByBank(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspTransferField *pRspTransfer) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnFromFutureToBankByBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3958
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnRepealFromBankToFutureByBank(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 */

int TraderSpi_OnRtnRepealFromBankToFutureByBank(PyObject *__pyx_v_self, struct CThostFtdcRspRepealField *__pyx_v_pRspRepeal) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnRepealFromBankToFutureByBank", 0);

  /* "ptp/TraderApi.pyx":3961
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromBankToFutureByBank(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3962
 * 
 *   try:
 *     if pRspRepeal != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnRepealFromBankToFutureByBank(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pRspRepeal != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3963
 *   try:
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromBankToFutureByBank(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnRepealFromBankToFutureByBank', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnRepealFromBankToFutureByBan); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3963, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pRspRepeal == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3963, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_RspRepealField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3963, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3963, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspRepeal)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3963, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3963, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3963, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3963, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3963, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3963, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3963, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3963, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3963, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3963, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3963, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3962
 * 
 *   try:
 *     if pRspRepeal != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnRepealFromBankToFutureByBank(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":3961
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromBankToFutureByBank(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3964
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromBankToFutureByBank(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnRepealFromBankToFutureByBank', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnRepealFromBankToFutureByBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 3964, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3965
 *       self.OnRtnRepealFromBankToFutureByBank(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnRepealFromBankToFutureByBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3965, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3965, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3965, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3965, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3965, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__194, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3965, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":3964
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromBankToFutureByBank(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnRepealFromBankToFutureByBank', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3961
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromBankToFutureByBank(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3967
 *       myEnv.logger.error('OnRtnRepealFromBankToFutureByBank', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3958
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnRepealFromBankToFutureByBank(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnRepealFromBankToFutureByBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3973
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnRepealFromFutureToBankByBank(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 */

int TraderSpi_OnRtnRepealFromFutureToBankByBank(PyObject *__pyx_v_self, struct CThostFtdcRspRepealField *__pyx_v_pRspRepeal) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnRepealFromFutureToBankByBank", 0);

  /* "ptp/TraderApi.pyx":3976
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromFutureToBankByBank(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3977
 * 
 *   try:
 *     if pRspRepeal != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnRepealFromFutureToBankByBank(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pRspRepeal != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3978
 *   try:
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromFutureToBankByBank(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnRepealFromFutureToBankByBank', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnRepealFromFutureToBankByBan); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3978, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pRspRepeal == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3978, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_RspRepealField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3978, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3978, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspRepeal)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3978, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3978, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3978, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3978, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3978, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3978, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3978, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3978, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3978, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3978, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3978, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3977
 * 
 *   try:
 *     if pRspRepeal != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnRepealFromFutureToBankByBank(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":3976
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromFutureToBankByBank(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3979
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromFutureToBankByBank(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnRepealFromFutureToBankByBank', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnRepealFromFutureToBankByBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 3979, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3980
 *       self.OnRtnRepealFromFutureToBankByBank(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnRepealFromFutureToBankByBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3980, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3980, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3980, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3980, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3980, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__195, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3980, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":3979
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromFutureToBankByBank(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnRepealFromFutureToBankByBank', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3976
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromFutureToBankByBank(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3982
 *       myEnv.logger.error('OnRtnRepealFromFutureToBankByBank', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3973
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnRepealFromFutureToBankByBank(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnRepealFromFutureToBankByBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":3988
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnFromBankToFutureByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspTransferField *pRspTransfer) except -1:
 * 
 */

int TraderSpi_OnRtnFromBankToFutureByFuture(PyObject *__pyx_v_self, struct CThostFtdcRspTransferField *__pyx_v_pRspTransfer) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnFromBankToFutureByFuture", 0);

  /* "ptp/TraderApi.pyx":3991
 *     , CThostFtdcRspTransferField *pRspTransfer) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromBankToFutureByFuture(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":3992
 * 
 *   try:
 *     if pRspTransfer != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnFromBankToFutureByFuture(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pRspTransfer != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":3993
 *   try:
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromBankToFutureByFuture(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnFromBankToFutureByFuture', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnFromBankToFutureByFuture); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3993, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pRspTransfer == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3993, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_RspTransferField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3993, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3993, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspTransfer)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3993, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3993, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3993, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3993, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3993, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3993, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3993, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3993, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3993, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3993, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3993, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":3992
 * 
 *   try:
 *     if pRspTransfer != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnFromBankToFutureByFuture(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":3991
 *     , CThostFtdcRspTransferField *pRspTransfer) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromBankToFutureByFuture(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":3994
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromBankToFutureByFuture(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnFromBankToFutureByFuture', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnFromBankToFutureByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 3994, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":3995
 *       self.OnRtnFromBankToFutureByFuture(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnFromBankToFutureByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3995, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3995, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3995, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3995, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 3995, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__196, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3995, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":3994
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromBankToFutureByFuture(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnFromBankToFutureByFuture', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":3991
 *     , CThostFtdcRspTransferField *pRspTransfer) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromBankToFutureByFuture(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":3997
 *       myEnv.logger.error('OnRtnFromBankToFutureByFuture', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":3988
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnFromBankToFutureByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspTransferField *pRspTransfer) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnFromBankToFutureByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":4003
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnFromFutureToBankByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspTransferField *pRspTransfer) except -1:
 * 
 */

int TraderSpi_OnRtnFromFutureToBankByFuture(PyObject *__pyx_v_self, struct CThostFtdcRspTransferField *__pyx_v_pRspTransfer) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnFromFutureToBankByFuture", 0);

  /* "ptp/TraderApi.pyx":4006
 *     , CThostFtdcRspTransferField *pRspTransfer) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromFutureToBankByFuture(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":4007
 * 
 *   try:
 *     if pRspTransfer != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnFromFutureToBankByFuture(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pRspTransfer != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":4008
 *   try:
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromFutureToBankByFuture(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnFromFutureToBankByFuture', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnFromFutureToBankByFuture); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4008, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pRspTransfer == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4008, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_RspTransferField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4008, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4008, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspTransfer)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4008, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4008, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4008, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4008, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4008, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4008, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4008, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4008, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4008, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4008, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4008, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":4007
 * 
 *   try:
 *     if pRspTransfer != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnFromFutureToBankByFuture(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":4006
 *     , CThostFtdcRspTransferField *pRspTransfer) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromFutureToBankByFuture(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":4009
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromFutureToBankByFuture(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnFromFutureToBankByFuture', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnFromFutureToBankByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 4009, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":4010
 *       self.OnRtnFromFutureToBankByFuture(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnFromFutureToBankByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4010, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4010, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4010, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4010, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 4010, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__197, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4010, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":4009
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromFutureToBankByFuture(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnFromFutureToBankByFuture', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":4006
 *     , CThostFtdcRspTransferField *pRspTransfer) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspTransfer != NULL:
 *       self.OnRtnFromFutureToBankByFuture(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":4012
 *       myEnv.logger.error('OnRtnFromFutureToBankByFuture', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":4003
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnFromFutureToBankByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspTransferField *pRspTransfer) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnFromFutureToBankByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":4018
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnRepealFromBankToFutureByFutureManual(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 */

int TraderSpi_OnRtnRepealFromBankToFutureByFutureManual(PyObject *__pyx_v_self, struct CThostFtdcRspRepealField *__pyx_v_pRspRepeal) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnRepealFromBankToFutureByFutureManual", 0);

  /* "ptp/TraderApi.pyx":4021
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromBankToFutureByFutureManual(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":4022
 * 
 *   try:
 *     if pRspRepeal != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnRepealFromBankToFutureByFutureManual(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pRspRepeal != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":4023
 *   try:
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromBankToFutureByFutureManual(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnRepealFromBankToFutureByFutureManual', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnRepealFromBankToFutureByFut); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4023, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pRspRepeal == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4023, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_RspRepealField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4023, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4023, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspRepeal)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4023, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4023, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4023, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4023, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4023, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4023, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4023, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4023, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4023, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4023, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4023, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":4022
 * 
 *   try:
 *     if pRspRepeal != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnRepealFromBankToFutureByFutureManual(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":4021
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromBankToFutureByFutureManual(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":4024
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromBankToFutureByFutureManual(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnRepealFromBankToFutureByFutureManual', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnRepealFromBankToFutureByFutureManual", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 4024, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":4025
 *       self.OnRtnRepealFromBankToFutureByFutureManual(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnRepealFromBankToFutureByFutureManual', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4025, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4025, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4025, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4025, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 4025, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__198, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4025, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":4024
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromBankToFutureByFutureManual(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnRepealFromBankToFutureByFutureManual', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":4021
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromBankToFutureByFutureManual(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":4027
 *       myEnv.logger.error('OnRtnRepealFromBankToFutureByFutureManual', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":4018
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnRepealFromBankToFutureByFutureManual(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnRepealFromBankToFutureByFutureManual", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":4033
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnRepealFromFutureToBankByFutureManual(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 */

int TraderSpi_OnRtnRepealFromFutureToBankByFutureManual(PyObject *__pyx_v_self, struct CThostFtdcRspRepealField *__pyx_v_pRspRepeal) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnRepealFromFutureToBankByFutureManual", 0);

  /* "ptp/TraderApi.pyx":4036
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromFutureToBankByFutureManual(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":4037
 * 
 *   try:
 *     if pRspRepeal != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnRepealFromFutureToBankByFutureManual(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pRspRepeal != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":4038
 *   try:
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromFutureToBankByFutureManual(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnRepealFromFutureToBankByFutureManual', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnRepealFromFutureToBankByFut); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4038, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pRspRepeal == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4038, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_RspRepealField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4038, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4038, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspRepeal)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4038, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4038, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4038, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4038, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4038, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4038, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4038, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4038, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4038, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4038, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4038, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":4037
 * 
 *   try:
 *     if pRspRepeal != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnRepealFromFutureToBankByFutureManual(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":4036
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromFutureToBankByFutureManual(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":4039
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromFutureToBankByFutureManual(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnRepealFromFutureToBankByFutureManual', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnRepealFromFutureToBankByFutureManual", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 4039, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":4040
 *       self.OnRtnRepealFromFutureToBankByFutureManual(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnRepealFromFutureToBankByFutureManual', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4040, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4040, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4040, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4040, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 4040, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__199, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4040, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":4039
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromFutureToBankByFutureManual(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnRepealFromFutureToBankByFutureManual', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":4036
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromFutureToBankByFutureManual(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":4042
 *       myEnv.logger.error('OnRtnRepealFromFutureToBankByFutureManual', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":4033
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnRepealFromFutureToBankByFutureManual(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnRepealFromFutureToBankByFutureManual", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":4048
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnQueryBankBalanceByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcNotifyQueryAccountField *pNotifyQueryAccount) except -1:
 * 
 */

int TraderSpi_OnRtnQueryBankBalanceByFuture(PyObject *__pyx_v_self, struct CThostFtdcNotifyQueryAccountField *__pyx_v_pNotifyQueryAccount) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnQueryBankBalanceByFuture", 0);

  /* "ptp/TraderApi.pyx":4051
 *     , CThostFtdcNotifyQueryAccountField *pNotifyQueryAccount) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pNotifyQueryAccount != NULL:
 *       self.OnRtnQueryBankBalanceByFuture(None if pNotifyQueryAccount is NULL else py_ApiStructure.NotifyQueryAccountField.from_address(<size_t> pNotifyQueryAccount))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":4052
 * 
 *   try:
 *     if pNotifyQueryAccount != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnQueryBankBalanceByFuture(None if pNotifyQueryAccount is NULL else py_ApiStructure.NotifyQueryAccountField.from_address(<size_t> pNotifyQueryAccount))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pNotifyQueryAccount != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":4053
 *   try:
 *     if pNotifyQueryAccount != NULL:
 *       self.OnRtnQueryBankBalanceByFuture(None if pNotifyQueryAccount is NULL else py_ApiStructure.NotifyQueryAccountField.from_address(<size_t> pNotifyQueryAccount))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnQueryBankBalanceByFuture', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnQueryBankBalanceByFuture); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4053, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pNotifyQueryAccount == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4053, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_NotifyQueryAccountField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4053, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4053, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pNotifyQueryAccount)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4053, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4053, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4053, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4053, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4053, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4053, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4053, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4053, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4053, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4053, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4053, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":4052
 * 
 *   try:
 *     if pNotifyQueryAccount != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnQueryBankBalanceByFuture(None if pNotifyQueryAccount is NULL else py_ApiStructure.NotifyQueryAccountField.from_address(<size_t> pNotifyQueryAccount))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":4051
 *     , CThostFtdcNotifyQueryAccountField *pNotifyQueryAccount) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pNotifyQueryAccount != NULL:
 *       self.OnRtnQueryBankBalanceByFuture(None if pNotifyQueryAccount is NULL else py_ApiStructure.NotifyQueryAccountField.from_address(<size_t> pNotifyQueryAccount))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":4054
 *     if pNotifyQueryAccount != NULL:
 *       self.OnRtnQueryBankBalanceByFuture(None if pNotifyQueryAccount is NULL else py_ApiStructure.NotifyQueryAccountField.from_address(<size_t> pNotifyQueryAccount))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnQueryBankBalanceByFuture', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnQueryBankBalanceByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 4054, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":4055
 *       self.OnRtnQueryBankBalanceByFuture(None if pNotifyQueryAccount is NULL else py_ApiStructure.NotifyQueryAccountField.from_address(<size_t> pNotifyQueryAccount))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnQueryBankBalanceByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4055, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4055, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4055, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4055, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 4055, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__200, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4055, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":4054
 *     if pNotifyQueryAccount != NULL:
 *       self.OnRtnQueryBankBalanceByFuture(None if pNotifyQueryAccount is NULL else py_ApiStructure.NotifyQueryAccountField.from_address(<size_t> pNotifyQueryAccount))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnQueryBankBalanceByFuture', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":4051
 *     , CThostFtdcNotifyQueryAccountField *pNotifyQueryAccount) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pNotifyQueryAccount != NULL:
 *       self.OnRtnQueryBankBalanceByFuture(None if pNotifyQueryAccount is NULL else py_ApiStructure.NotifyQueryAccountField.from_address(<size_t> pNotifyQueryAccount))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":4057
 *       myEnv.logger.error('OnRtnQueryBankBalanceByFuture', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":4048
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnQueryBankBalanceByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcNotifyQueryAccountField *pNotifyQueryAccount) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnQueryBankBalanceByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":4063
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnBankToFutureByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcReqTransferField *pReqTransfer
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

int TraderSpi_OnErrRtnBankToFutureByFuture(PyObject *__pyx_v_self, struct CThostFtdcReqTransferField *__pyx_v_pReqTransfer, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnErrRtnBankToFutureByFuture", 0);

  /* "ptp/TraderApi.pyx":4067
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqTransfer != NULL:
 *       self.OnErrRtnBankToFutureByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":4068
 * 
 *   try:
 *     if pReqTransfer != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnBankToFutureByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      __pyx_t_4 = ((__pyx_v_pReqTransfer != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":4069
 *   try:
 *     if pReqTransfer != NULL:
 *       self.OnErrRtnBankToFutureByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnErrRtnBankToFutureByFuture); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4069, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pReqTransfer == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4069, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ReqTransferField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4069, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4069, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pReqTransfer)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4069, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4069, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4069, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4069, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4069, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4069, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":4070
 *     if pReqTransfer != NULL:
 *       self.OnErrRtnBankToFutureByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnBankToFutureByFuture', exc_info=True)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4070, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4070, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4070, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4070, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4070, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4070, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4070, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4070, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4070, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }
        __pyx_t_9 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4069, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4069, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4069, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_9) {
            __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_14, __pyx_t_8);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4069, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":4068
 * 
 *   try:
 *     if pReqTransfer != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnBankToFutureByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      }

      /* "ptp/TraderApi.pyx":4067
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqTransfer != NULL:
 *       self.OnErrRtnBankToFutureByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":4071
 *       self.OnErrRtnBankToFutureByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnBankToFutureByFuture', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnBankToFutureByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_12) < 0) __PYX_ERR(0, 4071, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":4072
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnBankToFutureByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4072, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4072, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4072, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4072, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 4072, __pyx_L15_error)
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__201, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4072, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }

      /* "ptp/TraderApi.pyx":4071
 *       self.OnErrRtnBankToFutureByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnBankToFutureByFuture', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":4067
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqTransfer != NULL:
 *       self.OnErrRtnBankToFutureByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":4074
 *       myEnv.logger.error('OnErrRtnBankToFutureByFuture', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":4063
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnBankToFutureByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcReqTransferField *pReqTransfer
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnBankToFutureByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":4080
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnFutureToBankByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcReqTransferField *pReqTransfer
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

int TraderSpi_OnErrRtnFutureToBankByFuture(PyObject *__pyx_v_self, struct CThostFtdcReqTransferField *__pyx_v_pReqTransfer, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnErrRtnFutureToBankByFuture", 0);

  /* "ptp/TraderApi.pyx":4084
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqTransfer != NULL:
 *       self.OnErrRtnFutureToBankByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":4085
 * 
 *   try:
 *     if pReqTransfer != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnFutureToBankByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      __pyx_t_4 = ((__pyx_v_pReqTransfer != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":4086
 *   try:
 *     if pReqTransfer != NULL:
 *       self.OnErrRtnFutureToBankByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnErrRtnFutureToBankByFuture); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4086, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pReqTransfer == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4086, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ReqTransferField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4086, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4086, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pReqTransfer)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4086, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4086, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4086, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4086, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4086, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4086, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":4087
 *     if pReqTransfer != NULL:
 *       self.OnErrRtnFutureToBankByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnFutureToBankByFuture', exc_info=True)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4087, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4087, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4087, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4087, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4087, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4087, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4087, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4087, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4087, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }
        __pyx_t_9 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4086, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4086, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4086, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_9) {
            __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_14, __pyx_t_8);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4086, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":4085
 * 
 *   try:
 *     if pReqTransfer != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnFutureToBankByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      }

      /* "ptp/TraderApi.pyx":4084
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqTransfer != NULL:
 *       self.OnErrRtnFutureToBankByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":4088
 *       self.OnErrRtnFutureToBankByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnFutureToBankByFuture', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnFutureToBankByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_12) < 0) __PYX_ERR(0, 4088, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":4089
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnFutureToBankByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4089, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4089, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4089, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4089, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 4089, __pyx_L15_error)
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__202, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4089, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }

      /* "ptp/TraderApi.pyx":4088
 *       self.OnErrRtnFutureToBankByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnFutureToBankByFuture', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":4084
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqTransfer != NULL:
 *       self.OnErrRtnFutureToBankByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":4091
 *       myEnv.logger.error('OnErrRtnFutureToBankByFuture', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":4080
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnFutureToBankByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcReqTransferField *pReqTransfer
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnFutureToBankByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":4097
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnRepealBankToFutureByFutureManual(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcReqRepealField *pReqRepeal
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

int TraderSpi_OnErrRtnRepealBankToFutureByFutureManual(PyObject *__pyx_v_self, struct CThostFtdcReqRepealField *__pyx_v_pReqRepeal, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnErrRtnRepealBankToFutureByFutureManual", 0);

  /* "ptp/TraderApi.pyx":4101
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqRepeal != NULL:
 *       self.OnErrRtnRepealBankToFutureByFutureManual(None if pReqRepeal is NULL else py_ApiStructure.ReqRepealField.from_address(<size_t> pReqRepeal)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":4102
 * 
 *   try:
 *     if pReqRepeal != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnRepealBankToFutureByFutureManual(None if pReqRepeal is NULL else py_ApiStructure.ReqRepealField.from_address(<size_t> pReqRepeal)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      __pyx_t_4 = ((__pyx_v_pReqRepeal != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":4103
 *   try:
 *     if pReqRepeal != NULL:
 *       self.OnErrRtnRepealBankToFutureByFutureManual(None if pReqRepeal is NULL else py_ApiStructure.ReqRepealField.from_address(<size_t> pReqRepeal)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnErrRtnRepealBankToFutureByFutu); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4103, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pReqRepeal == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4103, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ReqRepealField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4103, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4103, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pReqRepeal)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4103, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4103, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4103, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4103, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4103, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4103, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":4104
 *     if pReqRepeal != NULL:
 *       self.OnErrRtnRepealBankToFutureByFutureManual(None if pReqRepeal is NULL else py_ApiStructure.ReqRepealField.from_address(<size_t> pReqRepeal)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnRepealBankToFutureByFutureManual', exc_info=True)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4104, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4104, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4104, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4104, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4104, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4104, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4104, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4104, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4104, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }
        __pyx_t_9 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4103, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4103, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4103, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_9) {
            __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_14, __pyx_t_8);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4103, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":4102
 * 
 *   try:
 *     if pReqRepeal != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnRepealBankToFutureByFutureManual(None if pReqRepeal is NULL else py_ApiStructure.ReqRepealField.from_address(<size_t> pReqRepeal)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      }

      /* "ptp/TraderApi.pyx":4101
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqRepeal != NULL:
 *       self.OnErrRtnRepealBankToFutureByFutureManual(None if pReqRepeal is NULL else py_ApiStructure.ReqRepealField.from_address(<size_t> pReqRepeal)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":4105
 *       self.OnErrRtnRepealBankToFutureByFutureManual(None if pReqRepeal is NULL else py_ApiStructure.ReqRepealField.from_address(<size_t> pReqRepeal)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnRepealBankToFutureByFutureManual', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnRepealBankToFutureByFutureManual", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_12) < 0) __PYX_ERR(0, 4105, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":4106
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnRepealBankToFutureByFutureManual', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4106, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4106, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4106, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4106, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 4106, __pyx_L15_error)
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__203, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4106, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }

      /* "ptp/TraderApi.pyx":4105
 *       self.OnErrRtnRepealBankToFutureByFutureManual(None if pReqRepeal is NULL else py_ApiStructure.ReqRepealField.from_address(<size_t> pReqRepeal)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnRepealBankToFutureByFutureManual', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":4101
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqRepeal != NULL:
 *       self.OnErrRtnRepealBankToFutureByFutureManual(None if pReqRepeal is NULL else py_ApiStructure.ReqRepealField.from_address(<size_t> pReqRepeal)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":4108
 *       myEnv.logger.error('OnErrRtnRepealBankToFutureByFutureManual', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":4097
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnRepealBankToFutureByFutureManual(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcReqRepealField *pReqRepeal
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnRepealBankToFutureByFutureManual", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":4114
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnRepealFutureToBankByFutureManual(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcReqRepealField *pReqRepeal
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

int TraderSpi_OnErrRtnRepealFutureToBankByFutureManual(PyObject *__pyx_v_self, struct CThostFtdcReqRepealField *__pyx_v_pReqRepeal, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnErrRtnRepealFutureToBankByFutureManual", 0);

  /* "ptp/TraderApi.pyx":4118
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqRepeal != NULL:
 *       self.OnErrRtnRepealFutureToBankByFutureManual(None if pReqRepeal is NULL else py_ApiStructure.ReqRepealField.from_address(<size_t> pReqRepeal)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":4119
 * 
 *   try:
 *     if pReqRepeal != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnRepealFutureToBankByFutureManual(None if pReqRepeal is NULL else py_ApiStructure.ReqRepealField.from_address(<size_t> pReqRepeal)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      __pyx_t_4 = ((__pyx_v_pReqRepeal != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":4120
 *   try:
 *     if pReqRepeal != NULL:
 *       self.OnErrRtnRepealFutureToBankByFutureManual(None if pReqRepeal is NULL else py_ApiStructure.ReqRepealField.from_address(<size_t> pReqRepeal)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnErrRtnRepealFutureToBankByFutu); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4120, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pReqRepeal == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4120, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ReqRepealField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4120, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4120, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pReqRepeal)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4120, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4120, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4120, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4120, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4120, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4120, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":4121
 *     if pReqRepeal != NULL:
 *       self.OnErrRtnRepealFutureToBankByFutureManual(None if pReqRepeal is NULL else py_ApiStructure.ReqRepealField.from_address(<size_t> pReqRepeal)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnRepealFutureToBankByFutureManual', exc_info=True)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4121, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4121, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4121, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4121, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4121, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4121, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4121, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4121, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4121, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }
        __pyx_t_9 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4120, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4120, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4120, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_9) {
            __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_14, __pyx_t_8);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4120, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":4119
 * 
 *   try:
 *     if pReqRepeal != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnRepealFutureToBankByFutureManual(None if pReqRepeal is NULL else py_ApiStructure.ReqRepealField.from_address(<size_t> pReqRepeal)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      }

      /* "ptp/TraderApi.pyx":4118
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqRepeal != NULL:
 *       self.OnErrRtnRepealFutureToBankByFutureManual(None if pReqRepeal is NULL else py_ApiStructure.ReqRepealField.from_address(<size_t> pReqRepeal)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":4122
 *       self.OnErrRtnRepealFutureToBankByFutureManual(None if pReqRepeal is NULL else py_ApiStructure.ReqRepealField.from_address(<size_t> pReqRepeal)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnRepealFutureToBankByFutureManual', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnRepealFutureToBankByFutureManual", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_12) < 0) __PYX_ERR(0, 4122, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":4123
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnRepealFutureToBankByFutureManual', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4123, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4123, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4123, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4123, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 4123, __pyx_L15_error)
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__204, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4123, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }

      /* "ptp/TraderApi.pyx":4122
 *       self.OnErrRtnRepealFutureToBankByFutureManual(None if pReqRepeal is NULL else py_ApiStructure.ReqRepealField.from_address(<size_t> pReqRepeal)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnRepealFutureToBankByFutureManual', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":4118
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqRepeal != NULL:
 *       self.OnErrRtnRepealFutureToBankByFutureManual(None if pReqRepeal is NULL else py_ApiStructure.ReqRepealField.from_address(<size_t> pReqRepeal)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":4125
 *       myEnv.logger.error('OnErrRtnRepealFutureToBankByFutureManual', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":4114
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnRepealFutureToBankByFutureManual(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcReqRepealField *pReqRepeal
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnRepealFutureToBankByFutureManual", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":4131
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnQueryBankBalanceByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcReqQueryAccountField *pReqQueryAccount
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

int TraderSpi_OnErrRtnQueryBankBalanceByFuture(PyObject *__pyx_v_self, struct CThostFtdcReqQueryAccountField *__pyx_v_pReqQueryAccount, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnErrRtnQueryBankBalanceByFuture", 0);

  /* "ptp/TraderApi.pyx":4135
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqQueryAccount != NULL:
 *       self.OnErrRtnQueryBankBalanceByFuture(None if pReqQueryAccount is NULL else py_ApiStructure.ReqQueryAccountField.from_address(<size_t> pReqQueryAccount)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":4136
 * 
 *   try:
 *     if pReqQueryAccount != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnQueryBankBalanceByFuture(None if pReqQueryAccount is NULL else py_ApiStructure.ReqQueryAccountField.from_address(<size_t> pReqQueryAccount)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      __pyx_t_4 = ((__pyx_v_pReqQueryAccount != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":4137
 *   try:
 *     if pReqQueryAccount != NULL:
 *       self.OnErrRtnQueryBankBalanceByFuture(None if pReqQueryAccount is NULL else py_ApiStructure.ReqQueryAccountField.from_address(<size_t> pReqQueryAccount)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnErrRtnQueryBankBalanceByFuture); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4137, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pReqQueryAccount == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4137, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ReqQueryAccountField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4137, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4137, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pReqQueryAccount)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4137, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4137, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4137, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4137, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4137, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4137, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":4138
 *     if pReqQueryAccount != NULL:
 *       self.OnErrRtnQueryBankBalanceByFuture(None if pReqQueryAccount is NULL else py_ApiStructure.ReqQueryAccountField.from_address(<size_t> pReqQueryAccount)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnQueryBankBalanceByFuture', exc_info=True)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4138, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4138, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4138, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4138, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4138, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4138, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4138, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4138, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4138, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }
        __pyx_t_9 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4137, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4137, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4137, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_9) {
            __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_14, __pyx_t_8);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4137, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":4136
 * 
 *   try:
 *     if pReqQueryAccount != NULL:             # <<<<<<<<<<<<<<
 *       self.OnErrRtnQueryBankBalanceByFuture(None if pReqQueryAccount is NULL else py_ApiStructure.ReqQueryAccountField.from_address(<size_t> pReqQueryAccount)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 */
      }

      /* "ptp/TraderApi.pyx":4135
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqQueryAccount != NULL:
 *       self.OnErrRtnQueryBankBalanceByFuture(None if pReqQueryAccount is NULL else py_ApiStructure.ReqQueryAccountField.from_address(<size_t> pReqQueryAccount)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":4139
 *       self.OnErrRtnQueryBankBalanceByFuture(None if pReqQueryAccount is NULL else py_ApiStructure.ReqQueryAccountField.from_address(<size_t> pReqQueryAccount)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnQueryBankBalanceByFuture', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnQueryBankBalanceByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_12) < 0) __PYX_ERR(0, 4139, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":4140
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnQueryBankBalanceByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4140, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4140, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4140, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4140, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 4140, __pyx_L15_error)
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__205, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4140, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }

      /* "ptp/TraderApi.pyx":4139
 *       self.OnErrRtnQueryBankBalanceByFuture(None if pReqQueryAccount is NULL else py_ApiStructure.ReqQueryAccountField.from_address(<size_t> pReqQueryAccount)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnErrRtnQueryBankBalanceByFuture', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":4135
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqQueryAccount != NULL:
 *       self.OnErrRtnQueryBankBalanceByFuture(None if pReqQueryAccount is NULL else py_ApiStructure.ReqQueryAccountField.from_address(<size_t> pReqQueryAccount)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":4142
 *       myEnv.logger.error('OnErrRtnQueryBankBalanceByFuture', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":4131
 * 
 * """
 * cdef extern int   TraderSpi_OnErrRtnQueryBankBalanceByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcReqQueryAccountField *pReqQueryAccount
 *     , CThostFtdcRspInfoField *pRspInfo) except -1:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnErrRtnQueryBankBalanceByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":4148
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnRepealFromBankToFutureByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 */

int TraderSpi_OnRtnRepealFromBankToFutureByFuture(PyObject *__pyx_v_self, struct CThostFtdcRspRepealField *__pyx_v_pRspRepeal) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnRepealFromBankToFutureByFuture", 0);

  /* "ptp/TraderApi.pyx":4151
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromBankToFutureByFuture(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":4152
 * 
 *   try:
 *     if pRspRepeal != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnRepealFromBankToFutureByFuture(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pRspRepeal != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":4153
 *   try:
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromBankToFutureByFuture(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnRepealFromBankToFutureByFuture', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnRepealFromBankToFutureByFut_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4153, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pRspRepeal == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4153, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_RspRepealField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4153, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4153, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspRepeal)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4153, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4153, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4153, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4153, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4153, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4153, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4153, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4153, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4153, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4153, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4153, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":4152
 * 
 *   try:
 *     if pRspRepeal != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnRepealFromBankToFutureByFuture(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":4151
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromBankToFutureByFuture(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":4154
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromBankToFutureByFuture(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnRepealFromBankToFutureByFuture', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnRepealFromBankToFutureByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 4154, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":4155
 *       self.OnRtnRepealFromBankToFutureByFuture(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnRepealFromBankToFutureByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4155, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4155, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4155, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4155, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 4155, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__206, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4155, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":4154
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromBankToFutureByFuture(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnRepealFromBankToFutureByFuture', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":4151
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromBankToFutureByFuture(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":4157
 *       myEnv.logger.error('OnRtnRepealFromBankToFutureByFuture', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":4148
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnRepealFromBankToFutureByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnRepealFromBankToFutureByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":4163
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnRepealFromFutureToBankByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 */

int TraderSpi_OnRtnRepealFromFutureToBankByFuture(PyObject *__pyx_v_self, struct CThostFtdcRspRepealField *__pyx_v_pRspRepeal) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnRepealFromFutureToBankByFuture", 0);

  /* "ptp/TraderApi.pyx":4166
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromFutureToBankByFuture(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":4167
 * 
 *   try:
 *     if pRspRepeal != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnRepealFromFutureToBankByFuture(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pRspRepeal != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":4168
 *   try:
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromFutureToBankByFuture(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnRepealFromFutureToBankByFuture', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnRepealFromFutureToBankByFut_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4168, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pRspRepeal == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4168, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_RspRepealField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4168, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4168, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspRepeal)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4168, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4168, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4168, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4168, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4168, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4168, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4168, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4168, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4168, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4168, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4168, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":4167
 * 
 *   try:
 *     if pRspRepeal != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnRepealFromFutureToBankByFuture(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":4166
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromFutureToBankByFuture(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":4169
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromFutureToBankByFuture(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnRepealFromFutureToBankByFuture', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnRepealFromFutureToBankByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 4169, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":4170
 *       self.OnRtnRepealFromFutureToBankByFuture(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnRepealFromFutureToBankByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4170, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4170, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4170, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4170, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 4170, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__207, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4170, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":4169
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromFutureToBankByFuture(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnRepealFromFutureToBankByFuture', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":4166
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pRspRepeal != NULL:
 *       self.OnRtnRepealFromFutureToBankByFuture(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":4172
 *       myEnv.logger.error('OnRtnRepealFromFutureToBankByFuture', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":4163
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnRepealFromFutureToBankByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcRspRepealField *pRspRepeal) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnRepealFromFutureToBankByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":4178
 * 
 * """
 * cdef extern int   TraderSpi_OnRspFromBankToFutureByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcReqTransferField *pReqTransfer
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspFromBankToFutureByFuture(PyObject *__pyx_v_self, struct CThostFtdcReqTransferField *__pyx_v_pReqTransfer, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspFromBankToFutureByFuture", 0);

  /* "ptp/TraderApi.pyx":4184
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqTransfer != NULL:
 *       self.OnRspFromBankToFutureByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":4185
 * 
 *   try:
 *     if pReqTransfer != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspFromBankToFutureByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pReqTransfer != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":4186
 *   try:
 *     if pReqTransfer != NULL:
 *       self.OnRspFromBankToFutureByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspFromBankToFutureByFuture); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4186, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pReqTransfer == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4186, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ReqTransferField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4186, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4186, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pReqTransfer)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4186, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4186, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4186, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4186, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4186, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4186, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":4187
 *     if pReqTransfer != NULL:
 *       self.OnRspFromBankToFutureByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4187, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4187, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4187, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4187, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4187, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4187, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4187, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4187, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4187, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":4189
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspFromBankToFutureByFuture', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4189, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4189, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4186, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4186, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4186, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4186, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":4185
 * 
 *   try:
 *     if pReqTransfer != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspFromBankToFutureByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":4184
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqTransfer != NULL:
 *       self.OnRspFromBankToFutureByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":4190
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspFromBankToFutureByFuture', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspFromBankToFutureByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 4190, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":4191
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspFromBankToFutureByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4191, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4191, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4191, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4191, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 4191, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__208, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4191, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":4190
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspFromBankToFutureByFuture', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":4184
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqTransfer != NULL:
 *       self.OnRspFromBankToFutureByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":4193
 *       myEnv.logger.error('OnRspFromBankToFutureByFuture', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":4178
 * 
 * """
 * cdef extern int   TraderSpi_OnRspFromBankToFutureByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcReqTransferField *pReqTransfer
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspFromBankToFutureByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":4199
 * 
 * """
 * cdef extern int   TraderSpi_OnRspFromFutureToBankByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcReqTransferField *pReqTransfer
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspFromFutureToBankByFuture(PyObject *__pyx_v_self, struct CThostFtdcReqTransferField *__pyx_v_pReqTransfer, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspFromFutureToBankByFuture", 0);

  /* "ptp/TraderApi.pyx":4205
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqTransfer != NULL:
 *       self.OnRspFromFutureToBankByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":4206
 * 
 *   try:
 *     if pReqTransfer != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspFromFutureToBankByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pReqTransfer != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":4207
 *   try:
 *     if pReqTransfer != NULL:
 *       self.OnRspFromFutureToBankByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspFromFutureToBankByFuture); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4207, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pReqTransfer == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4207, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ReqTransferField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4207, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4207, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pReqTransfer)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4207, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4207, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4207, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4207, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4207, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4207, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":4208
 *     if pReqTransfer != NULL:
 *       self.OnRspFromFutureToBankByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4208, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4208, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4208, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4208, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4208, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4208, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4208, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4208, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4208, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":4210
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspFromFutureToBankByFuture', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4210, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4210, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4207, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4207, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4207, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4207, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":4206
 * 
 *   try:
 *     if pReqTransfer != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspFromFutureToBankByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":4205
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqTransfer != NULL:
 *       self.OnRspFromFutureToBankByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":4211
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspFromFutureToBankByFuture', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspFromFutureToBankByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 4211, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":4212
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspFromFutureToBankByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4212, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4212, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4212, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4212, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 4212, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__209, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4212, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":4211
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspFromFutureToBankByFuture', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":4205
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqTransfer != NULL:
 *       self.OnRspFromFutureToBankByFuture(None if pReqTransfer is NULL else py_ApiStructure.ReqTransferField.from_address(<size_t> pReqTransfer)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":4214
 *       myEnv.logger.error('OnRspFromFutureToBankByFuture', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":4199
 * 
 * """
 * cdef extern int   TraderSpi_OnRspFromFutureToBankByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcReqTransferField *pReqTransfer
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspFromFutureToBankByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":4220
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQueryBankAccountMoneyByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcReqQueryAccountField *pReqQueryAccount
 *     , CThostFtdcRspInfoField *pRspInfo
 */

int TraderSpi_OnRspQueryBankAccountMoneyByFuture(PyObject *__pyx_v_self, struct CThostFtdcReqQueryAccountField *__pyx_v_pReqQueryAccount, struct CThostFtdcRspInfoField *__pyx_v_pRspInfo, int __pyx_v_nRequestID, bool __pyx_v_bIsLast) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRspQueryBankAccountMoneyByFuture", 0);

  /* "ptp/TraderApi.pyx":4226
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqQueryAccount != NULL:
 *       self.OnRspQueryBankAccountMoneyByFuture(None if pReqQueryAccount is NULL else py_ApiStructure.ReqQueryAccountField.from_address(<size_t> pReqQueryAccount)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":4227
 * 
 *   try:
 *     if pReqQueryAccount != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQueryBankAccountMoneyByFuture(None if pReqQueryAccount is NULL else py_ApiStructure.ReqQueryAccountField.from_address(<size_t> pReqQueryAccount)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      __pyx_t_4 = ((__pyx_v_pReqQueryAccount != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":4228
 *   try:
 *     if pReqQueryAccount != NULL:
 *       self.OnRspQueryBankAccountMoneyByFuture(None if pReqQueryAccount is NULL else py_ApiStructure.ReqQueryAccountField.from_address(<size_t> pReqQueryAccount)             # <<<<<<<<<<<<<<
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRspQueryBankAccountMoneyByFutu); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4228, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pReqQueryAccount == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4228, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ReqQueryAccountField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4228, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4228, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pReqQueryAccount)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4228, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4228, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4228, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4228, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4228, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4228, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }

        /* "ptp/TraderApi.pyx":4229
 *     if pReqQueryAccount != NULL:
 *       self.OnRspQueryBankAccountMoneyByFuture(None if pReqQueryAccount is NULL else py_ApiStructure.ReqQueryAccountField.from_address(<size_t> pReqQueryAccount)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)             # <<<<<<<<<<<<<<
 *     ,nRequestID
 *     ,bIsLast)
 */
        if (((__pyx_v_pRspInfo == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_8 = Py_None;
        } else {
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4229, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RspInfoField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4229, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4229, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pRspInfo)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4229, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4229, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4229, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4229, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4229, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4229, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }

        /* "ptp/TraderApi.pyx":4231
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 *     ,nRequestID
 *     ,bIsLast)             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQueryBankAccountMoneyByFuture', exc_info=True)
 */
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nRequestID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4231, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_bIsLast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4231, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4228, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_12};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4228, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4228, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_14, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_14, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_14, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_14, __pyx_t_12);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_12 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4228, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":4227
 * 
 *   try:
 *     if pReqQueryAccount != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRspQueryBankAccountMoneyByFuture(None if pReqQueryAccount is NULL else py_ApiStructure.ReqQueryAccountField.from_address(<size_t> pReqQueryAccount)
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo)
 */
      }

      /* "ptp/TraderApi.pyx":4226
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqQueryAccount != NULL:
 *       self.OnRspQueryBankAccountMoneyByFuture(None if pReqQueryAccount is NULL else py_ApiStructure.ReqQueryAccountField.from_address(<size_t> pReqQueryAccount)
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":4232
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQueryBankAccountMoneyByFuture', exc_info=True)
 * 
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQueryBankAccountMoneyByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 4232, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":4233
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQueryBankAccountMoneyByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4233, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4233, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4233, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4233, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 4233, __pyx_L15_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__210, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4233, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "ptp/TraderApi.pyx":4232
 *     ,nRequestID
 *     ,bIsLast)
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRspQueryBankAccountMoneyByFuture', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":4226
 *     , cbool bIsLast) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pReqQueryAccount != NULL:
 *       self.OnRspQueryBankAccountMoneyByFuture(None if pReqQueryAccount is NULL else py_ApiStructure.ReqQueryAccountField.from_address(<size_t> pReqQueryAccount)
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":4235
 *       myEnv.logger.error('OnRspQueryBankAccountMoneyByFuture', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":4220
 * 
 * """
 * cdef extern int   TraderSpi_OnRspQueryBankAccountMoneyByFuture(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcReqQueryAccountField *pReqQueryAccount
 *     , CThostFtdcRspInfoField *pRspInfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRspQueryBankAccountMoneyByFuture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":4241
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnOpenAccountByBank(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcOpenAccountField *pOpenAccount) except -1:
 * 
 */

int TraderSpi_OnRtnOpenAccountByBank(PyObject *__pyx_v_self, struct CThostFtdcOpenAccountField *__pyx_v_pOpenAccount) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnOpenAccountByBank", 0);

  /* "ptp/TraderApi.pyx":4244
 *     , CThostFtdcOpenAccountField *pOpenAccount) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOpenAccount != NULL:
 *       self.OnRtnOpenAccountByBank(None if pOpenAccount is NULL else py_ApiStructure.OpenAccountField.from_address(<size_t> pOpenAccount))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":4245
 * 
 *   try:
 *     if pOpenAccount != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnOpenAccountByBank(None if pOpenAccount is NULL else py_ApiStructure.OpenAccountField.from_address(<size_t> pOpenAccount))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pOpenAccount != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":4246
 *   try:
 *     if pOpenAccount != NULL:
 *       self.OnRtnOpenAccountByBank(None if pOpenAccount is NULL else py_ApiStructure.OpenAccountField.from_address(<size_t> pOpenAccount))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnOpenAccountByBank', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnOpenAccountByBank); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4246, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pOpenAccount == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4246, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_OpenAccountField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4246, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4246, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pOpenAccount)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4246, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4246, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4246, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4246, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4246, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4246, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4246, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4246, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4246, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4246, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4246, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":4245
 * 
 *   try:
 *     if pOpenAccount != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnOpenAccountByBank(None if pOpenAccount is NULL else py_ApiStructure.OpenAccountField.from_address(<size_t> pOpenAccount))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":4244
 *     , CThostFtdcOpenAccountField *pOpenAccount) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOpenAccount != NULL:
 *       self.OnRtnOpenAccountByBank(None if pOpenAccount is NULL else py_ApiStructure.OpenAccountField.from_address(<size_t> pOpenAccount))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":4247
 *     if pOpenAccount != NULL:
 *       self.OnRtnOpenAccountByBank(None if pOpenAccount is NULL else py_ApiStructure.OpenAccountField.from_address(<size_t> pOpenAccount))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnOpenAccountByBank', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnOpenAccountByBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 4247, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":4248
 *       self.OnRtnOpenAccountByBank(None if pOpenAccount is NULL else py_ApiStructure.OpenAccountField.from_address(<size_t> pOpenAccount))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnOpenAccountByBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4248, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4248, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4248, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4248, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 4248, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__211, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4248, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":4247
 *     if pOpenAccount != NULL:
 *       self.OnRtnOpenAccountByBank(None if pOpenAccount is NULL else py_ApiStructure.OpenAccountField.from_address(<size_t> pOpenAccount))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnOpenAccountByBank', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":4244
 *     , CThostFtdcOpenAccountField *pOpenAccount) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pOpenAccount != NULL:
 *       self.OnRtnOpenAccountByBank(None if pOpenAccount is NULL else py_ApiStructure.OpenAccountField.from_address(<size_t> pOpenAccount))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":4250
 *       myEnv.logger.error('OnRtnOpenAccountByBank', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":4241
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnOpenAccountByBank(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcOpenAccountField *pOpenAccount) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnOpenAccountByBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":4256
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnCancelAccountByBank(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcCancelAccountField *pCancelAccount) except -1:
 * 
 */

int TraderSpi_OnRtnCancelAccountByBank(PyObject *__pyx_v_self, struct CThostFtdcCancelAccountField *__pyx_v_pCancelAccount) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnCancelAccountByBank", 0);

  /* "ptp/TraderApi.pyx":4259
 *     , CThostFtdcCancelAccountField *pCancelAccount) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pCancelAccount != NULL:
 *       self.OnRtnCancelAccountByBank(None if pCancelAccount is NULL else py_ApiStructure.CancelAccountField.from_address(<size_t> pCancelAccount))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":4260
 * 
 *   try:
 *     if pCancelAccount != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnCancelAccountByBank(None if pCancelAccount is NULL else py_ApiStructure.CancelAccountField.from_address(<size_t> pCancelAccount))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pCancelAccount != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":4261
 *   try:
 *     if pCancelAccount != NULL:
 *       self.OnRtnCancelAccountByBank(None if pCancelAccount is NULL else py_ApiStructure.CancelAccountField.from_address(<size_t> pCancelAccount))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnCancelAccountByBank', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnCancelAccountByBank); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4261, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pCancelAccount == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4261, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_CancelAccountField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4261, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4261, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pCancelAccount)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4261, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4261, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4261, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4261, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4261, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4261, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4261, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4261, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4261, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4261, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4261, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":4260
 * 
 *   try:
 *     if pCancelAccount != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnCancelAccountByBank(None if pCancelAccount is NULL else py_ApiStructure.CancelAccountField.from_address(<size_t> pCancelAccount))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":4259
 *     , CThostFtdcCancelAccountField *pCancelAccount) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pCancelAccount != NULL:
 *       self.OnRtnCancelAccountByBank(None if pCancelAccount is NULL else py_ApiStructure.CancelAccountField.from_address(<size_t> pCancelAccount))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":4262
 *     if pCancelAccount != NULL:
 *       self.OnRtnCancelAccountByBank(None if pCancelAccount is NULL else py_ApiStructure.CancelAccountField.from_address(<size_t> pCancelAccount))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnCancelAccountByBank', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnCancelAccountByBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 4262, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":4263
 *       self.OnRtnCancelAccountByBank(None if pCancelAccount is NULL else py_ApiStructure.CancelAccountField.from_address(<size_t> pCancelAccount))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnCancelAccountByBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4263, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4263, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4263, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4263, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 4263, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__212, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4263, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":4262
 *     if pCancelAccount != NULL:
 *       self.OnRtnCancelAccountByBank(None if pCancelAccount is NULL else py_ApiStructure.CancelAccountField.from_address(<size_t> pCancelAccount))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnCancelAccountByBank', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":4259
 *     , CThostFtdcCancelAccountField *pCancelAccount) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pCancelAccount != NULL:
 *       self.OnRtnCancelAccountByBank(None if pCancelAccount is NULL else py_ApiStructure.CancelAccountField.from_address(<size_t> pCancelAccount))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":4265
 *       myEnv.logger.error('OnRtnCancelAccountByBank', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":4256
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnCancelAccountByBank(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcCancelAccountField *pCancelAccount) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnCancelAccountByBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ptp/TraderApi.pyx":4271
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnChangeAccountByBank(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcChangeAccountField *pChangeAccount) except -1:
 * 
 */

int TraderSpi_OnRtnChangeAccountByBank(PyObject *__pyx_v_self, struct CThostFtdcChangeAccountField *__pyx_v_pChangeAccount) {
  CYTHON_UNUSED PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("TraderSpi_OnRtnChangeAccountByBank", 0);

  /* "ptp/TraderApi.pyx":4274
 *     , CThostFtdcChangeAccountField *pChangeAccount) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pChangeAccount != NULL:
 *       self.OnRtnChangeAccountByBank(None if pChangeAccount is NULL else py_ApiStructure.ChangeAccountField.from_address(<size_t> pChangeAccount))
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ptp/TraderApi.pyx":4275
 * 
 *   try:
 *     if pChangeAccount != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnChangeAccountByBank(None if pChangeAccount is NULL else py_ApiStructure.ChangeAccountField.from_address(<size_t> pChangeAccount))
 *   except Exception as err:
 */
      __pyx_t_4 = ((__pyx_v_pChangeAccount != NULL) != 0);
      if (__pyx_t_4) {

        /* "ptp/TraderApi.pyx":4276
 *   try:
 *     if pChangeAccount != NULL:
 *       self.OnRtnChangeAccountByBank(None if pChangeAccount is NULL else py_ApiStructure.ChangeAccountField.from_address(<size_t> pChangeAccount))             # <<<<<<<<<<<<<<
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnChangeAccountByBank', exc_info=True)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_OnRtnChangeAccountByBank); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4276, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (((__pyx_v_pChangeAccount == NULL) != 0)) {
          __Pyx_INCREF(Py_None);
          __pyx_t_7 = Py_None;
        } else {
          __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4276, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ChangeAccountField); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4276, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_from_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4276, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_pChangeAccount)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4276, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4276, __pyx_L3_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4276, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4276, __pyx_L3_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4276, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4276, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_7 = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4276, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4276, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4276, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4276, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4276, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "ptp/TraderApi.pyx":4275
 * 
 *   try:
 *     if pChangeAccount != NULL:             # <<<<<<<<<<<<<<
 *       self.OnRtnChangeAccountByBank(None if pChangeAccount is NULL else py_ApiStructure.ChangeAccountField.from_address(<size_t> pChangeAccount))
 *   except Exception as err:
 */
      }

      /* "ptp/TraderApi.pyx":4274
 *     , CThostFtdcChangeAccountField *pChangeAccount) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pChangeAccount != NULL:
 *       self.OnRtnChangeAccountByBank(None if pChangeAccount is NULL else py_ApiStructure.ChangeAccountField.from_address(<size_t> pChangeAccount))
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ptp/TraderApi.pyx":4277
 *     if pChangeAccount != NULL:
 *       self.OnRtnChangeAccountByBank(None if pChangeAccount is NULL else py_ApiStructure.ChangeAccountField.from_address(<size_t> pChangeAccount))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnChangeAccountByBank', exc_info=True)
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnChangeAccountByBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 4277, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "ptp/TraderApi.pyx":4278
 *       self.OnRtnChangeAccountByBank(None if pChangeAccount is NULL else py_ApiStructure.ChangeAccountField.from_address(<size_t> pChangeAccount))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnChangeAccountByBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_myEnv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4278, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4278, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4278, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4278, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 4278, __pyx_L15_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__213, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4278, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ptp/TraderApi.pyx":4277
 *     if pChangeAccount != NULL:
 *       self.OnRtnChangeAccountByBank(None if pChangeAccount is NULL else py_ApiStructure.ChangeAccountField.from_address(<size_t> pChangeAccount))
 *   except Exception as err:             # <<<<<<<<<<<<<<
 *       myEnv.logger.error('OnRtnChangeAccountByBank', exc_info=True)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L15_error:;
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "ptp/TraderApi.pyx":4274
 *     , CThostFtdcChangeAccountField *pChangeAccount) except -1:
 * 
 *   try:             # <<<<<<<<<<<<<<
 *     if pChangeAccount != NULL:
 *       self.OnRtnChangeAccountByBank(None if pChangeAccount is NULL else py_ApiStructure.ChangeAccountField.from_address(<size_t> pChangeAccount))
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ptp/TraderApi.pyx":4280
 *       myEnv.logger.error('OnRtnChangeAccountByBank', exc_info=True)
 * 
 *   return 0             # <<<<<<<<<<<<<<
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "ptp/TraderApi.pyx":4271
 * 
 * """
 * cdef extern int   TraderSpi_OnRtnChangeAccountByBank(self             # <<<<<<<<<<<<<<
 *     , CThostFtdcChangeAccountField *pChangeAccount) except -1:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("ptp.TraderApi.TraderSpi_OnRtnChangeAccountByBank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_3ptp_9TraderApi_TraderApiWrapper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  if (unlikely(__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_3ptp_9TraderApi_TraderApiWrapper(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_5__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_3ptp_9TraderApi_TraderApiWrapper[] = {
  {"Inc_RequestID", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_3Inc_RequestID, METH_NOARGS, 0},
  {"GetApiVersion", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_7GetApiVersion, METH_VARARGS|METH_KEYWORDS, 0},
  {"Release", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_9Release, METH_NOARGS, 0},
  {"Init_Base", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_11Init_Base, METH_NOARGS, 0},
  {"Init_Net", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_13Init_Net, METH_NOARGS, 0},
  {"Join", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_15Join, METH_NOARGS, 0},
  {"GetTradingDay", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_17GetTradingDay, METH_NOARGS, 0},
  {"RegisterFront", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_19RegisterFront, METH_O, 0},
  {"RegisterNameServer", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_21RegisterNameServer, METH_O, 0},
  {"RegisterFensUserInfo", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_23RegisterFensUserInfo, METH_O, 0},
  {"SubscribePrivateTopic", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_25SubscribePrivateTopic, METH_O, 0},
  {"SubscribePublicTopic", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_27SubscribePublicTopic, METH_O, 0},
  {"ReqAuthenticate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_29ReqAuthenticate, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqUserLogin", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_31ReqUserLogin, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqUserLogout", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_33ReqUserLogout, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqUserPasswordUpdate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_35ReqUserPasswordUpdate, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqTradingAccountPasswordUpdate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_37ReqTradingAccountPasswordUpdate, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqUserLogin2", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_39ReqUserLogin2, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqUserPasswordUpdate2", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_41ReqUserPasswordUpdate2, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqOrderInsert", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_43ReqOrderInsert, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqParkedOrderInsert", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_45ReqParkedOrderInsert, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqParkedOrderAction", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_47ReqParkedOrderAction, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqOrderAction", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_49ReqOrderAction, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQueryMaxOrderVolume", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_51ReqQueryMaxOrderVolume, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqSettlementInfoConfirm", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_53ReqSettlementInfoConfirm, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqRemoveParkedOrder", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_55ReqRemoveParkedOrder, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqRemoveParkedOrderAction", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_57ReqRemoveParkedOrderAction, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqExecOrderInsert", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_59ReqExecOrderInsert, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqExecOrderAction", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_61ReqExecOrderAction, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqForQuoteInsert", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_63ReqForQuoteInsert, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQuoteInsert", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_65ReqQuoteInsert, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQuoteAction", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_67ReqQuoteAction, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqBatchOrderAction", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_69ReqBatchOrderAction, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqOptionSelfCloseInsert", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_71ReqOptionSelfCloseInsert, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqOptionSelfCloseAction", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_73ReqOptionSelfCloseAction, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqCombActionInsert", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_75ReqCombActionInsert, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryOrder", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_77ReqQryOrder, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryTrade", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_79ReqQryTrade, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryInvestorPosition", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_81ReqQryInvestorPosition, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryTradingAccount", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_83ReqQryTradingAccount, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryInvestor", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_85ReqQryInvestor, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryTradingCode", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_87ReqQryTradingCode, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryInstrumentMarginRate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_89ReqQryInstrumentMarginRate, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryInstrumentCommissionRate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_91ReqQryInstrumentCommissionRate, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryExchange", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_93ReqQryExchange, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryProduct", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_95ReqQryProduct, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryInstrument", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_97ReqQryInstrument, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryDepthMarketData", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_99ReqQryDepthMarketData, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQrySettlementInfo", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_101ReqQrySettlementInfo, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryTransferBank", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_103ReqQryTransferBank, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryInvestorPositionDetail", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_105ReqQryInvestorPositionDetail, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryNotice", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_107ReqQryNotice, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQrySettlementInfoConfirm", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_109ReqQrySettlementInfoConfirm, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryInvestorPositionCombineDetail", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_111ReqQryInvestorPositionCombineDetail, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryCFMMCTradingAccountKey", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_113ReqQryCFMMCTradingAccountKey, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryEWarrantOffset", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_115ReqQryEWarrantOffset, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryInvestorProductGroupMargin", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_117ReqQryInvestorProductGroupMargin, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryExchangeMarginRate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_119ReqQryExchangeMarginRate, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryExchangeMarginRateAdjust", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_121ReqQryExchangeMarginRateAdjust, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryExchangeRate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_123ReqQryExchangeRate, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQrySecAgentACIDMap", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_125ReqQrySecAgentACIDMap, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryProductExchRate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_127ReqQryProductExchRate, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryProductGroup", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_129ReqQryProductGroup, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryMMInstrumentCommissionRate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_131ReqQryMMInstrumentCommissionRate, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryMMOptionInstrCommRate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_133ReqQryMMOptionInstrCommRate, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryInstrumentOrderCommRate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_135ReqQryInstrumentOrderCommRate, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQrySecAgentTradingAccount", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_137ReqQrySecAgentTradingAccount, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQrySecAgentCheckMode", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_139ReqQrySecAgentCheckMode, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryOptionInstrTradeCost", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_141ReqQryOptionInstrTradeCost, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryOptionInstrCommRate", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_143ReqQryOptionInstrCommRate, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryExecOrder", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_145ReqQryExecOrder, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryForQuote", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_147ReqQryForQuote, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryQuote", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_149ReqQryQuote, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryOptionSelfClose", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_151ReqQryOptionSelfClose, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryInvestUnit", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_153ReqQryInvestUnit, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryCombInstrumentGuard", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_155ReqQryCombInstrumentGuard, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryCombAction", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_157ReqQryCombAction, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryTransferSerial", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_159ReqQryTransferSerial, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryAccountregister", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_161ReqQryAccountregister, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryContractBank", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_163ReqQryContractBank, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryParkedOrder", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_165ReqQryParkedOrder, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryParkedOrderAction", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_167ReqQryParkedOrderAction, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryTradingNotice", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_169ReqQryTradingNotice, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryBrokerTradingParams", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_171ReqQryBrokerTradingParams, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQryBrokerTradingAlgos", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_173ReqQryBrokerTradingAlgos, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQueryCFMMCTradingAccountToken", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_175ReqQueryCFMMCTradingAccountToken, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqFromBankToFutureByFuture", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_177ReqFromBankToFutureByFuture, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqFromFutureToBankByFuture", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_179ReqFromFutureToBankByFuture, METH_VARARGS|METH_KEYWORDS, 0},
  {"ReqQueryBankAccountMoneyByFuture", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_181ReqQueryBankAccountMoneyByFuture, METH_VARARGS|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_183__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_3ptp_9TraderApi_16TraderApiWrapper_185__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_3ptp_9TraderApi_TraderApiWrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  "ptp.TraderApi.TraderApiWrapper", /*tp_name*/
  sizeof(struct __pyx_obj_3ptp_9TraderApi_TraderApiWrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3ptp_9TraderApi_TraderApiWrapper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3ptp_9TraderApi_TraderApiWrapper, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3ptp_9TraderApi_TraderApiWrapper, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    "TraderApi",
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_n_s_AccountregisterField, __pyx_k_AccountregisterField, sizeof(__pyx_k_AccountregisterField), 0, 0, 1, 1},
  {&__pyx_kp_u_BaseEnv_has_not_been_inited, __pyx_k_BaseEnv_has_not_been_inited, sizeof(__pyx_k_BaseEnv_has_not_been_inited), 0, 1, 0, 0},
  {&__pyx_n_s_BatchOrderActionField, __pyx_k_BatchOrderActionField, sizeof(__pyx_k_BatchOrderActionField), 0, 0, 1, 1},
  {&__pyx_n_s_BrokerTradingAlgosField, __pyx_k_BrokerTradingAlgosField, sizeof(__pyx_k_BrokerTradingAlgosField), 0, 0, 1, 1},
  {&__pyx_n_s_BrokerTradingParamsField, __pyx_k_BrokerTradingParamsField, sizeof(__pyx_k_BrokerTradingParamsField), 0, 0, 1, 1},
  {&__pyx_n_s_BulletinField, __pyx_k_BulletinField, sizeof(__pyx_k_BulletinField), 0, 0, 1, 1},
  {&__pyx_n_s_CFMMCTradingAccountKeyField, __pyx_k_CFMMCTradingAccountKeyField, sizeof(__pyx_k_CFMMCTradingAccountKeyField), 0, 0, 1, 1},
  {&__pyx_n_s_CFMMCTradingAccountTokenField, __pyx_k_CFMMCTradingAccountTokenField, sizeof(__pyx_k_CFMMCTradingAccountTokenField), 0, 0, 1, 1},
  {&__pyx_n_s_CancelAccountField, __pyx_k_CancelAccountField, sizeof(__pyx_k_CancelAccountField), 0, 0, 1, 1},
  {&__pyx_n_s_ChangeAccountField, __pyx_k_ChangeAccountField, sizeof(__pyx_k_ChangeAccountField), 0, 0, 1, 1},
  {&__pyx_n_s_CombActionField, __pyx_k_CombActionField, sizeof(__pyx_k_CombActionField), 0, 0, 1, 1},
  {&__pyx_n_s_CombInstrumentGuardField, __pyx_k_CombInstrumentGuardField, sizeof(__pyx_k_CombInstrumentGuardField), 0, 0, 1, 1},
  {&__pyx_n_s_ContractBankField, __pyx_k_ContractBankField, sizeof(__pyx_k_ContractBankField), 0, 0, 1, 1},
  {&__pyx_n_s_CythonLib, __pyx_k_CythonLib, sizeof(__pyx_k_CythonLib), 0, 0, 1, 1},
  {&__pyx_n_s_DepthMarketDataField, __pyx_k_DepthMarketDataField, sizeof(__pyx_k_DepthMarketDataField), 0, 0, 1, 1},
  {&__pyx_n_s_EWarrantOffsetField, __pyx_k_EWarrantOffsetField, sizeof(__pyx_k_EWarrantOffsetField), 0, 0, 1, 1},
  {&__pyx_n_s_ErrorConditionalOrderField, __pyx_k_ErrorConditionalOrderField, sizeof(__pyx_k_ErrorConditionalOrderField), 0, 0, 1, 1},
  {&__pyx_n_s_ExchangeField, __pyx_k_ExchangeField, sizeof(__pyx_k_ExchangeField), 0, 0, 1, 1},
  {&__pyx_n_s_ExchangeMarginRateAdjustField, __pyx_k_ExchangeMarginRateAdjustField, sizeof(__pyx_k_ExchangeMarginRateAdjustField), 0, 0, 1, 1},
  {&__pyx_n_s_ExchangeMarginRateField, __pyx_k_ExchangeMarginRateField, sizeof(__pyx_k_ExchangeMarginRateField), 0, 0, 1, 1},
  {&__pyx_n_s_ExchangeRateField, __pyx_k_ExchangeRateField, sizeof(__pyx_k_ExchangeRateField), 0, 0, 1, 1},
  {&__pyx_n_s_ExecOrderActionField, __pyx_k_ExecOrderActionField, sizeof(__pyx_k_ExecOrderActionField), 0, 0, 1, 1},
  {&__pyx_n_s_ExecOrderField, __pyx_k_ExecOrderField, sizeof(__pyx_k_ExecOrderField), 0, 0, 1, 1},
  {&__pyx_n_s_ForQuoteField, __pyx_k_ForQuoteField, sizeof(__pyx_k_ForQuoteField), 0, 0, 1, 1},
  {&__pyx_n_s_ForQuoteRspField, __pyx_k_ForQuoteRspField, sizeof(__pyx_k_ForQuoteRspField), 0, 0, 1, 1},
  {&__pyx_n_s_GetApiVersion, __pyx_k_GetApiVersion, sizeof(__pyx_k_GetApiVersion), 0, 0, 1, 1},
  {&__pyx_n_u_GetApiVersion, __pyx_k_GetApiVersion, sizeof(__pyx_k_GetApiVersion), 0, 1, 0, 1},
  {&__pyx_n_s_GetTradingDay, __pyx_k_GetTradingDay, sizeof(__pyx_k_GetTradingDay), 0, 0, 1, 1},
  {&__pyx_n_u_GetTradingDay, __pyx_k_GetTradingDay, sizeof(__pyx_k_GetTradingDay), 0, 1, 0, 1},
  {&__pyx_n_s_Inc_RequestID, __pyx_k_Inc_RequestID, sizeof(__pyx_k_Inc_RequestID), 0, 0, 1, 1},
  {&__pyx_n_s_Init_Base, __pyx_k_Init_Base, sizeof(__pyx_k_Init_Base), 0, 0, 1, 1},
  {&__pyx_n_u_Init_Base, __pyx_k_Init_Base, sizeof(__pyx_k_Init_Base), 0, 1, 0, 1},
  {&__pyx_n_s_Init_Net, __pyx_k_Init_Net, sizeof(__pyx_k_Init_Net), 0, 0, 1, 1},
  {&__pyx_n_s_InputBatchOrderActionField, __pyx_k_InputBatchOrderActionField, sizeof(__pyx_k_InputBatchOrderActionField), 0, 0, 1, 1},
  {&__pyx_n_s_InputCombActionField, __pyx_k_InputCombActionField, sizeof(__pyx_k_InputCombActionField), 0, 0, 1, 1},
  {&__pyx_n_s_InputExecOrderActionField, __pyx_k_InputExecOrderActionField, sizeof(__pyx_k_InputExecOrderActionField), 0, 0, 1, 1},
  {&__pyx_n_s_InputExecOrderField, __pyx_k_InputExecOrderField, sizeof(__pyx_k_InputExecOrderField), 0, 0, 1, 1},
  {&__pyx_n_s_InputForQuoteField, __pyx_k_InputForQuoteField, sizeof(__pyx_k_InputForQuoteField), 0, 0, 1, 1},
  {&__pyx_n_s_InputOptionSelfCloseActionField, __pyx_k_InputOptionSelfCloseActionField, sizeof(__pyx_k_InputOptionSelfCloseActionField), 0, 0, 1, 1},
  {&__pyx_n_s_InputOptionSelfCloseField, __pyx_k_InputOptionSelfCloseField, sizeof(__pyx_k_InputOptionSelfCloseField), 0, 0, 1, 1},
  {&__pyx_n_s_InputOrderActionField, __pyx_k_InputOrderActionField, sizeof(__pyx_k_InputOrderActionField), 0, 0, 1, 1},
  {&__pyx_n_s_InputOrderField, __pyx_k_InputOrderField, sizeof(__pyx_k_InputOrderField), 0, 0, 1, 1},
  {&__pyx_n_s_InputQuoteActionField, __pyx_k_InputQuoteActionField, sizeof(__pyx_k_InputQuoteActionField), 0, 0, 1, 1},
  {&__pyx_n_s_InputQuoteField, __pyx_k_InputQuoteField, sizeof(__pyx_k_InputQuoteField), 0, 0, 1, 1},
  {&__pyx_n_s_InstrumentCommissionRateField, __pyx_k_InstrumentCommissionRateField, sizeof(__pyx_k_InstrumentCommissionRateField), 0, 0, 1, 1},
  {&__pyx_n_s_InstrumentField, __pyx_k_InstrumentField, sizeof(__pyx_k_InstrumentField), 0, 0, 1, 1},
  {&__pyx_n_s_InstrumentMarginRateField, __pyx_k_InstrumentMarginRateField, sizeof(__pyx_k_InstrumentMarginRateField), 0, 0, 1, 1},
  {&__pyx_n_s_InstrumentOrderCommRateField, __pyx_k_InstrumentOrderCommRateField, sizeof(__pyx_k_InstrumentOrderCommRateField), 0, 0, 1, 1},
  {&__pyx_n_s_InstrumentStatusField, __pyx_k_InstrumentStatusField, sizeof(__pyx_k_InstrumentStatusField), 0, 0, 1, 1},
  {&__pyx_n_s_InvestUnitField, __pyx_k_InvestUnitField, sizeof(__pyx_k_InvestUnitField), 0, 0, 1, 1},
  {&__pyx_n_s_InvestorField, __pyx_k_InvestorField, sizeof(__pyx_k_InvestorField), 0, 0, 1, 1},
  {&__pyx_n_s_InvestorPositionCombineDetailFie, __pyx_k_InvestorPositionCombineDetailFie, sizeof(__pyx_k_InvestorPositionCombineDetailFie), 0, 0, 1, 1},
  {&__pyx_n_s_InvestorPositionDetailField, __pyx_k_InvestorPositionDetailField, sizeof(__pyx_k_InvestorPositionDetailField), 0, 0, 1, 1},
  {&__pyx_n_s_InvestorPositionField, __pyx_k_InvestorPositionField, sizeof(__pyx_k_InvestorPositionField), 0, 0, 1, 1},
  {&__pyx_n_s_InvestorProductGroupMarginField, __pyx_k_InvestorProductGroupMarginField, sizeof(__pyx_k_InvestorProductGroupMarginField), 0, 0, 1, 1},
  {&__pyx_n_s_Join, __pyx_k_Join, sizeof(__pyx_k_Join), 0, 0, 1, 1},
  {&__pyx_n_u_Join, __pyx_k_Join, sizeof(__pyx_k_Join), 0, 1, 0, 1},
  {&__pyx_n_s_MMInstrumentCommissionRateField, __pyx_k_MMInstrumentCommissionRateField, sizeof(__pyx_k_MMInstrumentCommissionRateField), 0, 0, 1, 1},
  {&__pyx_n_s_MMOptionInstrCommRateField, __pyx_k_MMOptionInstrCommRateField, sizeof(__pyx_k_MMOptionInstrCommRateField), 0, 0, 1, 1},
  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
  {&__pyx_n_s_NoticeField, __pyx_k_NoticeField, sizeof(__pyx_k_NoticeField), 0, 0, 1, 1},
  {&__pyx_n_s_NotifyQueryAccountField, __pyx_k_NotifyQueryAccountField, sizeof(__pyx_k_NotifyQueryAccountField), 0, 0, 1, 1},
  {&__pyx_n_s_OnErrRtnBankToFutureByFuture, __pyx_k_OnErrRtnBankToFutureByFuture, sizeof(__pyx_k_OnErrRtnBankToFutureByFuture), 0, 0, 1, 1},
  {&__pyx_n_u_OnErrRtnBankToFutureByFuture, __pyx_k_OnErrRtnBankToFutureByFuture, sizeof(__pyx_k_OnErrRtnBankToFutureByFuture), 0, 1, 0, 1},
  {&__pyx_n_s_OnErrRtnBatchOrderAction, __pyx_k_OnErrRtnBatchOrderAction, sizeof(__pyx_k_OnErrRtnBatchOrderAction), 0, 0, 1, 1},
  {&__pyx_n_u_OnErrRtnBatchOrderAction, __pyx_k_OnErrRtnBatchOrderAction, sizeof(__pyx_k_OnErrRtnBatchOrderAction), 0, 1, 0, 1},
  {&__pyx_n_s_OnErrRtnCombActionInsert, __pyx_k_OnErrRtnCombActionInsert, sizeof(__pyx_k_OnErrRtnCombActionInsert), 0, 0, 1, 1},
  {&__pyx_n_u_OnErrRtnCombActionInsert, __pyx_k_OnErrRtnCombActionInsert, sizeof(__pyx_k_OnErrRtnCombActionInsert), 0, 1, 0, 1},
  {&__pyx_n_s_OnErrRtnExecOrderAction, __pyx_k_OnErrRtnExecOrderAction, sizeof(__pyx_k_OnErrRtnExecOrderAction), 0, 0, 1, 1},
  {&__pyx_n_u_OnErrRtnExecOrderAction, __pyx_k_OnErrRtnExecOrderAction, sizeof(__pyx_k_OnErrRtnExecOrderAction), 0, 1, 0, 1},
  {&__pyx_n_s_OnErrRtnExecOrderInsert, __pyx_k_OnErrRtnExecOrderInsert, sizeof(__pyx_k_OnErrRtnExecOrderInsert), 0, 0, 1, 1},
  {&__pyx_n_u_OnErrRtnExecOrderInsert, __pyx_k_OnErrRtnExecOrderInsert, sizeof(__pyx_k_OnErrRtnExecOrderInsert), 0, 1, 0, 1},
  {&__pyx_n_s_OnErrRtnForQuoteInsert, __pyx_k_OnErrRtnForQuoteInsert, sizeof(__pyx_k_OnErrRtnForQuoteInsert), 0, 0, 1, 1},
  {&__pyx_n_u_OnErrRtnForQuoteInsert, __pyx_k_OnErrRtnForQuoteInsert, sizeof(__pyx_k_OnErrRtnForQuoteInsert), 0, 1, 0, 1},
  {&__pyx_n_s_OnErrRtnFutureToBankByFuture, __pyx_k_OnErrRtnFutureToBankByFuture, sizeof(__pyx_k_OnErrRtnFutureToBankByFuture), 0, 0, 1, 1},
  {&__pyx_n_u_OnErrRtnFutureToBankByFuture, __pyx_k_OnErrRtnFutureToBankByFuture, sizeof(__pyx_k_OnErrRtnFutureToBankByFuture), 0, 1, 0, 1},
  {&__pyx_n_s_OnErrRtnOptionSelfCloseAction, __pyx_k_OnErrRtnOptionSelfCloseAction, sizeof(__pyx_k_OnErrRtnOptionSelfCloseAction), 0, 0, 1, 1},
  {&__pyx_n_u_OnErrRtnOptionSelfCloseAction, __pyx_k_OnErrRtnOptionSelfCloseAction, sizeof(__pyx_k_OnErrRtnOptionSelfCloseAction), 0, 1, 0, 1},
  {&__pyx_n_s_OnErrRtnOptionSelfCloseInsert, __pyx_k_OnErrRtnOptionSelfCloseInsert, sizeof(__pyx_k_OnErrRtnOptionSelfCloseInsert), 0, 0, 1, 1},
  {&__pyx_n_u_OnErrRtnOptionSelfCloseInsert, __pyx_k_OnErrRtnOptionSelfCloseInsert, sizeof(__pyx_k_OnErrRtnOptionSelfCloseInsert), 0, 1, 0, 1},
  {&__pyx_n_s_OnErrRtnOrderAction, __pyx_k_OnErrRtnOrderAction, sizeof(__pyx_k_OnErrRtnOrderAction), 0, 0, 1, 1},
  {&__pyx_n_u_OnErrRtnOrderAction, __pyx_k_OnErrRtnOrderAction, sizeof(__pyx_k_OnErrRtnOrderAction), 0, 1, 0, 1},
  {&__pyx_n_s_OnErrRtnOrderInsert, __pyx_k_OnErrRtnOrderInsert, sizeof(__pyx_k_OnErrRtnOrderInsert), 0, 0, 1, 1},
  {&__pyx_n_u_OnErrRtnOrderInsert, __pyx_k_OnErrRtnOrderInsert, sizeof(__pyx_k_OnErrRtnOrderInsert), 0, 1, 0, 1},
  {&__pyx_n_s_OnErrRtnQueryBankBalanceByFuture, __pyx_k_OnErrRtnQueryBankBalanceByFuture, sizeof(__pyx_k_OnErrRtnQueryBankBalanceByFuture), 0, 0, 1, 1},
  {&__pyx_n_u_OnErrRtnQueryBankBalanceByFuture, __pyx_k_OnErrRtnQueryBankBalanceByFuture, sizeof(__pyx_k_OnErrRtnQueryBankBalanceByFuture), 0, 1, 0, 1},
  {&__pyx_n_s_OnErrRtnQuoteAction, __pyx_k_OnErrRtnQuoteAction, sizeof(__pyx_k_OnErrRtnQuoteAction), 0, 0, 1, 1},
  {&__pyx_n_u_OnErrRtnQuoteAction, __pyx_k_OnErrRtnQuoteAction, sizeof(__pyx_k_OnErrRtnQuoteAction), 0, 1, 0, 1},
  {&__pyx_n_s_OnErrRtnQuoteInsert, __pyx_k_OnErrRtnQuoteInsert, sizeof(__pyx_k_OnErrRtnQuoteInsert), 0, 0, 1, 1},
  {&__pyx_n_u_OnErrRtnQuoteInsert, __pyx_k_OnErrRtnQuoteInsert, sizeof(__pyx_k_OnErrRtnQuoteInsert), 0, 1, 0, 1},
  {&__pyx_n_s_OnErrRtnRepealBankToFutureByFutu, __pyx_k_OnErrRtnRepealBankToFutureByFutu, sizeof(__pyx_k_OnErrRtnRepealBankToFutureByFutu), 0, 0, 1, 1},
  {&__pyx_n_u_OnErrRtnRepealBankToFutureByFutu, __pyx_k_OnErrRtnRepealBankToFutureByFutu, sizeof(__pyx_k_OnErrRtnRepealBankToFutureByFutu), 0, 1, 0, 1},
  {&__pyx_n_s_OnErrRtnRepealFutureToBankByFutu, __pyx_k_OnErrRtnRepealFutureToBankByFutu, sizeof(__pyx_k_OnErrRtnRepealFutureToBankByFutu), 0, 0, 1, 1},
  {&__pyx_n_u_OnErrRtnRepealFutureToBankByFutu, __pyx_k_OnErrRtnRepealFutureToBankByFutu, sizeof(__pyx_k_OnErrRtnRepealFutureToBankByFutu), 0, 1, 0, 1},
  {&__pyx_n_s_OnFrontConnected, __pyx_k_OnFrontConnected, sizeof(__pyx_k_OnFrontConnected), 0, 0, 1, 1},
  {&__pyx_n_u_OnFrontConnected, __pyx_k_OnFrontConnected, sizeof(__pyx_k_OnFrontConnected), 0, 1, 0, 1},
  {&__pyx_n_s_OnFrontDisconnected, __pyx_k_OnFrontDisconnected, sizeof(__pyx_k_OnFrontDisconnected), 0, 0, 1, 1},
  {&__pyx_n_u_OnFrontDisconnected, __pyx_k_OnFrontDisconnected, sizeof(__pyx_k_OnFrontDisconnected), 0, 1, 0, 1},
  {&__pyx_n_s_OnHeartBeatWarning, __pyx_k_OnHeartBeatWarning, sizeof(__pyx_k_OnHeartBeatWarning), 0, 0, 1, 1},
  {&__pyx_n_u_OnHeartBeatWarning, __pyx_k_OnHeartBeatWarning, sizeof(__pyx_k_OnHeartBeatWarning), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspAuthenticate, __pyx_k_OnRspAuthenticate, sizeof(__pyx_k_OnRspAuthenticate), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspAuthenticate, __pyx_k_OnRspAuthenticate, sizeof(__pyx_k_OnRspAuthenticate), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspBatchOrderAction, __pyx_k_OnRspBatchOrderAction, sizeof(__pyx_k_OnRspBatchOrderAction), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspBatchOrderAction, __pyx_k_OnRspBatchOrderAction, sizeof(__pyx_k_OnRspBatchOrderAction), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspCombActionInsert, __pyx_k_OnRspCombActionInsert, sizeof(__pyx_k_OnRspCombActionInsert), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspCombActionInsert, __pyx_k_OnRspCombActionInsert, sizeof(__pyx_k_OnRspCombActionInsert), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspError, __pyx_k_OnRspError, sizeof(__pyx_k_OnRspError), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspError, __pyx_k_OnRspError, sizeof(__pyx_k_OnRspError), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspExecOrderAction, __pyx_k_OnRspExecOrderAction, sizeof(__pyx_k_OnRspExecOrderAction), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspExecOrderAction, __pyx_k_OnRspExecOrderAction, sizeof(__pyx_k_OnRspExecOrderAction), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspExecOrderInsert, __pyx_k_OnRspExecOrderInsert, sizeof(__pyx_k_OnRspExecOrderInsert), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspExecOrderInsert, __pyx_k_OnRspExecOrderInsert, sizeof(__pyx_k_OnRspExecOrderInsert), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspForQuoteInsert, __pyx_k_OnRspForQuoteInsert, sizeof(__pyx_k_OnRspForQuoteInsert), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspForQuoteInsert, __pyx_k_OnRspForQuoteInsert, sizeof(__pyx_k_OnRspForQuoteInsert), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspFromBankToFutureByFuture, __pyx_k_OnRspFromBankToFutureByFuture, sizeof(__pyx_k_OnRspFromBankToFutureByFuture), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspFromBankToFutureByFuture, __pyx_k_OnRspFromBankToFutureByFuture, sizeof(__pyx_k_OnRspFromBankToFutureByFuture), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspFromFutureToBankByFuture, __pyx_k_OnRspFromFutureToBankByFuture, sizeof(__pyx_k_OnRspFromFutureToBankByFuture), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspFromFutureToBankByFuture, __pyx_k_OnRspFromFutureToBankByFuture, sizeof(__pyx_k_OnRspFromFutureToBankByFuture), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspOptionSelfCloseAction, __pyx_k_OnRspOptionSelfCloseAction, sizeof(__pyx_k_OnRspOptionSelfCloseAction), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspOptionSelfCloseAction, __pyx_k_OnRspOptionSelfCloseAction, sizeof(__pyx_k_OnRspOptionSelfCloseAction), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspOptionSelfCloseInsert, __pyx_k_OnRspOptionSelfCloseInsert, sizeof(__pyx_k_OnRspOptionSelfCloseInsert), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspOptionSelfCloseInsert, __pyx_k_OnRspOptionSelfCloseInsert, sizeof(__pyx_k_OnRspOptionSelfCloseInsert), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspOrderAction, __pyx_k_OnRspOrderAction, sizeof(__pyx_k_OnRspOrderAction), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspOrderAction, __pyx_k_OnRspOrderAction, sizeof(__pyx_k_OnRspOrderAction), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspOrderInsert, __pyx_k_OnRspOrderInsert, sizeof(__pyx_k_OnRspOrderInsert), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspOrderInsert, __pyx_k_OnRspOrderInsert, sizeof(__pyx_k_OnRspOrderInsert), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspParkedOrderAction, __pyx_k_OnRspParkedOrderAction, sizeof(__pyx_k_OnRspParkedOrderAction), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspParkedOrderAction, __pyx_k_OnRspParkedOrderAction, sizeof(__pyx_k_OnRspParkedOrderAction), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspParkedOrderInsert, __pyx_k_OnRspParkedOrderInsert, sizeof(__pyx_k_OnRspParkedOrderInsert), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspParkedOrderInsert, __pyx_k_OnRspParkedOrderInsert, sizeof(__pyx_k_OnRspParkedOrderInsert), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryAccountregister, __pyx_k_OnRspQryAccountregister, sizeof(__pyx_k_OnRspQryAccountregister), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryAccountregister, __pyx_k_OnRspQryAccountregister, sizeof(__pyx_k_OnRspQryAccountregister), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryBrokerTradingAlgos, __pyx_k_OnRspQryBrokerTradingAlgos, sizeof(__pyx_k_OnRspQryBrokerTradingAlgos), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryBrokerTradingAlgos, __pyx_k_OnRspQryBrokerTradingAlgos, sizeof(__pyx_k_OnRspQryBrokerTradingAlgos), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryBrokerTradingParams, __pyx_k_OnRspQryBrokerTradingParams, sizeof(__pyx_k_OnRspQryBrokerTradingParams), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryBrokerTradingParams, __pyx_k_OnRspQryBrokerTradingParams, sizeof(__pyx_k_OnRspQryBrokerTradingParams), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryCFMMCTradingAccountKey, __pyx_k_OnRspQryCFMMCTradingAccountKey, sizeof(__pyx_k_OnRspQryCFMMCTradingAccountKey), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryCFMMCTradingAccountKey, __pyx_k_OnRspQryCFMMCTradingAccountKey, sizeof(__pyx_k_OnRspQryCFMMCTradingAccountKey), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryCombAction, __pyx_k_OnRspQryCombAction, sizeof(__pyx_k_OnRspQryCombAction), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryCombAction, __pyx_k_OnRspQryCombAction, sizeof(__pyx_k_OnRspQryCombAction), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryCombInstrumentGuard, __pyx_k_OnRspQryCombInstrumentGuard, sizeof(__pyx_k_OnRspQryCombInstrumentGuard), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryCombInstrumentGuard, __pyx_k_OnRspQryCombInstrumentGuard, sizeof(__pyx_k_OnRspQryCombInstrumentGuard), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryContractBank, __pyx_k_OnRspQryContractBank, sizeof(__pyx_k_OnRspQryContractBank), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryContractBank, __pyx_k_OnRspQryContractBank, sizeof(__pyx_k_OnRspQryContractBank), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryDepthMarketData, __pyx_k_OnRspQryDepthMarketData, sizeof(__pyx_k_OnRspQryDepthMarketData), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryDepthMarketData, __pyx_k_OnRspQryDepthMarketData, sizeof(__pyx_k_OnRspQryDepthMarketData), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryEWarrantOffset, __pyx_k_OnRspQryEWarrantOffset, sizeof(__pyx_k_OnRspQryEWarrantOffset), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryEWarrantOffset, __pyx_k_OnRspQryEWarrantOffset, sizeof(__pyx_k_OnRspQryEWarrantOffset), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryExchange, __pyx_k_OnRspQryExchange, sizeof(__pyx_k_OnRspQryExchange), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryExchange, __pyx_k_OnRspQryExchange, sizeof(__pyx_k_OnRspQryExchange), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryExchangeMarginRate, __pyx_k_OnRspQryExchangeMarginRate, sizeof(__pyx_k_OnRspQryExchangeMarginRate), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryExchangeMarginRate, __pyx_k_OnRspQryExchangeMarginRate, sizeof(__pyx_k_OnRspQryExchangeMarginRate), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryExchangeMarginRateAdjust, __pyx_k_OnRspQryExchangeMarginRateAdjust, sizeof(__pyx_k_OnRspQryExchangeMarginRateAdjust), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryExchangeMarginRateAdjust, __pyx_k_OnRspQryExchangeMarginRateAdjust, sizeof(__pyx_k_OnRspQryExchangeMarginRateAdjust), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryExchangeRate, __pyx_k_OnRspQryExchangeRate, sizeof(__pyx_k_OnRspQryExchangeRate), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryExchangeRate, __pyx_k_OnRspQryExchangeRate, sizeof(__pyx_k_OnRspQryExchangeRate), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryExecOrder, __pyx_k_OnRspQryExecOrder, sizeof(__pyx_k_OnRspQryExecOrder), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryExecOrder, __pyx_k_OnRspQryExecOrder, sizeof(__pyx_k_OnRspQryExecOrder), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryForQuote, __pyx_k_OnRspQryForQuote, sizeof(__pyx_k_OnRspQryForQuote), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryForQuote, __pyx_k_OnRspQryForQuote, sizeof(__pyx_k_OnRspQryForQuote), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryInstrument, __pyx_k_OnRspQryInstrument, sizeof(__pyx_k_OnRspQryInstrument), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryInstrument, __pyx_k_OnRspQryInstrument, sizeof(__pyx_k_OnRspQryInstrument), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryInstrumentCommissionRate, __pyx_k_OnRspQryInstrumentCommissionRate, sizeof(__pyx_k_OnRspQryInstrumentCommissionRate), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryInstrumentCommissionRate, __pyx_k_OnRspQryInstrumentCommissionRate, sizeof(__pyx_k_OnRspQryInstrumentCommissionRate), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryInstrumentMarginRate, __pyx_k_OnRspQryInstrumentMarginRate, sizeof(__pyx_k_OnRspQryInstrumentMarginRate), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryInstrumentMarginRate, __pyx_k_OnRspQryInstrumentMarginRate, sizeof(__pyx_k_OnRspQryInstrumentMarginRate), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryInstrumentOrderCommRate, __pyx_k_OnRspQryInstrumentOrderCommRate, sizeof(__pyx_k_OnRspQryInstrumentOrderCommRate), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryInstrumentOrderCommRate, __pyx_k_OnRspQryInstrumentOrderCommRate, sizeof(__pyx_k_OnRspQryInstrumentOrderCommRate), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryInvestUnit, __pyx_k_OnRspQryInvestUnit, sizeof(__pyx_k_OnRspQryInvestUnit), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryInvestUnit, __pyx_k_OnRspQryInvestUnit, sizeof(__pyx_k_OnRspQryInvestUnit), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryInvestor, __pyx_k_OnRspQryInvestor, sizeof(__pyx_k_OnRspQryInvestor), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryInvestor, __pyx_k_OnRspQryInvestor, sizeof(__pyx_k_OnRspQryInvestor), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryInvestorPosition, __pyx_k_OnRspQryInvestorPosition, sizeof(__pyx_k_OnRspQryInvestorPosition), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryInvestorPosition, __pyx_k_OnRspQryInvestorPosition, sizeof(__pyx_k_OnRspQryInvestorPosition), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryInvestorPositionCombineD, __pyx_k_OnRspQryInvestorPositionCombineD, sizeof(__pyx_k_OnRspQryInvestorPositionCombineD), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryInvestorPositionCombineD, __pyx_k_OnRspQryInvestorPositionCombineD, sizeof(__pyx_k_OnRspQryInvestorPositionCombineD), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryInvestorPositionDetail, __pyx_k_OnRspQryInvestorPositionDetail, sizeof(__pyx_k_OnRspQryInvestorPositionDetail), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryInvestorPositionDetail, __pyx_k_OnRspQryInvestorPositionDetail, sizeof(__pyx_k_OnRspQryInvestorPositionDetail), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryInvestorProductGroupMarg, __pyx_k_OnRspQryInvestorProductGroupMarg, sizeof(__pyx_k_OnRspQryInvestorProductGroupMarg), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryInvestorProductGroupMarg, __pyx_k_OnRspQryInvestorProductGroupMarg, sizeof(__pyx_k_OnRspQryInvestorProductGroupMarg), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryMMInstrumentCommissionRa, __pyx_k_OnRspQryMMInstrumentCommissionRa, sizeof(__pyx_k_OnRspQryMMInstrumentCommissionRa), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryMMInstrumentCommissionRa, __pyx_k_OnRspQryMMInstrumentCommissionRa, sizeof(__pyx_k_OnRspQryMMInstrumentCommissionRa), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryMMOptionInstrCommRate, __pyx_k_OnRspQryMMOptionInstrCommRate, sizeof(__pyx_k_OnRspQryMMOptionInstrCommRate), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryMMOptionInstrCommRate, __pyx_k_OnRspQryMMOptionInstrCommRate, sizeof(__pyx_k_OnRspQryMMOptionInstrCommRate), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryNotice, __pyx_k_OnRspQryNotice, sizeof(__pyx_k_OnRspQryNotice), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryNotice, __pyx_k_OnRspQryNotice, sizeof(__pyx_k_OnRspQryNotice), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryOptionInstrCommRate, __pyx_k_OnRspQryOptionInstrCommRate, sizeof(__pyx_k_OnRspQryOptionInstrCommRate), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryOptionInstrCommRate, __pyx_k_OnRspQryOptionInstrCommRate, sizeof(__pyx_k_OnRspQryOptionInstrCommRate), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryOptionInstrTradeCost, __pyx_k_OnRspQryOptionInstrTradeCost, sizeof(__pyx_k_OnRspQryOptionInstrTradeCost), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryOptionInstrTradeCost, __pyx_k_OnRspQryOptionInstrTradeCost, sizeof(__pyx_k_OnRspQryOptionInstrTradeCost), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryOptionSelfClose, __pyx_k_OnRspQryOptionSelfClose, sizeof(__pyx_k_OnRspQryOptionSelfClose), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryOptionSelfClose, __pyx_k_OnRspQryOptionSelfClose, sizeof(__pyx_k_OnRspQryOptionSelfClose), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryOrder, __pyx_k_OnRspQryOrder, sizeof(__pyx_k_OnRspQryOrder), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryOrder, __pyx_k_OnRspQryOrder, sizeof(__pyx_k_OnRspQryOrder), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryParkedOrder, __pyx_k_OnRspQryParkedOrder, sizeof(__pyx_k_OnRspQryParkedOrder), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryParkedOrder, __pyx_k_OnRspQryParkedOrder, sizeof(__pyx_k_OnRspQryParkedOrder), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryParkedOrderAction, __pyx_k_OnRspQryParkedOrderAction, sizeof(__pyx_k_OnRspQryParkedOrderAction), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryParkedOrderAction, __pyx_k_OnRspQryParkedOrderAction, sizeof(__pyx_k_OnRspQryParkedOrderAction), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryProduct, __pyx_k_OnRspQryProduct, sizeof(__pyx_k_OnRspQryProduct), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryProduct, __pyx_k_OnRspQryProduct, sizeof(__pyx_k_OnRspQryProduct), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryProductExchRate, __pyx_k_OnRspQryProductExchRate, sizeof(__pyx_k_OnRspQryProductExchRate), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryProductExchRate, __pyx_k_OnRspQryProductExchRate, sizeof(__pyx_k_OnRspQryProductExchRate), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryProductGroup, __pyx_k_OnRspQryProductGroup, sizeof(__pyx_k_OnRspQryProductGroup), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryProductGroup, __pyx_k_OnRspQryProductGroup, sizeof(__pyx_k_OnRspQryProductGroup), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryQuote, __pyx_k_OnRspQryQuote, sizeof(__pyx_k_OnRspQryQuote), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryQuote, __pyx_k_OnRspQryQuote, sizeof(__pyx_k_OnRspQryQuote), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQrySecAgentACIDMap, __pyx_k_OnRspQrySecAgentACIDMap, sizeof(__pyx_k_OnRspQrySecAgentACIDMap), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQrySecAgentACIDMap, __pyx_k_OnRspQrySecAgentACIDMap, sizeof(__pyx_k_OnRspQrySecAgentACIDMap), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQrySecAgentCheckMode, __pyx_k_OnRspQrySecAgentCheckMode, sizeof(__pyx_k_OnRspQrySecAgentCheckMode), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQrySecAgentCheckMode, __pyx_k_OnRspQrySecAgentCheckMode, sizeof(__pyx_k_OnRspQrySecAgentCheckMode), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQrySecAgentTradingAccount, __pyx_k_OnRspQrySecAgentTradingAccount, sizeof(__pyx_k_OnRspQrySecAgentTradingAccount), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQrySecAgentTradingAccount, __pyx_k_OnRspQrySecAgentTradingAccount, sizeof(__pyx_k_OnRspQrySecAgentTradingAccount), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQrySettlementInfo, __pyx_k_OnRspQrySettlementInfo, sizeof(__pyx_k_OnRspQrySettlementInfo), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQrySettlementInfo, __pyx_k_OnRspQrySettlementInfo, sizeof(__pyx_k_OnRspQrySettlementInfo), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQrySettlementInfoConfirm, __pyx_k_OnRspQrySettlementInfoConfirm, sizeof(__pyx_k_OnRspQrySettlementInfoConfirm), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQrySettlementInfoConfirm, __pyx_k_OnRspQrySettlementInfoConfirm, sizeof(__pyx_k_OnRspQrySettlementInfoConfirm), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryTrade, __pyx_k_OnRspQryTrade, sizeof(__pyx_k_OnRspQryTrade), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryTrade, __pyx_k_OnRspQryTrade, sizeof(__pyx_k_OnRspQryTrade), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryTradingAccount, __pyx_k_OnRspQryTradingAccount, sizeof(__pyx_k_OnRspQryTradingAccount), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryTradingAccount, __pyx_k_OnRspQryTradingAccount, sizeof(__pyx_k_OnRspQryTradingAccount), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryTradingCode, __pyx_k_OnRspQryTradingCode, sizeof(__pyx_k_OnRspQryTradingCode), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryTradingCode, __pyx_k_OnRspQryTradingCode, sizeof(__pyx_k_OnRspQryTradingCode), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryTradingNotice, __pyx_k_OnRspQryTradingNotice, sizeof(__pyx_k_OnRspQryTradingNotice), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryTradingNotice, __pyx_k_OnRspQryTradingNotice, sizeof(__pyx_k_OnRspQryTradingNotice), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryTransferBank, __pyx_k_OnRspQryTransferBank, sizeof(__pyx_k_OnRspQryTransferBank), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryTransferBank, __pyx_k_OnRspQryTransferBank, sizeof(__pyx_k_OnRspQryTransferBank), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQryTransferSerial, __pyx_k_OnRspQryTransferSerial, sizeof(__pyx_k_OnRspQryTransferSerial), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQryTransferSerial, __pyx_k_OnRspQryTransferSerial, sizeof(__pyx_k_OnRspQryTransferSerial), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQueryBankAccountMoneyByFutu, __pyx_k_OnRspQueryBankAccountMoneyByFutu, sizeof(__pyx_k_OnRspQueryBankAccountMoneyByFutu), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQueryBankAccountMoneyByFutu, __pyx_k_OnRspQueryBankAccountMoneyByFutu, sizeof(__pyx_k_OnRspQueryBankAccountMoneyByFutu), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQueryCFMMCTradingAccountTok, __pyx_k_OnRspQueryCFMMCTradingAccountTok, sizeof(__pyx_k_OnRspQueryCFMMCTradingAccountTok), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQueryCFMMCTradingAccountTok, __pyx_k_OnRspQueryCFMMCTradingAccountTok, sizeof(__pyx_k_OnRspQueryCFMMCTradingAccountTok), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQueryMaxOrderVolume, __pyx_k_OnRspQueryMaxOrderVolume, sizeof(__pyx_k_OnRspQueryMaxOrderVolume), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQueryMaxOrderVolume, __pyx_k_OnRspQueryMaxOrderVolume, sizeof(__pyx_k_OnRspQueryMaxOrderVolume), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQuoteAction, __pyx_k_OnRspQuoteAction, sizeof(__pyx_k_OnRspQuoteAction), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQuoteAction, __pyx_k_OnRspQuoteAction, sizeof(__pyx_k_OnRspQuoteAction), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspQuoteInsert, __pyx_k_OnRspQuoteInsert, sizeof(__pyx_k_OnRspQuoteInsert), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspQuoteInsert, __pyx_k_OnRspQuoteInsert, sizeof(__pyx_k_OnRspQuoteInsert), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspRemoveParkedOrder, __pyx_k_OnRspRemoveParkedOrder, sizeof(__pyx_k_OnRspRemoveParkedOrder), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspRemoveParkedOrder, __pyx_k_OnRspRemoveParkedOrder, sizeof(__pyx_k_OnRspRemoveParkedOrder), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspRemoveParkedOrderAction, __pyx_k_OnRspRemoveParkedOrderAction, sizeof(__pyx_k_OnRspRemoveParkedOrderAction), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspRemoveParkedOrderAction, __pyx_k_OnRspRemoveParkedOrderAction, sizeof(__pyx_k_OnRspRemoveParkedOrderAction), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspSettlementInfoConfirm, __pyx_k_OnRspSettlementInfoConfirm, sizeof(__pyx_k_OnRspSettlementInfoConfirm), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspSettlementInfoConfirm, __pyx_k_OnRspSettlementInfoConfirm, sizeof(__pyx_k_OnRspSettlementInfoConfirm), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspTradingAccountPasswordUpdat, __pyx_k_OnRspTradingAccountPasswordUpdat, sizeof(__pyx_k_OnRspTradingAccountPasswordUpdat), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspTradingAccountPasswordUpdat, __pyx_k_OnRspTradingAccountPasswordUpdat, sizeof(__pyx_k_OnRspTradingAccountPasswordUpdat), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspUserLogin, __pyx_k_OnRspUserLogin, sizeof(__pyx_k_OnRspUserLogin), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspUserLogin, __pyx_k_OnRspUserLogin, sizeof(__pyx_k_OnRspUserLogin), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspUserLogout, __pyx_k_OnRspUserLogout, sizeof(__pyx_k_OnRspUserLogout), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspUserLogout, __pyx_k_OnRspUserLogout, sizeof(__pyx_k_OnRspUserLogout), 0, 1, 0, 1},
  {&__pyx_n_s_OnRspUserPasswordUpdate, __pyx_k_OnRspUserPasswordUpdate, sizeof(__pyx_k_OnRspUserPasswordUpdate), 0, 0, 1, 1},
  {&__pyx_n_u_OnRspUserPasswordUpdate, __pyx_k_OnRspUserPasswordUpdate, sizeof(__pyx_k_OnRspUserPasswordUpdate), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnBulletin, __pyx_k_OnRtnBulletin, sizeof(__pyx_k_OnRtnBulletin), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnBulletin, __pyx_k_OnRtnBulletin, sizeof(__pyx_k_OnRtnBulletin), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnCFMMCTradingAccountToken, __pyx_k_OnRtnCFMMCTradingAccountToken, sizeof(__pyx_k_OnRtnCFMMCTradingAccountToken), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnCFMMCTradingAccountToken, __pyx_k_OnRtnCFMMCTradingAccountToken, sizeof(__pyx_k_OnRtnCFMMCTradingAccountToken), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnCancelAccountByBank, __pyx_k_OnRtnCancelAccountByBank, sizeof(__pyx_k_OnRtnCancelAccountByBank), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnCancelAccountByBank, __pyx_k_OnRtnCancelAccountByBank, sizeof(__pyx_k_OnRtnCancelAccountByBank), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnChangeAccountByBank, __pyx_k_OnRtnChangeAccountByBank, sizeof(__pyx_k_OnRtnChangeAccountByBank), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnChangeAccountByBank, __pyx_k_OnRtnChangeAccountByBank, sizeof(__pyx_k_OnRtnChangeAccountByBank), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnCombAction, __pyx_k_OnRtnCombAction, sizeof(__pyx_k_OnRtnCombAction), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnCombAction, __pyx_k_OnRtnCombAction, sizeof(__pyx_k_OnRtnCombAction), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnErrorConditionalOrder, __pyx_k_OnRtnErrorConditionalOrder, sizeof(__pyx_k_OnRtnErrorConditionalOrder), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnErrorConditionalOrder, __pyx_k_OnRtnErrorConditionalOrder, sizeof(__pyx_k_OnRtnErrorConditionalOrder), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnExecOrder, __pyx_k_OnRtnExecOrder, sizeof(__pyx_k_OnRtnExecOrder), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnExecOrder, __pyx_k_OnRtnExecOrder, sizeof(__pyx_k_OnRtnExecOrder), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnForQuoteRsp, __pyx_k_OnRtnForQuoteRsp, sizeof(__pyx_k_OnRtnForQuoteRsp), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnForQuoteRsp, __pyx_k_OnRtnForQuoteRsp, sizeof(__pyx_k_OnRtnForQuoteRsp), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnFromBankToFutureByBank, __pyx_k_OnRtnFromBankToFutureByBank, sizeof(__pyx_k_OnRtnFromBankToFutureByBank), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnFromBankToFutureByBank, __pyx_k_OnRtnFromBankToFutureByBank, sizeof(__pyx_k_OnRtnFromBankToFutureByBank), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnFromBankToFutureByFuture, __pyx_k_OnRtnFromBankToFutureByFuture, sizeof(__pyx_k_OnRtnFromBankToFutureByFuture), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnFromBankToFutureByFuture, __pyx_k_OnRtnFromBankToFutureByFuture, sizeof(__pyx_k_OnRtnFromBankToFutureByFuture), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnFromFutureToBankByBank, __pyx_k_OnRtnFromFutureToBankByBank, sizeof(__pyx_k_OnRtnFromFutureToBankByBank), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnFromFutureToBankByBank, __pyx_k_OnRtnFromFutureToBankByBank, sizeof(__pyx_k_OnRtnFromFutureToBankByBank), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnFromFutureToBankByFuture, __pyx_k_OnRtnFromFutureToBankByFuture, sizeof(__pyx_k_OnRtnFromFutureToBankByFuture), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnFromFutureToBankByFuture, __pyx_k_OnRtnFromFutureToBankByFuture, sizeof(__pyx_k_OnRtnFromFutureToBankByFuture), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnInstrumentStatus, __pyx_k_OnRtnInstrumentStatus, sizeof(__pyx_k_OnRtnInstrumentStatus), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnInstrumentStatus, __pyx_k_OnRtnInstrumentStatus, sizeof(__pyx_k_OnRtnInstrumentStatus), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnOpenAccountByBank, __pyx_k_OnRtnOpenAccountByBank, sizeof(__pyx_k_OnRtnOpenAccountByBank), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnOpenAccountByBank, __pyx_k_OnRtnOpenAccountByBank, sizeof(__pyx_k_OnRtnOpenAccountByBank), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnOptionSelfClose, __pyx_k_OnRtnOptionSelfClose, sizeof(__pyx_k_OnRtnOptionSelfClose), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnOptionSelfClose, __pyx_k_OnRtnOptionSelfClose, sizeof(__pyx_k_OnRtnOptionSelfClose), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnOrder, __pyx_k_OnRtnOrder, sizeof(__pyx_k_OnRtnOrder), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnOrder, __pyx_k_OnRtnOrder, sizeof(__pyx_k_OnRtnOrder), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnQueryBankBalanceByFuture, __pyx_k_OnRtnQueryBankBalanceByFuture, sizeof(__pyx_k_OnRtnQueryBankBalanceByFuture), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnQueryBankBalanceByFuture, __pyx_k_OnRtnQueryBankBalanceByFuture, sizeof(__pyx_k_OnRtnQueryBankBalanceByFuture), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnQuote, __pyx_k_OnRtnQuote, sizeof(__pyx_k_OnRtnQuote), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnQuote, __pyx_k_OnRtnQuote, sizeof(__pyx_k_OnRtnQuote), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnRepealFromBankToFutureByBan, __pyx_k_OnRtnRepealFromBankToFutureByBan, sizeof(__pyx_k_OnRtnRepealFromBankToFutureByBan), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnRepealFromBankToFutureByBan, __pyx_k_OnRtnRepealFromBankToFutureByBan, sizeof(__pyx_k_OnRtnRepealFromBankToFutureByBan), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnRepealFromBankToFutureByFut, __pyx_k_OnRtnRepealFromBankToFutureByFut, sizeof(__pyx_k_OnRtnRepealFromBankToFutureByFut), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnRepealFromBankToFutureByFut, __pyx_k_OnRtnRepealFromBankToFutureByFut, sizeof(__pyx_k_OnRtnRepealFromBankToFutureByFut), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnRepealFromBankToFutureByFut_2, __pyx_k_OnRtnRepealFromBankToFutureByFut_2, sizeof(__pyx_k_OnRtnRepealFromBankToFutureByFut_2), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnRepealFromBankToFutureByFut_2, __pyx_k_OnRtnRepealFromBankToFutureByFut_2, sizeof(__pyx_k_OnRtnRepealFromBankToFutureByFut_2), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnRepealFromFutureToBankByBan, __pyx_k_OnRtnRepealFromFutureToBankByBan, sizeof(__pyx_k_OnRtnRepealFromFutureToBankByBan), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnRepealFromFutureToBankByBan, __pyx_k_OnRtnRepealFromFutureToBankByBan, sizeof(__pyx_k_OnRtnRepealFromFutureToBankByBan), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnRepealFromFutureToBankByFut, __pyx_k_OnRtnRepealFromFutureToBankByFut, sizeof(__pyx_k_OnRtnRepealFromFutureToBankByFut), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnRepealFromFutureToBankByFut, __pyx_k_OnRtnRepealFromFutureToBankByFut, sizeof(__pyx_k_OnRtnRepealFromFutureToBankByFut), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnRepealFromFutureToBankByFut_2, __pyx_k_OnRtnRepealFromFutureToBankByFut_2, sizeof(__pyx_k_OnRtnRepealFromFutureToBankByFut_2), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnRepealFromFutureToBankByFut_2, __pyx_k_OnRtnRepealFromFutureToBankByFut_2, sizeof(__pyx_k_OnRtnRepealFromFutureToBankByFut_2), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnTrade, __pyx_k_OnRtnTrade, sizeof(__pyx_k_OnRtnTrade), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnTrade, __pyx_k_OnRtnTrade, sizeof(__pyx_k_OnRtnTrade), 0, 1, 0, 1},
  {&__pyx_n_s_OnRtnTradingNotice, __pyx_k_OnRtnTradingNotice, sizeof(__pyx_k_OnRtnTradingNotice), 0, 0, 1, 1},
  {&__pyx_n_u_OnRtnTradingNotice, __pyx_k_OnRtnTradingNotice, sizeof(__pyx_k_OnRtnTradingNotice), 0, 1, 0, 1},
  {&__pyx_n_s_OpenAccountField, __pyx_k_OpenAccountField, sizeof(__pyx_k_OpenAccountField), 0, 0, 1, 1},
  {&__pyx_n_s_OptionInstrCommRateField, __pyx_k_OptionInstrCommRateField, sizeof(__pyx_k_OptionInstrCommRateField), 0, 0, 1, 1},
  {&__pyx_n_s_OptionInstrTradeCostField, __pyx_k_OptionInstrTradeCostField, sizeof(__pyx_k_OptionInstrTradeCostField), 0, 0, 1, 1},
  {&__pyx_n_s_OptionSelfCloseActionField, __pyx_k_OptionSelfCloseActionField, sizeof(__pyx_k_OptionSelfCloseActionField), 0, 0, 1, 1},
  {&__pyx_n_s_OptionSelfCloseField, __pyx_k_OptionSelfCloseField, sizeof(__pyx_k_OptionSelfCloseField), 0, 0, 1, 1},
  {&__pyx_n_s_OrderActionField, __pyx_k_OrderActionField, sizeof(__pyx_k_OrderActionField), 0, 0, 1, 1},
  {&__pyx_n_s_OrderField, __pyx_k_OrderField, sizeof(__pyx_k_OrderField), 0, 0, 1, 1},
  {&__pyx_n_s_ParkedOrderActionField, __pyx_k_ParkedOrderActionField, sizeof(__pyx_k_ParkedOrderActionField), 0, 0, 1, 1},
  {&__pyx_n_s_ParkedOrderField, __pyx_k_ParkedOrderField, sizeof(__pyx_k_ParkedOrderField), 0, 0, 1, 1},
  {&__pyx_n_s_PrivateSubscribeTopic, __pyx_k_PrivateSubscribeTopic, sizeof(__pyx_k_PrivateSubscribeTopic), 0, 0, 1, 1},
  {&__pyx_n_s_ProductExchRateField, __pyx_k_ProductExchRateField, sizeof(__pyx_k_ProductExchRateField), 0, 0, 1, 1},
  {&__pyx_n_s_ProductField, __pyx_k_ProductField, sizeof(__pyx_k_ProductField), 0, 0, 1, 1},
  {&__pyx_n_s_ProductGroupField, __pyx_k_ProductGroupField, sizeof(__pyx_k_ProductGroupField), 0, 0, 1, 1},
  {&__pyx_n_s_PublicSubscribeTopic, __pyx_k_PublicSubscribeTopic, sizeof(__pyx_k_PublicSubscribeTopic), 0, 0, 1, 1},
  {&__pyx_n_s_QueryCFMMCTradingAccountTokenFie, __pyx_k_QueryCFMMCTradingAccountTokenFie, sizeof(__pyx_k_QueryCFMMCTradingAccountTokenFie), 0, 0, 1, 1},
  {&__pyx_n_s_QueryMaxOrderVolumeField, __pyx_k_QueryMaxOrderVolumeField, sizeof(__pyx_k_QueryMaxOrderVolumeField), 0, 0, 1, 1},
  {&__pyx_n_s_QuoteActionField, __pyx_k_QuoteActionField, sizeof(__pyx_k_QuoteActionField), 0, 0, 1, 1},
  {&__pyx_n_s_QuoteField, __pyx_k_QuoteField, sizeof(__pyx_k_QuoteField), 0, 0, 1, 1},
  {&__pyx_n_s_RegisterFensUserInfo, __pyx_k_RegisterFensUserInfo, sizeof(__pyx_k_RegisterFensUserInfo), 0, 0, 1, 1},
  {&__pyx_n_u_RegisterFensUserInfo, __pyx_k_RegisterFensUserInfo, sizeof(__pyx_k_RegisterFensUserInfo), 0, 1, 0, 1},
  {&__pyx_n_s_RegisterFront, __pyx_k_RegisterFront, sizeof(__pyx_k_RegisterFront), 0, 0, 1, 1},
  {&__pyx_n_u_RegisterFront, __pyx_k_RegisterFront, sizeof(__pyx_k_RegisterFront), 0, 1, 0, 1},
  {&__pyx_n_s_RegisterNameServer, __pyx_k_RegisterNameServer, sizeof(__pyx_k_RegisterNameServer), 0, 0, 1, 1},
  {&__pyx_n_u_RegisterNameServer, __pyx_k_RegisterNameServer, sizeof(__pyx_k_RegisterNameServer), 0, 1, 0, 1},
  {&__pyx_n_s_Release, __pyx_k_Release, sizeof(__pyx_k_Release), 0, 0, 1, 1},
  {&__pyx_n_s_RemoveParkedOrderActionField, __pyx_k_RemoveParkedOrderActionField, sizeof(__pyx_k_RemoveParkedOrderActionField), 0, 0, 1, 1},
  {&__pyx_n_s_RemoveParkedOrderField, __pyx_k_RemoveParkedOrderField, sizeof(__pyx_k_RemoveParkedOrderField), 0, 0, 1, 1},
  {&__pyx_n_s_ReqAuthenticate, __pyx_k_ReqAuthenticate, sizeof(__pyx_k_ReqAuthenticate), 0, 0, 1, 1},
  {&__pyx_n_u_ReqAuthenticate, __pyx_k_ReqAuthenticate, sizeof(__pyx_k_ReqAuthenticate), 0, 1, 0, 1},
  {&__pyx_n_s_ReqBatchOrderAction, __pyx_k_ReqBatchOrderAction, sizeof(__pyx_k_ReqBatchOrderAction), 0, 0, 1, 1},
  {&__pyx_n_u_ReqBatchOrderAction, __pyx_k_ReqBatchOrderAction, sizeof(__pyx_k_ReqBatchOrderAction), 0, 1, 0, 1},
  {&__pyx_n_s_ReqCombActionInsert, __pyx_k_ReqCombActionInsert, sizeof(__pyx_k_ReqCombActionInsert), 0, 0, 1, 1},
  {&__pyx_n_u_ReqCombActionInsert, __pyx_k_ReqCombActionInsert, sizeof(__pyx_k_ReqCombActionInsert), 0, 1, 0, 1},
  {&__pyx_n_s_ReqExecOrderAction, __pyx_k_ReqExecOrderAction, sizeof(__pyx_k_ReqExecOrderAction), 0, 0, 1, 1},
  {&__pyx_n_u_ReqExecOrderAction, __pyx_k_ReqExecOrderAction, sizeof(__pyx_k_ReqExecOrderAction), 0, 1, 0, 1},
  {&__pyx_n_s_ReqExecOrderInsert, __pyx_k_ReqExecOrderInsert, sizeof(__pyx_k_ReqExecOrderInsert), 0, 0, 1, 1},
  {&__pyx_n_u_ReqExecOrderInsert, __pyx_k_ReqExecOrderInsert, sizeof(__pyx_k_ReqExecOrderInsert), 0, 1, 0, 1},
  {&__pyx_n_s_ReqForQuoteInsert, __pyx_k_ReqForQuoteInsert, sizeof(__pyx_k_ReqForQuoteInsert), 0, 0, 1, 1},
  {&__pyx_n_u_ReqForQuoteInsert, __pyx_k_ReqForQuoteInsert, sizeof(__pyx_k_ReqForQuoteInsert), 0, 1, 0, 1},
  {&__pyx_n_s_ReqFromBankToFutureByFuture, __pyx_k_ReqFromBankToFutureByFuture, sizeof(__pyx_k_ReqFromBankToFutureByFuture), 0, 0, 1, 1},
  {&__pyx_n_u_ReqFromBankToFutureByFuture, __pyx_k_ReqFromBankToFutureByFuture, sizeof(__pyx_k_ReqFromBankToFutureByFuture), 0, 1, 0, 1},
  {&__pyx_n_s_ReqFromFutureToBankByFuture, __pyx_k_ReqFromFutureToBankByFuture, sizeof(__pyx_k_ReqFromFutureToBankByFuture), 0, 0, 1, 1},
  {&__pyx_n_u_ReqFromFutureToBankByFuture, __pyx_k_ReqFromFutureToBankByFuture, sizeof(__pyx_k_ReqFromFutureToBankByFuture), 0, 1, 0, 1},
  {&__pyx_n_s_ReqOptionSelfCloseAction, __pyx_k_ReqOptionSelfCloseAction, sizeof(__pyx_k_ReqOptionSelfCloseAction), 0, 0, 1, 1},
  {&__pyx_n_u_ReqOptionSelfCloseAction, __pyx_k_ReqOptionSelfCloseAction, sizeof(__pyx_k_ReqOptionSelfCloseAction), 0, 1, 0, 1},
  {&__pyx_n_s_ReqOptionSelfCloseInsert, __pyx_k_ReqOptionSelfCloseInsert, sizeof(__pyx_k_ReqOptionSelfCloseInsert), 0, 0, 1, 1},
  {&__pyx_n_u_ReqOptionSelfCloseInsert, __pyx_k_ReqOptionSelfCloseInsert, sizeof(__pyx_k_ReqOptionSelfCloseInsert), 0, 1, 0, 1},
  {&__pyx_n_s_ReqOrderAction, __pyx_k_ReqOrderAction, sizeof(__pyx_k_ReqOrderAction), 0, 0, 1, 1},
  {&__pyx_n_u_ReqOrderAction, __pyx_k_ReqOrderAction, sizeof(__pyx_k_ReqOrderAction), 0, 1, 0, 1},
  {&__pyx_n_s_ReqOrderInsert, __pyx_k_ReqOrderInsert, sizeof(__pyx_k_ReqOrderInsert), 0, 0, 1, 1},
  {&__pyx_n_u_ReqOrderInsert, __pyx_k_ReqOrderInsert, sizeof(__pyx_k_ReqOrderInsert), 0, 1, 0, 1},
  {&__pyx_n_s_ReqParkedOrderAction, __pyx_k_ReqParkedOrderAction, sizeof(__pyx_k_ReqParkedOrderAction), 0, 0, 1, 1},
  {&__pyx_n_u_ReqParkedOrderAction, __pyx_k_ReqParkedOrderAction, sizeof(__pyx_k_ReqParkedOrderAction), 0, 1, 0, 1},
  {&__pyx_n_s_ReqParkedOrderInsert, __pyx_k_ReqParkedOrderInsert, sizeof(__pyx_k_ReqParkedOrderInsert), 0, 0, 1, 1},
  {&__pyx_n_u_ReqParkedOrderInsert, __pyx_k_ReqParkedOrderInsert, sizeof(__pyx_k_ReqParkedOrderInsert), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryAccountregister, __pyx_k_ReqQryAccountregister, sizeof(__pyx_k_ReqQryAccountregister), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryAccountregister, __pyx_k_ReqQryAccountregister, sizeof(__pyx_k_ReqQryAccountregister), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryBrokerTradingAlgos, __pyx_k_ReqQryBrokerTradingAlgos, sizeof(__pyx_k_ReqQryBrokerTradingAlgos), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryBrokerTradingAlgos, __pyx_k_ReqQryBrokerTradingAlgos, sizeof(__pyx_k_ReqQryBrokerTradingAlgos), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryBrokerTradingParams, __pyx_k_ReqQryBrokerTradingParams, sizeof(__pyx_k_ReqQryBrokerTradingParams), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryBrokerTradingParams, __pyx_k_ReqQryBrokerTradingParams, sizeof(__pyx_k_ReqQryBrokerTradingParams), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryCFMMCTradingAccountKey, __pyx_k_ReqQryCFMMCTradingAccountKey, sizeof(__pyx_k_ReqQryCFMMCTradingAccountKey), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryCFMMCTradingAccountKey, __pyx_k_ReqQryCFMMCTradingAccountKey, sizeof(__pyx_k_ReqQryCFMMCTradingAccountKey), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryCombAction, __pyx_k_ReqQryCombAction, sizeof(__pyx_k_ReqQryCombAction), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryCombAction, __pyx_k_ReqQryCombAction, sizeof(__pyx_k_ReqQryCombAction), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryCombInstrumentGuard, __pyx_k_ReqQryCombInstrumentGuard, sizeof(__pyx_k_ReqQryCombInstrumentGuard), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryCombInstrumentGuard, __pyx_k_ReqQryCombInstrumentGuard, sizeof(__pyx_k_ReqQryCombInstrumentGuard), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryContractBank, __pyx_k_ReqQryContractBank, sizeof(__pyx_k_ReqQryContractBank), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryContractBank, __pyx_k_ReqQryContractBank, sizeof(__pyx_k_ReqQryContractBank), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryDepthMarketData, __pyx_k_ReqQryDepthMarketData, sizeof(__pyx_k_ReqQryDepthMarketData), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryDepthMarketData, __pyx_k_ReqQryDepthMarketData, sizeof(__pyx_k_ReqQryDepthMarketData), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryEWarrantOffset, __pyx_k_ReqQryEWarrantOffset, sizeof(__pyx_k_ReqQryEWarrantOffset), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryEWarrantOffset, __pyx_k_ReqQryEWarrantOffset, sizeof(__pyx_k_ReqQryEWarrantOffset), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryExchange, __pyx_k_ReqQryExchange, sizeof(__pyx_k_ReqQryExchange), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryExchange, __pyx_k_ReqQryExchange, sizeof(__pyx_k_ReqQryExchange), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryExchangeMarginRate, __pyx_k_ReqQryExchangeMarginRate, sizeof(__pyx_k_ReqQryExchangeMarginRate), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryExchangeMarginRate, __pyx_k_ReqQryExchangeMarginRate, sizeof(__pyx_k_ReqQryExchangeMarginRate), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryExchangeMarginRateAdjust, __pyx_k_ReqQryExchangeMarginRateAdjust, sizeof(__pyx_k_ReqQryExchangeMarginRateAdjust), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryExchangeMarginRateAdjust, __pyx_k_ReqQryExchangeMarginRateAdjust, sizeof(__pyx_k_ReqQryExchangeMarginRateAdjust), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryExchangeRate, __pyx_k_ReqQryExchangeRate, sizeof(__pyx_k_ReqQryExchangeRate), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryExchangeRate, __pyx_k_ReqQryExchangeRate, sizeof(__pyx_k_ReqQryExchangeRate), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryExecOrder, __pyx_k_ReqQryExecOrder, sizeof(__pyx_k_ReqQryExecOrder), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryExecOrder, __pyx_k_ReqQryExecOrder, sizeof(__pyx_k_ReqQryExecOrder), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryForQuote, __pyx_k_ReqQryForQuote, sizeof(__pyx_k_ReqQryForQuote), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryForQuote, __pyx_k_ReqQryForQuote, sizeof(__pyx_k_ReqQryForQuote), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryInstrument, __pyx_k_ReqQryInstrument, sizeof(__pyx_k_ReqQryInstrument), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryInstrument, __pyx_k_ReqQryInstrument, sizeof(__pyx_k_ReqQryInstrument), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryInstrumentCommissionRate, __pyx_k_ReqQryInstrumentCommissionRate, sizeof(__pyx_k_ReqQryInstrumentCommissionRate), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryInstrumentCommissionRate, __pyx_k_ReqQryInstrumentCommissionRate, sizeof(__pyx_k_ReqQryInstrumentCommissionRate), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryInstrumentMarginRate, __pyx_k_ReqQryInstrumentMarginRate, sizeof(__pyx_k_ReqQryInstrumentMarginRate), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryInstrumentMarginRate, __pyx_k_ReqQryInstrumentMarginRate, sizeof(__pyx_k_ReqQryInstrumentMarginRate), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryInstrumentOrderCommRate, __pyx_k_ReqQryInstrumentOrderCommRate, sizeof(__pyx_k_ReqQryInstrumentOrderCommRate), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryInstrumentOrderCommRate, __pyx_k_ReqQryInstrumentOrderCommRate, sizeof(__pyx_k_ReqQryInstrumentOrderCommRate), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryInvestUnit, __pyx_k_ReqQryInvestUnit, sizeof(__pyx_k_ReqQryInvestUnit), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryInvestUnit, __pyx_k_ReqQryInvestUnit, sizeof(__pyx_k_ReqQryInvestUnit), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryInvestor, __pyx_k_ReqQryInvestor, sizeof(__pyx_k_ReqQryInvestor), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryInvestor, __pyx_k_ReqQryInvestor, sizeof(__pyx_k_ReqQryInvestor), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryInvestorPosition, __pyx_k_ReqQryInvestorPosition, sizeof(__pyx_k_ReqQryInvestorPosition), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryInvestorPosition, __pyx_k_ReqQryInvestorPosition, sizeof(__pyx_k_ReqQryInvestorPosition), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryInvestorPositionCombineDet, __pyx_k_ReqQryInvestorPositionCombineDet, sizeof(__pyx_k_ReqQryInvestorPositionCombineDet), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryInvestorPositionCombineDet, __pyx_k_ReqQryInvestorPositionCombineDet, sizeof(__pyx_k_ReqQryInvestorPositionCombineDet), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryInvestorPositionDetail, __pyx_k_ReqQryInvestorPositionDetail, sizeof(__pyx_k_ReqQryInvestorPositionDetail), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryInvestorPositionDetail, __pyx_k_ReqQryInvestorPositionDetail, sizeof(__pyx_k_ReqQryInvestorPositionDetail), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryInvestorProductGroupMargin, __pyx_k_ReqQryInvestorProductGroupMargin, sizeof(__pyx_k_ReqQryInvestorProductGroupMargin), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryInvestorProductGroupMargin, __pyx_k_ReqQryInvestorProductGroupMargin, sizeof(__pyx_k_ReqQryInvestorProductGroupMargin), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryMMInstrumentCommissionRate, __pyx_k_ReqQryMMInstrumentCommissionRate, sizeof(__pyx_k_ReqQryMMInstrumentCommissionRate), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryMMInstrumentCommissionRate, __pyx_k_ReqQryMMInstrumentCommissionRate, sizeof(__pyx_k_ReqQryMMInstrumentCommissionRate), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryMMOptionInstrCommRate, __pyx_k_ReqQryMMOptionInstrCommRate, sizeof(__pyx_k_ReqQryMMOptionInstrCommRate), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryMMOptionInstrCommRate, __pyx_k_ReqQryMMOptionInstrCommRate, sizeof(__pyx_k_ReqQryMMOptionInstrCommRate), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryNotice, __pyx_k_ReqQryNotice, sizeof(__pyx_k_ReqQryNotice), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryNotice, __pyx_k_ReqQryNotice, sizeof(__pyx_k_ReqQryNotice), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryOptionInstrCommRate, __pyx_k_ReqQryOptionInstrCommRate, sizeof(__pyx_k_ReqQryOptionInstrCommRate), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryOptionInstrCommRate, __pyx_k_ReqQryOptionInstrCommRate, sizeof(__pyx_k_ReqQryOptionInstrCommRate), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryOptionInstrTradeCost, __pyx_k_ReqQryOptionInstrTradeCost, sizeof(__pyx_k_ReqQryOptionInstrTradeCost), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryOptionInstrTradeCost, __pyx_k_ReqQryOptionInstrTradeCost, sizeof(__pyx_k_ReqQryOptionInstrTradeCost), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryOptionSelfClose, __pyx_k_ReqQryOptionSelfClose, sizeof(__pyx_k_ReqQryOptionSelfClose), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryOptionSelfClose, __pyx_k_ReqQryOptionSelfClose, sizeof(__pyx_k_ReqQryOptionSelfClose), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryOrder, __pyx_k_ReqQryOrder, sizeof(__pyx_k_ReqQryOrder), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryOrder, __pyx_k_ReqQryOrder, sizeof(__pyx_k_ReqQryOrder), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryParkedOrder, __pyx_k_ReqQryParkedOrder, sizeof(__pyx_k_ReqQryParkedOrder), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryParkedOrder, __pyx_k_ReqQryParkedOrder, sizeof(__pyx_k_ReqQryParkedOrder), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryParkedOrderAction, __pyx_k_ReqQryParkedOrderAction, sizeof(__pyx_k_ReqQryParkedOrderAction), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryParkedOrderAction, __pyx_k_ReqQryParkedOrderAction, sizeof(__pyx_k_ReqQryParkedOrderAction), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryProduct, __pyx_k_ReqQryProduct, sizeof(__pyx_k_ReqQryProduct), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryProduct, __pyx_k_ReqQryProduct, sizeof(__pyx_k_ReqQryProduct), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryProductExchRate, __pyx_k_ReqQryProductExchRate, sizeof(__pyx_k_ReqQryProductExchRate), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryProductExchRate, __pyx_k_ReqQryProductExchRate, sizeof(__pyx_k_ReqQryProductExchRate), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryProductGroup, __pyx_k_ReqQryProductGroup, sizeof(__pyx_k_ReqQryProductGroup), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryProductGroup, __pyx_k_ReqQryProductGroup, sizeof(__pyx_k_ReqQryProductGroup), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryQuote, __pyx_k_ReqQryQuote, sizeof(__pyx_k_ReqQryQuote), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryQuote, __pyx_k_ReqQryQuote, sizeof(__pyx_k_ReqQryQuote), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQrySecAgentACIDMap, __pyx_k_ReqQrySecAgentACIDMap, sizeof(__pyx_k_ReqQrySecAgentACIDMap), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQrySecAgentACIDMap, __pyx_k_ReqQrySecAgentACIDMap, sizeof(__pyx_k_ReqQrySecAgentACIDMap), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQrySecAgentCheckMode, __pyx_k_ReqQrySecAgentCheckMode, sizeof(__pyx_k_ReqQrySecAgentCheckMode), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQrySecAgentCheckMode, __pyx_k_ReqQrySecAgentCheckMode, sizeof(__pyx_k_ReqQrySecAgentCheckMode), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQrySecAgentTradingAccount, __pyx_k_ReqQrySecAgentTradingAccount, sizeof(__pyx_k_ReqQrySecAgentTradingAccount), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQrySecAgentTradingAccount, __pyx_k_ReqQrySecAgentTradingAccount, sizeof(__pyx_k_ReqQrySecAgentTradingAccount), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQrySettlementInfo, __pyx_k_ReqQrySettlementInfo, sizeof(__pyx_k_ReqQrySettlementInfo), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQrySettlementInfo, __pyx_k_ReqQrySettlementInfo, sizeof(__pyx_k_ReqQrySettlementInfo), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQrySettlementInfoConfirm, __pyx_k_ReqQrySettlementInfoConfirm, sizeof(__pyx_k_ReqQrySettlementInfoConfirm), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQrySettlementInfoConfirm, __pyx_k_ReqQrySettlementInfoConfirm, sizeof(__pyx_k_ReqQrySettlementInfoConfirm), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryTrade, __pyx_k_ReqQryTrade, sizeof(__pyx_k_ReqQryTrade), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryTrade, __pyx_k_ReqQryTrade, sizeof(__pyx_k_ReqQryTrade), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryTradingAccount, __pyx_k_ReqQryTradingAccount, sizeof(__pyx_k_ReqQryTradingAccount), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryTradingAccount, __pyx_k_ReqQryTradingAccount, sizeof(__pyx_k_ReqQryTradingAccount), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryTradingCode, __pyx_k_ReqQryTradingCode, sizeof(__pyx_k_ReqQryTradingCode), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryTradingCode, __pyx_k_ReqQryTradingCode, sizeof(__pyx_k_ReqQryTradingCode), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryTradingNotice, __pyx_k_ReqQryTradingNotice, sizeof(__pyx_k_ReqQryTradingNotice), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryTradingNotice, __pyx_k_ReqQryTradingNotice, sizeof(__pyx_k_ReqQryTradingNotice), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryTransferBank, __pyx_k_ReqQryTransferBank, sizeof(__pyx_k_ReqQryTransferBank), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryTransferBank, __pyx_k_ReqQryTransferBank, sizeof(__pyx_k_ReqQryTransferBank), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQryTransferSerial, __pyx_k_ReqQryTransferSerial, sizeof(__pyx_k_ReqQryTransferSerial), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQryTransferSerial, __pyx_k_ReqQryTransferSerial, sizeof(__pyx_k_ReqQryTransferSerial), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQueryAccountField, __pyx_k_ReqQueryAccountField, sizeof(__pyx_k_ReqQueryAccountField), 0, 0, 1, 1},
  {&__pyx_n_s_ReqQueryBankAccountMoneyByFuture, __pyx_k_ReqQueryBankAccountMoneyByFuture, sizeof(__pyx_k_ReqQueryBankAccountMoneyByFuture), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQueryBankAccountMoneyByFuture, __pyx_k_ReqQueryBankAccountMoneyByFuture, sizeof(__pyx_k_ReqQueryBankAccountMoneyByFuture), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQueryCFMMCTradingAccountToken, __pyx_k_ReqQueryCFMMCTradingAccountToken, sizeof(__pyx_k_ReqQueryCFMMCTradingAccountToken), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQueryCFMMCTradingAccountToken, __pyx_k_ReqQueryCFMMCTradingAccountToken, sizeof(__pyx_k_ReqQueryCFMMCTradingAccountToken), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQueryMaxOrderVolume, __pyx_k_ReqQueryMaxOrderVolume, sizeof(__pyx_k_ReqQueryMaxOrderVolume), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQueryMaxOrderVolume, __pyx_k_ReqQueryMaxOrderVolume, sizeof(__pyx_k_ReqQueryMaxOrderVolume), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQuoteAction, __pyx_k_ReqQuoteAction, sizeof(__pyx_k_ReqQuoteAction), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQuoteAction, __pyx_k_ReqQuoteAction, sizeof(__pyx_k_ReqQuoteAction), 0, 1, 0, 1},
  {&__pyx_n_s_ReqQuoteInsert, __pyx_k_ReqQuoteInsert, sizeof(__pyx_k_ReqQuoteInsert), 0, 0, 1, 1},
  {&__pyx_n_u_ReqQuoteInsert, __pyx_k_ReqQuoteInsert, sizeof(__pyx_k_ReqQuoteInsert), 0, 1, 0, 1},
  {&__pyx_n_s_ReqRemoveParkedOrder, __pyx_k_ReqRemoveParkedOrder, sizeof(__pyx_k_ReqRemoveParkedOrder), 0, 0, 1, 1},
  {&__pyx_n_u_ReqRemoveParkedOrder, __pyx_k_ReqRemoveParkedOrder, sizeof(__pyx_k_ReqRemoveParkedOrder), 0, 1, 0, 1},
  {&__pyx_n_s_ReqRemoveParkedOrderAction, __pyx_k_ReqRemoveParkedOrderAction, sizeof(__pyx_k_ReqRemoveParkedOrderAction), 0, 0, 1, 1},
  {&__pyx_n_u_ReqRemoveParkedOrderAction, __pyx_k_ReqRemoveParkedOrderAction, sizeof(__pyx_k_ReqRemoveParkedOrderAction), 0, 1, 0, 1},
  {&__pyx_n_s_ReqRepealField, __pyx_k_ReqRepealField, sizeof(__pyx_k_ReqRepealField), 0, 0, 1, 1},
  {&__pyx_n_s_ReqSettlementInfoConfirm, __pyx_k_ReqSettlementInfoConfirm, sizeof(__pyx_k_ReqSettlementInfoConfirm), 0, 0, 1, 1},
  {&__pyx_n_u_ReqSettlementInfoConfirm, __pyx_k_ReqSettlementInfoConfirm, sizeof(__pyx_k_ReqSettlementInfoConfirm), 0, 1, 0, 1},
  {&__pyx_n_s_ReqTradingAccountPasswordUpdate, __pyx_k_ReqTradingAccountPasswordUpdate, sizeof(__pyx_k_ReqTradingAccountPasswordUpdate), 0, 0, 1, 1},
  {&__pyx_n_u_ReqTradingAccountPasswordUpdate, __pyx_k_ReqTradingAccountPasswordUpdate, sizeof(__pyx_k_ReqTradingAccountPasswordUpdate), 0, 1, 0, 1},
  {&__pyx_n_s_ReqTransferField, __pyx_k_ReqTransferField, sizeof(__pyx_k_ReqTransferField), 0, 0, 1, 1},
  {&__pyx_n_s_ReqUserLogin, __pyx_k_ReqUserLogin, sizeof(__pyx_k_ReqUserLogin), 0, 0, 1, 1},
  {&__pyx_n_u_ReqUserLogin, __pyx_k_ReqUserLogin, sizeof(__pyx_k_ReqUserLogin), 0, 1, 0, 1},
  {&__pyx_n_s_ReqUserLogin2, __pyx_k_ReqUserLogin2, sizeof(__pyx_k_ReqUserLogin2), 0, 0, 1, 1},
  {&__pyx_n_u_ReqUserLogin2, __pyx_k_ReqUserLogin2, sizeof(__pyx_k_ReqUserLogin2), 0, 1, 0, 1},
  {&__pyx_n_s_ReqUserLogout, __pyx_k_ReqUserLogout, sizeof(__pyx_k_ReqUserLogout), 0, 0, 1, 1},
  {&__pyx_n_u_ReqUserLogout, __pyx_k_ReqUserLogout, sizeof(__pyx_k_ReqUserLogout), 0, 1, 0, 1},
  {&__pyx_n_s_ReqUserPasswordUpdate, __pyx_k_ReqUserPasswordUpdate, sizeof(__pyx_k_ReqUserPasswordUpdate), 0, 0, 1, 1},
  {&__pyx_n_u_ReqUserPasswordUpdate, __pyx_k_ReqUserPasswordUpdate, sizeof(__pyx_k_ReqUserPasswordUpdate), 0, 1, 0, 1},
  {&__pyx_n_s_ReqUserPasswordUpdate2, __pyx_k_ReqUserPasswordUpdate2, sizeof(__pyx_k_ReqUserPasswordUpdate2), 0, 0, 1, 1},
  {&__pyx_n_u_ReqUserPasswordUpdate2, __pyx_k_ReqUserPasswordUpdate2, sizeof(__pyx_k_ReqUserPasswordUpdate2), 0, 1, 0, 1},
  {&__pyx_n_s_RequestID, __pyx_k_RequestID, sizeof(__pyx_k_RequestID), 0, 0, 1, 1},
  {&__pyx_n_s_RspAuthenticateField, __pyx_k_RspAuthenticateField, sizeof(__pyx_k_RspAuthenticateField), 0, 0, 1, 1},
  {&__pyx_n_s_RspInfoField, __pyx_k_RspInfoField, sizeof(__pyx_k_RspInfoField), 0, 0, 1, 1},
  {&__pyx_n_s_RspRepealField, __pyx_k_RspRepealField, sizeof(__pyx_k_RspRepealField), 0, 0, 1, 1},
  {&__pyx_n_s_RspTransferField, __pyx_k_RspTransferField, sizeof(__pyx_k_RspTransferField), 0, 0, 1, 1},
  {&__pyx_n_s_RspUserLoginField, __pyx_k_RspUserLoginField, sizeof(__pyx_k_RspUserLoginField), 0, 0, 1, 1},
  {&__pyx_n_s_SecAgentACIDMapField, __pyx_k_SecAgentACIDMapField, sizeof(__pyx_k_SecAgentACIDMapField), 0, 0, 1, 1},
  {&__pyx_n_s_SecAgentCheckModeField, __pyx_k_SecAgentCheckModeField, sizeof(__pyx_k_SecAgentCheckModeField), 0, 0, 1, 1},
  {&__pyx_n_s_SettlementInfoConfirmField, __pyx_k_SettlementInfoConfirmField, sizeof(__pyx_k_SettlementInfoConfirmField), 0, 0, 1, 1},
  {&__pyx_n_s_SettlementInfoField, __pyx_k_SettlementInfoField, sizeof(__pyx_k_SettlementInfoField), 0, 0, 1, 1},
  {&__pyx_n_s_SubscribePrivateTopic, __pyx_k_SubscribePrivateTopic, sizeof(__pyx_k_SubscribePrivateTopic), 0, 0, 1, 1},
  {&__pyx_n_u_SubscribePrivateTopic, __pyx_k_SubscribePrivateTopic, sizeof(__pyx_k_SubscribePrivateTopic), 0, 1, 0, 1},
  {&__pyx_n_s_SubscribePublicTopic, __pyx_k_SubscribePublicTopic, sizeof(__pyx_k_SubscribePublicTopic), 0, 0, 1, 1},
  {&__pyx_n_u_SubscribePublicTopic, __pyx_k_SubscribePublicTopic, sizeof(__pyx_k_SubscribePublicTopic), 0, 1, 0, 1},
  {&__pyx_kp_u_Tader_Init, __pyx_k_Tader_Init, sizeof(__pyx_k_Tader_Init), 0, 1, 0, 0},
  {&__pyx_n_s_TradeField, __pyx_k_TradeField, sizeof(__pyx_k_TradeField), 0, 0, 1, 1},
  {&__pyx_n_u_Trader, __pyx_k_Trader, sizeof(__pyx_k_Trader), 0, 1, 0, 1},
  {&__pyx_n_u_TraderApiWrapper, __pyx_k_TraderApiWrapper, sizeof(__pyx_k_TraderApiWrapper), 0, 1, 0, 1},
  {&__pyx_n_s_TraderApiWrapper_GetApiVersion, __pyx_k_TraderApiWrapper_GetApiVersion, sizeof(__pyx_k_TraderApiWrapper_GetApiVersion), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_GetTradingDay, __pyx_k_TraderApiWrapper_GetTradingDay, sizeof(__pyx_k_TraderApiWrapper_GetTradingDay), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_Inc_RequestID, __pyx_k_TraderApiWrapper_Inc_RequestID, sizeof(__pyx_k_TraderApiWrapper_Inc_RequestID), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_Init_Base, __pyx_k_TraderApiWrapper_Init_Base, sizeof(__pyx_k_TraderApiWrapper_Init_Base), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_Init_Net, __pyx_k_TraderApiWrapper_Init_Net, sizeof(__pyx_k_TraderApiWrapper_Init_Net), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_Join, __pyx_k_TraderApiWrapper_Join, sizeof(__pyx_k_TraderApiWrapper_Join), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_RegisterFensUse, __pyx_k_TraderApiWrapper_RegisterFensUse, sizeof(__pyx_k_TraderApiWrapper_RegisterFensUse), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_RegisterFront, __pyx_k_TraderApiWrapper_RegisterFront, sizeof(__pyx_k_TraderApiWrapper_RegisterFront), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_RegisterNameSer, __pyx_k_TraderApiWrapper_RegisterNameSer, sizeof(__pyx_k_TraderApiWrapper_RegisterNameSer), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_Release, __pyx_k_TraderApiWrapper_Release, sizeof(__pyx_k_TraderApiWrapper_Release), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqAuthenticate, __pyx_k_TraderApiWrapper_ReqAuthenticate, sizeof(__pyx_k_TraderApiWrapper_ReqAuthenticate), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqBatchOrderAc, __pyx_k_TraderApiWrapper_ReqBatchOrderAc, sizeof(__pyx_k_TraderApiWrapper_ReqBatchOrderAc), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqCombActionIn, __pyx_k_TraderApiWrapper_ReqCombActionIn, sizeof(__pyx_k_TraderApiWrapper_ReqCombActionIn), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqExecOrderAct, __pyx_k_TraderApiWrapper_ReqExecOrderAct, sizeof(__pyx_k_TraderApiWrapper_ReqExecOrderAct), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqExecOrderIns, __pyx_k_TraderApiWrapper_ReqExecOrderIns, sizeof(__pyx_k_TraderApiWrapper_ReqExecOrderIns), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqForQuoteInse, __pyx_k_TraderApiWrapper_ReqForQuoteInse, sizeof(__pyx_k_TraderApiWrapper_ReqForQuoteInse), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqFromBankToFu, __pyx_k_TraderApiWrapper_ReqFromBankToFu, sizeof(__pyx_k_TraderApiWrapper_ReqFromBankToFu), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqFromFutureTo, __pyx_k_TraderApiWrapper_ReqFromFutureTo, sizeof(__pyx_k_TraderApiWrapper_ReqFromFutureTo), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqOptionSelfCl, __pyx_k_TraderApiWrapper_ReqOptionSelfCl, sizeof(__pyx_k_TraderApiWrapper_ReqOptionSelfCl), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqOptionSelfCl_2, __pyx_k_TraderApiWrapper_ReqOptionSelfCl_2, sizeof(__pyx_k_TraderApiWrapper_ReqOptionSelfCl_2), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqOrderAction, __pyx_k_TraderApiWrapper_ReqOrderAction, sizeof(__pyx_k_TraderApiWrapper_ReqOrderAction), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqOrderInsert, __pyx_k_TraderApiWrapper_ReqOrderInsert, sizeof(__pyx_k_TraderApiWrapper_ReqOrderInsert), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqParkedOrderA, __pyx_k_TraderApiWrapper_ReqParkedOrderA, sizeof(__pyx_k_TraderApiWrapper_ReqParkedOrderA), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqParkedOrderI, __pyx_k_TraderApiWrapper_ReqParkedOrderI, sizeof(__pyx_k_TraderApiWrapper_ReqParkedOrderI), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryAccountre, __pyx_k_TraderApiWrapper_ReqQryAccountre, sizeof(__pyx_k_TraderApiWrapper_ReqQryAccountre), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryBrokerTra, __pyx_k_TraderApiWrapper_ReqQryBrokerTra, sizeof(__pyx_k_TraderApiWrapper_ReqQryBrokerTra), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryBrokerTra_2, __pyx_k_TraderApiWrapper_ReqQryBrokerTra_2, sizeof(__pyx_k_TraderApiWrapper_ReqQryBrokerTra_2), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryCFMMCTrad, __pyx_k_TraderApiWrapper_ReqQryCFMMCTrad, sizeof(__pyx_k_TraderApiWrapper_ReqQryCFMMCTrad), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryCombActio, __pyx_k_TraderApiWrapper_ReqQryCombActio, sizeof(__pyx_k_TraderApiWrapper_ReqQryCombActio), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryCombInstr, __pyx_k_TraderApiWrapper_ReqQryCombInstr, sizeof(__pyx_k_TraderApiWrapper_ReqQryCombInstr), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryContractB, __pyx_k_TraderApiWrapper_ReqQryContractB, sizeof(__pyx_k_TraderApiWrapper_ReqQryContractB), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryDepthMark, __pyx_k_TraderApiWrapper_ReqQryDepthMark, sizeof(__pyx_k_TraderApiWrapper_ReqQryDepthMark), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryEWarrantO, __pyx_k_TraderApiWrapper_ReqQryEWarrantO, sizeof(__pyx_k_TraderApiWrapper_ReqQryEWarrantO), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryExchange, __pyx_k_TraderApiWrapper_ReqQryExchange, sizeof(__pyx_k_TraderApiWrapper_ReqQryExchange), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryExchangeM, __pyx_k_TraderApiWrapper_ReqQryExchangeM, sizeof(__pyx_k_TraderApiWrapper_ReqQryExchangeM), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryExchangeM_2, __pyx_k_TraderApiWrapper_ReqQryExchangeM_2, sizeof(__pyx_k_TraderApiWrapper_ReqQryExchangeM_2), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryExchangeR, __pyx_k_TraderApiWrapper_ReqQryExchangeR, sizeof(__pyx_k_TraderApiWrapper_ReqQryExchangeR), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryExecOrder, __pyx_k_TraderApiWrapper_ReqQryExecOrder, sizeof(__pyx_k_TraderApiWrapper_ReqQryExecOrder), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryForQuote, __pyx_k_TraderApiWrapper_ReqQryForQuote, sizeof(__pyx_k_TraderApiWrapper_ReqQryForQuote), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryInstrumen, __pyx_k_TraderApiWrapper_ReqQryInstrumen, sizeof(__pyx_k_TraderApiWrapper_ReqQryInstrumen), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryInstrumen_2, __pyx_k_TraderApiWrapper_ReqQryInstrumen_2, sizeof(__pyx_k_TraderApiWrapper_ReqQryInstrumen_2), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryInstrumen_3, __pyx_k_TraderApiWrapper_ReqQryInstrumen_3, sizeof(__pyx_k_TraderApiWrapper_ReqQryInstrumen_3), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryInstrumen_4, __pyx_k_TraderApiWrapper_ReqQryInstrumen_4, sizeof(__pyx_k_TraderApiWrapper_ReqQryInstrumen_4), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryInvestUni, __pyx_k_TraderApiWrapper_ReqQryInvestUni, sizeof(__pyx_k_TraderApiWrapper_ReqQryInvestUni), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryInvestor, __pyx_k_TraderApiWrapper_ReqQryInvestor, sizeof(__pyx_k_TraderApiWrapper_ReqQryInvestor), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryInvestorP, __pyx_k_TraderApiWrapper_ReqQryInvestorP, sizeof(__pyx_k_TraderApiWrapper_ReqQryInvestorP), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryInvestorP_2, __pyx_k_TraderApiWrapper_ReqQryInvestorP_2, sizeof(__pyx_k_TraderApiWrapper_ReqQryInvestorP_2), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryInvestorP_3, __pyx_k_TraderApiWrapper_ReqQryInvestorP_3, sizeof(__pyx_k_TraderApiWrapper_ReqQryInvestorP_3), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryInvestorP_4, __pyx_k_TraderApiWrapper_ReqQryInvestorP_4, sizeof(__pyx_k_TraderApiWrapper_ReqQryInvestorP_4), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryMMInstrum, __pyx_k_TraderApiWrapper_ReqQryMMInstrum, sizeof(__pyx_k_TraderApiWrapper_ReqQryMMInstrum), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryMMOptionI, __pyx_k_TraderApiWrapper_ReqQryMMOptionI, sizeof(__pyx_k_TraderApiWrapper_ReqQryMMOptionI), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryNotice, __pyx_k_TraderApiWrapper_ReqQryNotice, sizeof(__pyx_k_TraderApiWrapper_ReqQryNotice), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryOptionIns, __pyx_k_TraderApiWrapper_ReqQryOptionIns, sizeof(__pyx_k_TraderApiWrapper_ReqQryOptionIns), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryOptionIns_2, __pyx_k_TraderApiWrapper_ReqQryOptionIns_2, sizeof(__pyx_k_TraderApiWrapper_ReqQryOptionIns_2), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryOptionSel, __pyx_k_TraderApiWrapper_ReqQryOptionSel, sizeof(__pyx_k_TraderApiWrapper_ReqQryOptionSel), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryOrder, __pyx_k_TraderApiWrapper_ReqQryOrder, sizeof(__pyx_k_TraderApiWrapper_ReqQryOrder), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryParkedOrd, __pyx_k_TraderApiWrapper_ReqQryParkedOrd, sizeof(__pyx_k_TraderApiWrapper_ReqQryParkedOrd), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryParkedOrd_2, __pyx_k_TraderApiWrapper_ReqQryParkedOrd_2, sizeof(__pyx_k_TraderApiWrapper_ReqQryParkedOrd_2), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryProduct, __pyx_k_TraderApiWrapper_ReqQryProduct, sizeof(__pyx_k_TraderApiWrapper_ReqQryProduct), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryProductEx, __pyx_k_TraderApiWrapper_ReqQryProductEx, sizeof(__pyx_k_TraderApiWrapper_ReqQryProductEx), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryProductGr, __pyx_k_TraderApiWrapper_ReqQryProductGr, sizeof(__pyx_k_TraderApiWrapper_ReqQryProductGr), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryQuote, __pyx_k_TraderApiWrapper_ReqQryQuote, sizeof(__pyx_k_TraderApiWrapper_ReqQryQuote), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQrySecAgentA, __pyx_k_TraderApiWrapper_ReqQrySecAgentA, sizeof(__pyx_k_TraderApiWrapper_ReqQrySecAgentA), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQrySecAgentC, __pyx_k_TraderApiWrapper_ReqQrySecAgentC, sizeof(__pyx_k_TraderApiWrapper_ReqQrySecAgentC), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQrySecAgentT, __pyx_k_TraderApiWrapper_ReqQrySecAgentT, sizeof(__pyx_k_TraderApiWrapper_ReqQrySecAgentT), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQrySettlemen, __pyx_k_TraderApiWrapper_ReqQrySettlemen, sizeof(__pyx_k_TraderApiWrapper_ReqQrySettlemen), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQrySettlemen_2, __pyx_k_TraderApiWrapper_ReqQrySettlemen_2, sizeof(__pyx_k_TraderApiWrapper_ReqQrySettlemen_2), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryTrade, __pyx_k_TraderApiWrapper_ReqQryTrade, sizeof(__pyx_k_TraderApiWrapper_ReqQryTrade), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryTradingAc, __pyx_k_TraderApiWrapper_ReqQryTradingAc, sizeof(__pyx_k_TraderApiWrapper_ReqQryTradingAc), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryTradingCo, __pyx_k_TraderApiWrapper_ReqQryTradingCo, sizeof(__pyx_k_TraderApiWrapper_ReqQryTradingCo), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryTradingNo, __pyx_k_TraderApiWrapper_ReqQryTradingNo, sizeof(__pyx_k_TraderApiWrapper_ReqQryTradingNo), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryTransferB, __pyx_k_TraderApiWrapper_ReqQryTransferB, sizeof(__pyx_k_TraderApiWrapper_ReqQryTransferB), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQryTransferS, __pyx_k_TraderApiWrapper_ReqQryTransferS, sizeof(__pyx_k_TraderApiWrapper_ReqQryTransferS), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQueryBankAcc, __pyx_k_TraderApiWrapper_ReqQueryBankAcc, sizeof(__pyx_k_TraderApiWrapper_ReqQueryBankAcc), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQueryCFMMCTr, __pyx_k_TraderApiWrapper_ReqQueryCFMMCTr, sizeof(__pyx_k_TraderApiWrapper_ReqQueryCFMMCTr), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQueryMaxOrde, __pyx_k_TraderApiWrapper_ReqQueryMaxOrde, sizeof(__pyx_k_TraderApiWrapper_ReqQueryMaxOrde), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQuoteAction, __pyx_k_TraderApiWrapper_ReqQuoteAction, sizeof(__pyx_k_TraderApiWrapper_ReqQuoteAction), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqQuoteInsert, __pyx_k_TraderApiWrapper_ReqQuoteInsert, sizeof(__pyx_k_TraderApiWrapper_ReqQuoteInsert), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqRemoveParked, __pyx_k_TraderApiWrapper_ReqRemoveParked, sizeof(__pyx_k_TraderApiWrapper_ReqRemoveParked), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqRemoveParked_2, __pyx_k_TraderApiWrapper_ReqRemoveParked_2, sizeof(__pyx_k_TraderApiWrapper_ReqRemoveParked_2), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqSettlementIn, __pyx_k_TraderApiWrapper_ReqSettlementIn, sizeof(__pyx_k_TraderApiWrapper_ReqSettlementIn), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqTradingAccou, __pyx_k_TraderApiWrapper_ReqTradingAccou, sizeof(__pyx_k_TraderApiWrapper_ReqTradingAccou), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqUserLogin, __pyx_k_TraderApiWrapper_ReqUserLogin, sizeof(__pyx_k_TraderApiWrapper_ReqUserLogin), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqUserLogin2, __pyx_k_TraderApiWrapper_ReqUserLogin2, sizeof(__pyx_k_TraderApiWrapper_ReqUserLogin2), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqUserLogout, __pyx_k_TraderApiWrapper_ReqUserLogout, sizeof(__pyx_k_TraderApiWrapper_ReqUserLogout), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqUserPassword, __pyx_k_TraderApiWrapper_ReqUserPassword, sizeof(__pyx_k_TraderApiWrapper_ReqUserPassword), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_ReqUserPassword_2, __pyx_k_TraderApiWrapper_ReqUserPassword_2, sizeof(__pyx_k_TraderApiWrapper_ReqUserPassword_2), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_SubscribePrivat, __pyx_k_TraderApiWrapper_SubscribePrivat, sizeof(__pyx_k_TraderApiWrapper_SubscribePrivat), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper_SubscribePublic, __pyx_k_TraderApiWrapper_SubscribePublic, sizeof(__pyx_k_TraderApiWrapper_SubscribePublic), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper___reduce_cython, __pyx_k_TraderApiWrapper___reduce_cython, sizeof(__pyx_k_TraderApiWrapper___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_TraderApiWrapper___setstate_cyth, __pyx_k_TraderApiWrapper___setstate_cyth, sizeof(__pyx_k_TraderApiWrapper___setstate_cyth), 0, 0, 1, 1},
  {&__pyx_n_u_TraderApicall_stack, __pyx_k_TraderApicall_stack, sizeof(__pyx_k_TraderApicall_stack), 0, 1, 0, 1},
  {&__pyx_n_s_TradingAccountField, __pyx_k_TradingAccountField, sizeof(__pyx_k_TradingAccountField), 0, 0, 1, 1},
  {&__pyx_n_s_TradingAccountPasswordUpdateFiel, __pyx_k_TradingAccountPasswordUpdateFiel, sizeof(__pyx_k_TradingAccountPasswordUpdateFiel), 0, 0, 1, 1},
  {&__pyx_n_s_TradingCodeField, __pyx_k_TradingCodeField, sizeof(__pyx_k_TradingCodeField), 0, 0, 1, 1},
  {&__pyx_n_s_TradingNoticeField, __pyx_k_TradingNoticeField, sizeof(__pyx_k_TradingNoticeField), 0, 0, 1, 1},
  {&__pyx_n_s_TradingNoticeInfoField, __pyx_k_TradingNoticeInfoField, sizeof(__pyx_k_TradingNoticeInfoField), 0, 0, 1, 1},
  {&__pyx_n_s_TransferBankField, __pyx_k_TransferBankField, sizeof(__pyx_k_TransferBankField), 0, 0, 1, 1},
  {&__pyx_n_s_TransferSerialField, __pyx_k_TransferSerialField, sizeof(__pyx_k_TransferSerialField), 0, 0, 1, 1},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_n_s_UserLogoutField, __pyx_k_UserLogoutField, sizeof(__pyx_k_UserLogoutField), 0, 0, 1, 1},
  {&__pyx_n_s_UserPasswordUpdateField, __pyx_k_UserPasswordUpdateField, sizeof(__pyx_k_UserPasswordUpdateField), 0, 0, 1, 1},
  {&__pyx_n_s__214, __pyx_k__214, sizeof(__pyx_k__214), 0, 0, 1, 1},
  {&__pyx_n_s_address, __pyx_k_address, sizeof(__pyx_k_address), 0, 0, 1, 1},
  {&__pyx_n_s_addressof, __pyx_k_addressof, sizeof(__pyx_k_addressof), 0, 0, 1, 1},
  {&__pyx_n_s_bInit, __pyx_k_bInit, sizeof(__pyx_k_bInit), 0, 0, 1, 1},
  {&__pyx_kp_u_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 1, 0, 0},
  {&__pyx_kp_u_call_2, __pyx_k_call_2, sizeof(__pyx_k_call_2), 0, 1, 0, 0},
  {&__pyx_n_s_cfg_ptp_can_change_env, __pyx_k_cfg_ptp_can_change_env, sizeof(__pyx_k_cfg_ptp_can_change_env), 0, 0, 1, 1},
  {&__pyx_n_s_cfg_ptp_env, __pyx_k_cfg_ptp_env, sizeof(__pyx_k_cfg_ptp_env), 0, 0, 1, 1},
  {&__pyx_n_u_cinit, __pyx_k_cinit, sizeof(__pyx_k_cinit), 0, 1, 0, 1},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_co_name, __pyx_k_co_name, sizeof(__pyx_k_co_name), 0, 0, 1, 1},
  {&__pyx_n_s_configparser, __pyx_k_configparser, sizeof(__pyx_k_configparser), 0, 0, 1, 1},
  {&__pyx_n_u_ctp, __pyx_k_ctp, sizeof(__pyx_k_ctp), 0, 1, 0, 1},
  {&__pyx_n_s_ctypes, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 0, 0, 1, 1},
  {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1},
  {&__pyx_n_s_dwTime, __pyx_k_dwTime, sizeof(__pyx_k_dwTime), 0, 0, 1, 1},
  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1},
  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
  {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1},
  {&__pyx_n_s_express, __pyx_k_express, sizeof(__pyx_k_express), 0, 0, 1, 1},
  {&__pyx_n_s_f_code, __pyx_k_f_code, sizeof(__pyx_k_f_code), 0, 0, 1, 1},
  {&__pyx_n_s_from_address, __pyx_k_from_address, sizeof(__pyx_k_from_address), 0, 0, 1, 1},
  {&__pyx_n_s_funName, __pyx_k_funName, sizeof(__pyx_k_funName), 0, 0, 1, 1},
  {&__pyx_n_s_getframe, __pyx_k_getframe, sizeof(__pyx_k_getframe), 0, 0, 1, 1},
  {&__pyx_n_s_imp, __pyx_k_imp, sizeof(__pyx_k_imp), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1},
  {&__pyx_n_s_logDes, __pyx_k_logDes, sizeof(__pyx_k_logDes), 0, 0, 1, 1},
  {&__pyx_n_s_logger, __pyx_k_logger, sizeof(__pyx_k_logger), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_md_lastPrice, __pyx_k_md_lastPrice, sizeof(__pyx_k_md_lastPrice), 0, 0, 1, 1},
  {&__pyx_n_s_myDEnv, __pyx_k_myDEnv, sizeof(__pyx_k_myDEnv), 0, 0, 1, 1},
  {&__pyx_n_s_myEnv, __pyx_k_myEnv, sizeof(__pyx_k_myEnv), 0, 0, 1, 1},
  {&__pyx_n_s_nRequestID, __pyx_k_nRequestID, sizeof(__pyx_k_nRequestID), 0, 0, 1, 1},
  {&__pyx_n_s_nResumeType, __pyx_k_nResumeType, sizeof(__pyx_k_nResumeType), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
  {&__pyx_n_s_pFensUserInfo, __pyx_k_pFensUserInfo, sizeof(__pyx_k_pFensUserInfo), 0, 0, 1, 1},
  {&__pyx_n_s_pInputBatchOrderAction, __pyx_k_pInputBatchOrderAction, sizeof(__pyx_k_pInputBatchOrderAction), 0, 0, 1, 1},
  {&__pyx_n_s_pInputCombAction, __pyx_k_pInputCombAction, sizeof(__pyx_k_pInputCombAction), 0, 0, 1, 1},
  {&__pyx_n_s_pInputExecOrder, __pyx_k_pInputExecOrder, sizeof(__pyx_k_pInputExecOrder), 0, 0, 1, 1},
  {&__pyx_n_s_pInputExecOrderAction, __pyx_k_pInputExecOrderAction, sizeof(__pyx_k_pInputExecOrderAction), 0, 0, 1, 1},
  {&__pyx_n_s_pInputForQuote, __pyx_k_pInputForQuote, sizeof(__pyx_k_pInputForQuote), 0, 0, 1, 1},
  {&__pyx_n_s_pInputOptionSelfClose, __pyx_k_pInputOptionSelfClose, sizeof(__pyx_k_pInputOptionSelfClose), 0, 0, 1, 1},
  {&__pyx_n_s_pInputOptionSelfCloseAction, __pyx_k_pInputOptionSelfCloseAction, sizeof(__pyx_k_pInputOptionSelfCloseAction), 0, 0, 1, 1},
  {&__pyx_n_s_pInputOrder, __pyx_k_pInputOrder, sizeof(__pyx_k_pInputOrder), 0, 0, 1, 1},
  {&__pyx_n_s_pInputOrderAction, __pyx_k_pInputOrderAction, sizeof(__pyx_k_pInputOrderAction), 0, 0, 1, 1},
  {&__pyx_n_s_pInputQuote, __pyx_k_pInputQuote, sizeof(__pyx_k_pInputQuote), 0, 0, 1, 1},
  {&__pyx_n_s_pInputQuoteAction, __pyx_k_pInputQuoteAction, sizeof(__pyx_k_pInputQuoteAction), 0, 0, 1, 1},
  {&__pyx_n_s_pParkedOrder, __pyx_k_pParkedOrder, sizeof(__pyx_k_pParkedOrder), 0, 0, 1, 1},
  {&__pyx_n_s_pParkedOrderAction, __pyx_k_pParkedOrderAction, sizeof(__pyx_k_pParkedOrderAction), 0, 0, 1, 1},
  {&__pyx_n_s_pQryAccountregister, __pyx_k_pQryAccountregister, sizeof(__pyx_k_pQryAccountregister), 0, 0, 1, 1},
  {&__pyx_n_s_pQryBrokerTradingAlgos, __pyx_k_pQryBrokerTradingAlgos, sizeof(__pyx_k_pQryBrokerTradingAlgos), 0, 0, 1, 1},
  {&__pyx_n_s_pQryBrokerTradingParams, __pyx_k_pQryBrokerTradingParams, sizeof(__pyx_k_pQryBrokerTradingParams), 0, 0, 1, 1},
  {&__pyx_n_s_pQryCFMMCTradingAccountKey, __pyx_k_pQryCFMMCTradingAccountKey, sizeof(__pyx_k_pQryCFMMCTradingAccountKey), 0, 0, 1, 1},
  {&__pyx_n_s_pQryCombAction, __pyx_k_pQryCombAction, sizeof(__pyx_k_pQryCombAction), 0, 0, 1, 1},
  {&__pyx_n_s_pQryCombInstrumentGuard, __pyx_k_pQryCombInstrumentGuard, sizeof(__pyx_k_pQryCombInstrumentGuard), 0, 0, 1, 1},
  {&__pyx_n_s_pQryContractBank, __pyx_k_pQryContractBank, sizeof(__pyx_k_pQryContractBank), 0, 0, 1, 1},
  {&__pyx_n_s_pQryDepthMarketData, __pyx_k_pQryDepthMarketData, sizeof(__pyx_k_pQryDepthMarketData), 0, 0, 1, 1},
  {&__pyx_n_s_pQryEWarrantOffset, __pyx_k_pQryEWarrantOffset, sizeof(__pyx_k_pQryEWarrantOffset), 0, 0, 1, 1},
  {&__pyx_n_s_pQryExchange, __pyx_k_pQryExchange, sizeof(__pyx_k_pQryExchange), 0, 0, 1, 1},
  {&__pyx_n_s_pQryExchangeMarginRate, __pyx_k_pQryExchangeMarginRate, sizeof(__pyx_k_pQryExchangeMarginRate), 0, 0, 1, 1},
  {&__pyx_n_s_pQryExchangeMarginRateAdjust, __pyx_k_pQryExchangeMarginRateAdjust, sizeof(__pyx_k_pQryExchangeMarginRateAdjust), 0, 0, 1, 1},
  {&__pyx_n_s_pQryExchangeRate, __pyx_k_pQryExchangeRate, sizeof(__pyx_k_pQryExchangeRate), 0, 0, 1, 1},
  {&__pyx_n_s_pQryExecOrder, __pyx_k_pQryExecOrder, sizeof(__pyx_k_pQryExecOrder), 0, 0, 1, 1},
  {&__pyx_n_s_pQryForQuote, __pyx_k_pQryForQuote, sizeof(__pyx_k_pQryForQuote), 0, 0, 1, 1},
  {&__pyx_n_s_pQryInstrument, __pyx_k_pQryInstrument, sizeof(__pyx_k_pQryInstrument), 0, 0, 1, 1},
  {&__pyx_n_s_pQryInstrumentCommissionRate, __pyx_k_pQryInstrumentCommissionRate, sizeof(__pyx_k_pQryInstrumentCommissionRate), 0, 0, 1, 1},
  {&__pyx_n_s_pQryInstrumentMarginRate, __pyx_k_pQryInstrumentMarginRate, sizeof(__pyx_k_pQryInstrumentMarginRate), 0, 0, 1, 1},
  {&__pyx_n_s_pQryInstrumentOrderCommRate, __pyx_k_pQryInstrumentOrderCommRate, sizeof(__pyx_k_pQryInstrumentOrderCommRate), 0, 0, 1, 1},
  {&__pyx_n_s_pQryInvestUnit, __pyx_k_pQryInvestUnit, sizeof(__pyx_k_pQryInvestUnit), 0, 0, 1, 1},
  {&__pyx_n_s_pQryInvestor, __pyx_k_pQryInvestor, sizeof(__pyx_k_pQryInvestor), 0, 0, 1, 1},
  {&__pyx_n_s_pQryInvestorPosition, __pyx_k_pQryInvestorPosition, sizeof(__pyx_k_pQryInvestorPosition), 0, 0, 1, 1},
  {&__pyx_n_s_pQryInvestorPositionCombineDetai, __pyx_k_pQryInvestorPositionCombineDetai, sizeof(__pyx_k_pQryInvestorPositionCombineDetai), 0, 0, 1, 1},
  {&__pyx_n_s_pQryInvestorPositionDetail, __pyx_k_pQryInvestorPositionDetail, sizeof(__pyx_k_pQryInvestorPositionDetail), 0, 0, 1, 1},
  {&__pyx_n_s_pQryInvestorProductGroupMargin, __pyx_k_pQryInvestorProductGroupMargin, sizeof(__pyx_k_pQryInvestorProductGroupMargin), 0, 0, 1, 1},
  {&__pyx_n_s_pQryMMInstrumentCommissionRate, __pyx_k_pQryMMInstrumentCommissionRate, sizeof(__pyx_k_pQryMMInstrumentCommissionRate), 0, 0, 1, 1},
  {&__pyx_n_s_pQryMMOptionInstrCommRate, __pyx_k_pQryMMOptionInstrCommRate, sizeof(__pyx_k_pQryMMOptionInstrCommRate), 0, 0, 1, 1},
  {&__pyx_n_s_pQryNotice, __pyx_k_pQryNotice, sizeof(__pyx_k_pQryNotice), 0, 0, 1, 1},
  {&__pyx_n_s_pQryOptionInstrCommRate, __pyx_k_pQryOptionInstrCommRate, sizeof(__pyx_k_pQryOptionInstrCommRate), 0, 0, 1, 1},
  {&__pyx_n_s_pQryOptionInstrTradeCost, __pyx_k_pQryOptionInstrTradeCost, sizeof(__pyx_k_pQryOptionInstrTradeCost), 0, 0, 1, 1},
  {&__pyx_n_s_pQryOptionSelfClose, __pyx_k_pQryOptionSelfClose, sizeof(__pyx_k_pQryOptionSelfClose), 0, 0, 1, 1},
  {&__pyx_n_s_pQryOrder, __pyx_k_pQryOrder, sizeof(__pyx_k_pQryOrder), 0, 0, 1, 1},
  {&__pyx_n_s_pQryParkedOrder, __pyx_k_pQryParkedOrder, sizeof(__pyx_k_pQryParkedOrder), 0, 0, 1, 1},
  {&__pyx_n_s_pQryParkedOrderAction, __pyx_k_pQryParkedOrderAction, sizeof(__pyx_k_pQryParkedOrderAction), 0, 0, 1, 1},
  {&__pyx_n_s_pQryProduct, __pyx_k_pQryProduct, sizeof(__pyx_k_pQryProduct), 0, 0, 1, 1},
  {&__pyx_n_s_pQryProductExchRate, __pyx_k_pQryProductExchRate, sizeof(__pyx_k_pQryProductExchRate), 0, 0, 1, 1},
  {&__pyx_n_s_pQryProductGroup, __pyx_k_pQryProductGroup, sizeof(__pyx_k_pQryProductGroup), 0, 0, 1, 1},
  {&__pyx_n_s_pQryQuote, __pyx_k_pQryQuote, sizeof(__pyx_k_pQryQuote), 0, 0, 1, 1},
  {&__pyx_n_s_pQrySecAgentACIDMap, __pyx_k_pQrySecAgentACIDMap, sizeof(__pyx_k_pQrySecAgentACIDMap), 0, 0, 1, 1},
  {&__pyx_n_s_pQrySecAgentCheckMode, __pyx_k_pQrySecAgentCheckMode, sizeof(__pyx_k_pQrySecAgentCheckMode), 0, 0, 1, 1},
  {&__pyx_n_s_pQrySettlementInfo, __pyx_k_pQrySettlementInfo, sizeof(__pyx_k_pQrySettlementInfo), 0, 0, 1, 1},
  {&__pyx_n_s_pQrySettlementInfoConfirm, __pyx_k_pQrySettlementInfoConfirm, sizeof(__pyx_k_pQrySettlementInfoConfirm), 0, 0, 1, 1},
  {&__pyx_n_s_pQryTrade, __pyx_k_pQryTrade, sizeof(__pyx_k_pQryTrade), 0, 0, 1, 1},
  {&__pyx_n_s_pQryTradingAccount, __pyx_k_pQryTradingAccount, sizeof(__pyx_k_pQryTradingAccount), 0, 0, 1, 1},
  {&__pyx_n_s_pQryTradingCode, __pyx_k_pQryTradingCode, sizeof(__pyx_k_pQryTradingCode), 0, 0, 1, 1},
  {&__pyx_n_s_pQryTradingNotice, __pyx_k_pQryTradingNotice, sizeof(__pyx_k_pQryTradingNotice), 0, 0, 1, 1},
  {&__pyx_n_s_pQryTransferBank, __pyx_k_pQryTransferBank, sizeof(__pyx_k_pQryTransferBank), 0, 0, 1, 1},
  {&__pyx_n_s_pQryTransferSerial, __pyx_k_pQryTransferSerial, sizeof(__pyx_k_pQryTransferSerial), 0, 0, 1, 1},
  {&__pyx_n_s_pQueryCFMMCTradingAccountToken, __pyx_k_pQueryCFMMCTradingAccountToken, sizeof(__pyx_k_pQueryCFMMCTradingAccountToken), 0, 0, 1, 1},
  {&__pyx_n_s_pQueryMaxOrderVolume, __pyx_k_pQueryMaxOrderVolume, sizeof(__pyx_k_pQueryMaxOrderVolume), 0, 0, 1, 1},
  {&__pyx_n_s_pRemoveParkedOrder, __pyx_k_pRemoveParkedOrder, sizeof(__pyx_k_pRemoveParkedOrder), 0, 0, 1, 1},
  {&__pyx_n_s_pRemoveParkedOrderAction, __pyx_k_pRemoveParkedOrderAction, sizeof(__pyx_k_pRemoveParkedOrderAction), 0, 0, 1, 1},
  {&__pyx_n_s_pReqAuthenticateField, __pyx_k_pReqAuthenticateField, sizeof(__pyx_k_pReqAuthenticateField), 0, 0, 1, 1},
  {&__pyx_n_s_pReqQueryAccount, __pyx_k_pReqQueryAccount, sizeof(__pyx_k_pReqQueryAccount), 0, 0, 1, 1},
  {&__pyx_n_s_pReqTransfer, __pyx_k_pReqTransfer, sizeof(__pyx_k_pReqTransfer), 0, 0, 1, 1},
  {&__pyx_n_s_pReqUserLogin, __pyx_k_pReqUserLogin, sizeof(__pyx_k_pReqUserLogin), 0, 0, 1, 1},
  {&__pyx_n_s_pReqUserLoginField, __pyx_k_pReqUserLoginField, sizeof(__pyx_k_pReqUserLoginField), 0, 0, 1, 1},
  {&__pyx_n_s_pSettlementInfoConfirm, __pyx_k_pSettlementInfoConfirm, sizeof(__pyx_k_pSettlementInfoConfirm), 0, 0, 1, 1},
  {&__pyx_n_s_pTradingAccountPasswordUpdate, __pyx_k_pTradingAccountPasswordUpdate, sizeof(__pyx_k_pTradingAccountPasswordUpdate), 0, 0, 1, 1},
  {&__pyx_n_s_pUserLogout, __pyx_k_pUserLogout, sizeof(__pyx_k_pUserLogout), 0, 0, 1, 1},
  {&__pyx_n_s_pUserPasswordUpdate, __pyx_k_pUserPasswordUpdate, sizeof(__pyx_k_pUserPasswordUpdate), 0, 0, 1, 1},
  {&__pyx_n_s_printNumber, __pyx_k_printNumber, sizeof(__pyx_k_printNumber), 0, 0, 1, 1},
  {&__pyx_n_s_printString, __pyx_k_printString, sizeof(__pyx_k_printString), 0, 0, 1, 1},
  {&__pyx_n_s_pszFlowPath, __pyx_k_pszFlowPath, sizeof(__pyx_k_pszFlowPath), 0, 0, 1, 1},
  {&__pyx_n_s_pszFrontAddress, __pyx_k_pszFrontAddress, sizeof(__pyx_k_pszFrontAddress), 0, 0, 1, 1},
  {&__pyx_n_s_pszNsAddress, __pyx_k_pszNsAddress, sizeof(__pyx_k_pszNsAddress), 0, 0, 1, 1},
  {&__pyx_n_s_ptp, __pyx_k_ptp, sizeof(__pyx_k_ptp), 0, 0, 1, 1},
  {&__pyx_n_s_ptp_CythonLib, __pyx_k_ptp_CythonLib, sizeof(__pyx_k_ptp_CythonLib), 0, 0, 1, 1},
  {&__pyx_n_s_ptp_TraderApi, __pyx_k_ptp_TraderApi, sizeof(__pyx_k_ptp_TraderApi), 0, 0, 1, 1},
  {&__pyx_kp_s_ptp_TraderApi_pyx, __pyx_k_ptp_TraderApi_pyx, sizeof(__pyx_k_ptp_TraderApi_pyx), 0, 0, 1, 0},
  {&__pyx_n_s_py_ApiStructure, __pyx_k_py_ApiStructure, sizeof(__pyx_k_py_ApiStructure), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  {&__pyx_kp_u_regist, __pyx_k_regist, sizeof(__pyx_k_regist), 0, 1, 0, 0},
  {&__pyx_n_s_reload, __pyx_k_reload, sizeof(__pyx_k_reload), 0, 0, 1, 1},
  {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
  {&__pyx_kp_u_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 1, 0, 0},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_server, __pyx_k_server, sizeof(__pyx_k_server), 0, 0, 1, 1},
  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_sleep, __pyx_k_sleep, sizeof(__pyx_k_sleep), 0, 0, 1, 1},
  {&__pyx_n_s_staticmethod, __pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 0, 1, 1},
  {&__pyx_kp_u_step_Infra_Init_4_of_4_step, __pyx_k_step_Infra_Init_4_of_4_step, sizeof(__pyx_k_step_Infra_Init_4_of_4_step), 0, 1, 0, 0},
  {&__pyx_kp_u_step_RegisterFront_3_of_4_step, __pyx_k_step_RegisterFront_3_of_4_step, sizeof(__pyx_k_step_RegisterFront_3_of_4_step), 0, 1, 0, 0},
  {&__pyx_kp_u_step_RegisterSpi_1_of_4_step, __pyx_k_step_RegisterSpi_1_of_4_step, sizeof(__pyx_k_step_RegisterSpi_1_of_4_step), 0, 1, 0, 0},
  {&__pyx_kp_u_step_SubscribeTopic_2_of_4_step, __pyx_k_step_SubscribeTopic_2_of_4_step, sizeof(__pyx_k_step_SubscribeTopic_2_of_4_step), 0, 1, 0, 0},
  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
  {&__pyx_n_s_trader_server, __pyx_k_trader_server, sizeof(__pyx_k_trader_server), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 73, __pyx_L1_error)
  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 99, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "ptp/TraderApi.pyx":34
 * 
 *   def __cinit__(self):
 *     funName = "%s.%s" % ("TraderApiWrapper", "__cinit__")             # <<<<<<<<<<<<<<
 *     printString("TraderApicall_stack","call->",funName)
 *     self._api = NULL
 */
  __pyx_tuple_ = PyTuple_Pack(2, __pyx_n_u_TraderApiWrapper, __pyx_n_u_cinit); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "ptp/TraderApi.pyx":75
 *   @staticmethod
 *   def GetApiVersion():
 *     funName = "%s.%s" % ("Trader", "GetApiVersion")             # <<<<<<<<<<<<<<
 *     printString("TraderApicall_stack","call->",funName)
 *     return CTraderApi.GetApiVersion()
 */
  __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_u_Trader, __pyx_n_u_GetApiVersion); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "ptp/TraderApi.pyx":108
 * 
 *     except Exception as err:
 *       myEnv.logger.error("Init_Base", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return bInit
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_u_Init_Base); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "ptp/TraderApi.pyx":141
 *         myEnv.logger.info(logDes)
 * 
 *         time.sleep(1)             # <<<<<<<<<<<<<<
 * 
 *         self._api.Init()
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "ptp/TraderApi.pyx":147
 *         myEnv.logger.info(logDes)
 *       else:
 *         myEnv.logger.error("BaseEnv has not been inited")             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName)
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_BaseEnv_has_not_been_inited); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "ptp/TraderApi.pyx":152
 *       bInit=0
 *     except Exception as err:
 *       myEnv.logger.error("Tader.Init", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return bInit
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Tader_Init); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "ptp/TraderApi.pyx":168
 * 
 *     except Exception as err:
 *         myEnv.logger.error("Join", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     printString("TraderApicall_stack","call-<",funName)
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_u_Join); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "ptp/TraderApi.pyx":185
 *         return result
 *     except Exception as err:
 *         myEnv.logger.error("GetTradingDay", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     printString("TraderApicall_stack","call-<",funName)
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_u_GetTradingDay); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "ptp/TraderApi.pyx":199
 *           self._api.RegisterFront(pszFrontAddress)
 *       except Exception as err:
 *         myEnv.logger.error("RegisterFront", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *       printString("TraderApicall_stack","call-<",funName)
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_u_RegisterFront); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "ptp/TraderApi.pyx":211
 *         self._api.RegisterNameServer(pszNsAddress)
 *     except Exception as err:
 *       myEnv.logger.error("RegisterNameServer", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     printString("TraderApicall_stack","call-<",funName)
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_u_RegisterNameServer); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "ptp/TraderApi.pyx":227
 * 
 *     except Exception as err:
 *       myEnv.logger.error("RegisterFensUserInfo", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     printString("TraderApicall_stack","call-<",funName)
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_u_RegisterFensUserInfo); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "ptp/TraderApi.pyx":238
 *         self._api.SubscribePrivateTopic(nResumeType)
 *     except Exception as err:
 *       myEnv.logger.error("SubscribePrivateTopic", exc_info=True)             # <<<<<<<<<<<<<<
 *     printString("TraderApicall_stack","call-<",funName)
 * 
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_u_SubscribePrivateTopic); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "ptp/TraderApi.pyx":256
 *         self._api.SubscribePublicTopic(nResumeType)
 *     except Exception as err:
 *       myEnv.logger.error("SubscribePublicTopic", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     printString("TraderApicall_stack","call-<",funName)
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_u_SubscribePublicTopic); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "ptp/TraderApi.pyx":278
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqAuthenticate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_u_ReqAuthenticate); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "ptp/TraderApi.pyx":301
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqUserLogin', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_u_ReqUserLogin); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "ptp/TraderApi.pyx":324
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqUserLogout', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_u_ReqUserLogout); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "ptp/TraderApi.pyx":347
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqUserPasswordUpdate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_u_ReqUserPasswordUpdate); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "ptp/TraderApi.pyx":370
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqTradingAccountPasswordUpdate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_u_ReqTradingAccountPasswordUpdate); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "ptp/TraderApi.pyx":393
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqUserLogin2', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_u_ReqUserLogin2); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "ptp/TraderApi.pyx":416
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqUserPasswordUpdate2', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_u_ReqUserPasswordUpdate2); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "ptp/TraderApi.pyx":439
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqOrderInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_u_ReqOrderInsert); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "ptp/TraderApi.pyx":462
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqParkedOrderInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_u_ReqParkedOrderInsert); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "ptp/TraderApi.pyx":485
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqParkedOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_u_ReqParkedOrderAction); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "ptp/TraderApi.pyx":508
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_u_ReqOrderAction); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "ptp/TraderApi.pyx":530
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQueryMaxOrderVolume', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_u_ReqQueryMaxOrderVolume); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "ptp/TraderApi.pyx":553
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqSettlementInfoConfirm', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_u_ReqSettlementInfoConfirm); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "ptp/TraderApi.pyx":576
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqRemoveParkedOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_u_ReqRemoveParkedOrder); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "ptp/TraderApi.pyx":599
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqRemoveParkedOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_u_ReqRemoveParkedOrderAction); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "ptp/TraderApi.pyx":622
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqExecOrderInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_n_u_ReqExecOrderInsert); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "ptp/TraderApi.pyx":645
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqExecOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_u_ReqExecOrderAction); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "ptp/TraderApi.pyx":668
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqForQuoteInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_u_ReqForQuoteInsert); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "ptp/TraderApi.pyx":691
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQuoteInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_u_ReqQuoteInsert); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "ptp/TraderApi.pyx":714
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQuoteAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_n_u_ReqQuoteAction); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "ptp/TraderApi.pyx":737
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqBatchOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_u_ReqBatchOrderAction); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "ptp/TraderApi.pyx":760
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqOptionSelfCloseInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_n_u_ReqOptionSelfCloseInsert); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "ptp/TraderApi.pyx":783
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqOptionSelfCloseAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_n_u_ReqOptionSelfCloseAction); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "ptp/TraderApi.pyx":806
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqCombActionInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_n_u_ReqCombActionInsert); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "ptp/TraderApi.pyx":828
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_u_ReqQryOrder); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "ptp/TraderApi.pyx":850
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryTrade', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_n_u_ReqQryTrade); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "ptp/TraderApi.pyx":872
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInvestorPosition', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_u_ReqQryInvestorPosition); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "ptp/TraderApi.pyx":894
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryTradingAccount', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_u_ReqQryTradingAccount); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "ptp/TraderApi.pyx":916
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInvestor', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_u_ReqQryInvestor); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "ptp/TraderApi.pyx":938
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryTradingCode', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_u_ReqQryTradingCode); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "ptp/TraderApi.pyx":960
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInstrumentMarginRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_n_u_ReqQryInstrumentMarginRate); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "ptp/TraderApi.pyx":982
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInstrumentCommissionRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_u_ReqQryInstrumentCommissionRate); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "ptp/TraderApi.pyx":1004
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryExchange', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_u_ReqQryExchange); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 1004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "ptp/TraderApi.pyx":1026
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryProduct', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_u_ReqQryProduct); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 1026, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "ptp/TraderApi.pyx":1048
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInstrument', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_n_u_ReqQryInstrument); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "ptp/TraderApi.pyx":1070
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryDepthMarketData', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_n_u_ReqQryDepthMarketData); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 1070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "ptp/TraderApi.pyx":1092
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQrySettlementInfo', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_n_u_ReqQrySettlementInfo); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 1092, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "ptp/TraderApi.pyx":1114
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryTransferBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_n_u_ReqQryTransferBank); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 1114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "ptp/TraderApi.pyx":1136
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInvestorPositionDetail', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_n_u_ReqQryInvestorPositionDetail); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 1136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "ptp/TraderApi.pyx":1158
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryNotice', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_n_u_ReqQryNotice); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 1158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "ptp/TraderApi.pyx":1180
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQrySettlementInfoConfirm', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_n_u_ReqQrySettlementInfoConfirm); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 1180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "ptp/TraderApi.pyx":1202
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInvestorPositionCombineDetail', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_n_u_ReqQryInvestorPositionCombineDet); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 1202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "ptp/TraderApi.pyx":1224
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryCFMMCTradingAccountKey', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_n_u_ReqQryCFMMCTradingAccountKey); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);

  /* "ptp/TraderApi.pyx":1246
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryEWarrantOffset', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_n_u_ReqQryEWarrantOffset); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 1246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);

  /* "ptp/TraderApi.pyx":1268
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInvestorProductGroupMargin', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_n_u_ReqQryInvestorProductGroupMargin); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 1268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);

  /* "ptp/TraderApi.pyx":1290
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryExchangeMarginRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_n_u_ReqQryExchangeMarginRate); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 1290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);

  /* "ptp/TraderApi.pyx":1312
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryExchangeMarginRateAdjust', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_n_u_ReqQryExchangeMarginRateAdjust); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 1312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);

  /* "ptp/TraderApi.pyx":1334
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryExchangeRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_n_u_ReqQryExchangeRate); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 1334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "ptp/TraderApi.pyx":1356
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQrySecAgentACIDMap', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_n_u_ReqQrySecAgentACIDMap); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);

  /* "ptp/TraderApi.pyx":1378
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryProductExchRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_n_u_ReqQryProductExchRate); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 1378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);

  /* "ptp/TraderApi.pyx":1400
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryProductGroup', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_n_u_ReqQryProductGroup); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 1400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "ptp/TraderApi.pyx":1422
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryMMInstrumentCommissionRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_n_u_ReqQryMMInstrumentCommissionRate); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);

  /* "ptp/TraderApi.pyx":1444
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryMMOptionInstrCommRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_n_u_ReqQryMMOptionInstrCommRate); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 1444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

  /* "ptp/TraderApi.pyx":1466
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInstrumentOrderCommRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_u_ReqQryInstrumentOrderCommRate); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 1466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "ptp/TraderApi.pyx":1488
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQrySecAgentTradingAccount', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_n_u_ReqQrySecAgentTradingAccount); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 1488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);

  /* "ptp/TraderApi.pyx":1510
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQrySecAgentCheckMode', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_u_ReqQrySecAgentCheckMode); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 1510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);

  /* "ptp/TraderApi.pyx":1532
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryOptionInstrTradeCost', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_n_u_ReqQryOptionInstrTradeCost); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 1532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);

  /* "ptp/TraderApi.pyx":1554
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryOptionInstrCommRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__71 = PyTuple_Pack(1, __pyx_n_u_ReqQryOptionInstrCommRate); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 1554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);

  /* "ptp/TraderApi.pyx":1576
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryExecOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_n_u_ReqQryExecOrder); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 1576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);

  /* "ptp/TraderApi.pyx":1598
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryForQuote', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_n_u_ReqQryForQuote); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 1598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);

  /* "ptp/TraderApi.pyx":1620
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryQuote', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__74 = PyTuple_Pack(1, __pyx_n_u_ReqQryQuote); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 1620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);

  /* "ptp/TraderApi.pyx":1642
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryOptionSelfClose', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_n_u_ReqQryOptionSelfClose); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 1642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);

  /* "ptp/TraderApi.pyx":1664
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryInvestUnit', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__76 = PyTuple_Pack(1, __pyx_n_u_ReqQryInvestUnit); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 1664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);

  /* "ptp/TraderApi.pyx":1686
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryCombInstrumentGuard', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_n_u_ReqQryCombInstrumentGuard); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 1686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);

  /* "ptp/TraderApi.pyx":1708
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryCombAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__78 = PyTuple_Pack(1, __pyx_n_u_ReqQryCombAction); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 1708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);

  /* "ptp/TraderApi.pyx":1730
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryTransferSerial', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__79 = PyTuple_Pack(1, __pyx_n_u_ReqQryTransferSerial); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 1730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);

  /* "ptp/TraderApi.pyx":1752
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryAccountregister', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_n_u_ReqQryAccountregister); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 1752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);

  /* "ptp/TraderApi.pyx":1774
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryContractBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_n_u_ReqQryContractBank); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 1774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);

  /* "ptp/TraderApi.pyx":1796
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryParkedOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_n_u_ReqQryParkedOrder); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 1796, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);

  /* "ptp/TraderApi.pyx":1818
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryParkedOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_n_u_ReqQryParkedOrderAction); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 1818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "ptp/TraderApi.pyx":1840
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryTradingNotice', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_n_u_ReqQryTradingNotice); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 1840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);

  /* "ptp/TraderApi.pyx":1862
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryBrokerTradingParams', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_n_u_ReqQryBrokerTradingParams); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 1862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);

  /* "ptp/TraderApi.pyx":1884
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQryBrokerTradingAlgos', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_n_u_ReqQryBrokerTradingAlgos); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 1884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);

  /* "ptp/TraderApi.pyx":1906
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQueryCFMMCTradingAccountToken', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__87 = PyTuple_Pack(1, __pyx_n_u_ReqQueryCFMMCTradingAccountToken); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 1906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);

  /* "ptp/TraderApi.pyx":1929
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqFromBankToFutureByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__88 = PyTuple_Pack(1, __pyx_n_u_ReqFromBankToFutureByFuture); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 1929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);

  /* "ptp/TraderApi.pyx":1952
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqFromFutureToBankByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__89 = PyTuple_Pack(1, __pyx_n_u_ReqFromFutureToBankByFuture); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 1952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);

  /* "ptp/TraderApi.pyx":1974
 *       printString("TraderApicall_stack","call-<",funName, dwTime)
 *     except Exception as err:
 *       myEnv.logger.error('ReqQueryBankAccountMoneyByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__90 = PyTuple_Pack(1, __pyx_n_u_ReqQueryBankAccountMoneyByFuture); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 1974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__91 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);

  /* "ptp/TraderApi.pyx":1987
 *       self.OnFrontConnected()
 *   except Exception as err:
 *       myEnv.logger.error('OnFrontConnected', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__93 = PyTuple_Pack(1, __pyx_n_u_OnFrontConnected); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 1987, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);

  /* "ptp/TraderApi.pyx":2007
 *       self.OnFrontDisconnected(nReason)
 *   except Exception as err:
 *       myEnv.logger.error('OnFrontDisconnected', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__94 = PyTuple_Pack(1, __pyx_n_u_OnFrontDisconnected); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 2007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);

  /* "ptp/TraderApi.pyx":2022
 *       self.OnHeartBeatWarning(nTimeLapse)
 *   except Exception as err:
 *       myEnv.logger.error('OnHeartBeatWarning', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__95 = PyTuple_Pack(1, __pyx_n_u_OnHeartBeatWarning); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 2022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);

  /* "ptp/TraderApi.pyx":2043
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspAuthenticate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__96 = PyTuple_Pack(1, __pyx_n_u_OnRspAuthenticate); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 2043, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);

  /* "ptp/TraderApi.pyx":2064
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspUserLogin', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__97 = PyTuple_Pack(1, __pyx_n_u_OnRspUserLogin); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 2064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);

  /* "ptp/TraderApi.pyx":2085
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspUserLogout', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__98 = PyTuple_Pack(1, __pyx_n_u_OnRspUserLogout); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 2085, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);

  /* "ptp/TraderApi.pyx":2106
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspUserPasswordUpdate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__99 = PyTuple_Pack(1, __pyx_n_u_OnRspUserPasswordUpdate); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 2106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);

  /* "ptp/TraderApi.pyx":2127
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspTradingAccountPasswordUpdate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__100 = PyTuple_Pack(1, __pyx_n_u_OnRspTradingAccountPasswordUpdat); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 2127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);

  /* "ptp/TraderApi.pyx":2148
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspOrderInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__101 = PyTuple_Pack(1, __pyx_n_u_OnRspOrderInsert); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 2148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);

  /* "ptp/TraderApi.pyx":2169
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspParkedOrderInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__102 = PyTuple_Pack(1, __pyx_n_u_OnRspParkedOrderInsert); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 2169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__102);
  __Pyx_GIVEREF(__pyx_tuple__102);

  /* "ptp/TraderApi.pyx":2190
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspParkedOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__103 = PyTuple_Pack(1, __pyx_n_u_OnRspParkedOrderAction); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 2190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);

  /* "ptp/TraderApi.pyx":2211
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__104 = PyTuple_Pack(1, __pyx_n_u_OnRspOrderAction); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 2211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);

  /* "ptp/TraderApi.pyx":2232
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQueryMaxOrderVolume', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__105 = PyTuple_Pack(1, __pyx_n_u_OnRspQueryMaxOrderVolume); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 2232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);

  /* "ptp/TraderApi.pyx":2253
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspSettlementInfoConfirm', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__106 = PyTuple_Pack(1, __pyx_n_u_OnRspSettlementInfoConfirm); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 2253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);

  /* "ptp/TraderApi.pyx":2274
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspRemoveParkedOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__107 = PyTuple_Pack(1, __pyx_n_u_OnRspRemoveParkedOrder); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 2274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);

  /* "ptp/TraderApi.pyx":2295
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspRemoveParkedOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__108 = PyTuple_Pack(1, __pyx_n_u_OnRspRemoveParkedOrderAction); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 2295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);

  /* "ptp/TraderApi.pyx":2316
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspExecOrderInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__109 = PyTuple_Pack(1, __pyx_n_u_OnRspExecOrderInsert); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 2316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);

  /* "ptp/TraderApi.pyx":2337
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspExecOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__110 = PyTuple_Pack(1, __pyx_n_u_OnRspExecOrderAction); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 2337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);

  /* "ptp/TraderApi.pyx":2358
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspForQuoteInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__111 = PyTuple_Pack(1, __pyx_n_u_OnRspForQuoteInsert); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 2358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);

  /* "ptp/TraderApi.pyx":2379
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQuoteInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__112 = PyTuple_Pack(1, __pyx_n_u_OnRspQuoteInsert); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(0, 2379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__112);
  __Pyx_GIVEREF(__pyx_tuple__112);

  /* "ptp/TraderApi.pyx":2400
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQuoteAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__113 = PyTuple_Pack(1, __pyx_n_u_OnRspQuoteAction); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 2400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);

  /* "ptp/TraderApi.pyx":2421
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspBatchOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__114 = PyTuple_Pack(1, __pyx_n_u_OnRspBatchOrderAction); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 2421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);

  /* "ptp/TraderApi.pyx":2442
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspOptionSelfCloseInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__115 = PyTuple_Pack(1, __pyx_n_u_OnRspOptionSelfCloseInsert); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 2442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);

  /* "ptp/TraderApi.pyx":2463
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspOptionSelfCloseAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__116 = PyTuple_Pack(1, __pyx_n_u_OnRspOptionSelfCloseAction); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 2463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__116);
  __Pyx_GIVEREF(__pyx_tuple__116);

  /* "ptp/TraderApi.pyx":2484
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspCombActionInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__117 = PyTuple_Pack(1, __pyx_n_u_OnRspCombActionInsert); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(0, 2484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);

  /* "ptp/TraderApi.pyx":2505
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__118 = PyTuple_Pack(1, __pyx_n_u_OnRspQryOrder); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 2505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);

  /* "ptp/TraderApi.pyx":2526
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryTrade', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__119 = PyTuple_Pack(1, __pyx_n_u_OnRspQryTrade); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(0, 2526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);

  /* "ptp/TraderApi.pyx":2547
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInvestorPosition', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__120 = PyTuple_Pack(1, __pyx_n_u_OnRspQryInvestorPosition); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 2547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__120);
  __Pyx_GIVEREF(__pyx_tuple__120);

  /* "ptp/TraderApi.pyx":2568
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryTradingAccount', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__121 = PyTuple_Pack(1, __pyx_n_u_OnRspQryTradingAccount); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 2568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);

  /* "ptp/TraderApi.pyx":2589
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInvestor', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__122 = PyTuple_Pack(1, __pyx_n_u_OnRspQryInvestor); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 2589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__122);
  __Pyx_GIVEREF(__pyx_tuple__122);

  /* "ptp/TraderApi.pyx":2610
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryTradingCode', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__123 = PyTuple_Pack(1, __pyx_n_u_OnRspQryTradingCode); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 2610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);

  /* "ptp/TraderApi.pyx":2631
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInstrumentMarginRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__124 = PyTuple_Pack(1, __pyx_n_u_OnRspQryInstrumentMarginRate); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 2631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);

  /* "ptp/TraderApi.pyx":2652
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInstrumentCommissionRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__125 = PyTuple_Pack(1, __pyx_n_u_OnRspQryInstrumentCommissionRate); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 2652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);

  /* "ptp/TraderApi.pyx":2673
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryExchange', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__126 = PyTuple_Pack(1, __pyx_n_u_OnRspQryExchange); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 2673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);

  /* "ptp/TraderApi.pyx":2694
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryProduct', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__127 = PyTuple_Pack(1, __pyx_n_u_OnRspQryProduct); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 2694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);

  /* "ptp/TraderApi.pyx":2715
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInstrument', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__128 = PyTuple_Pack(1, __pyx_n_u_OnRspQryInstrument); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 2715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);

  /* "ptp/TraderApi.pyx":2736
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryDepthMarketData', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__129 = PyTuple_Pack(1, __pyx_n_u_OnRspQryDepthMarketData); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 2736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);

  /* "ptp/TraderApi.pyx":2757
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQrySettlementInfo', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__130 = PyTuple_Pack(1, __pyx_n_u_OnRspQrySettlementInfo); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 2757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);

  /* "ptp/TraderApi.pyx":2778
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryTransferBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__131 = PyTuple_Pack(1, __pyx_n_u_OnRspQryTransferBank); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(0, 2778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__131);
  __Pyx_GIVEREF(__pyx_tuple__131);

  /* "ptp/TraderApi.pyx":2799
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInvestorPositionDetail', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__132 = PyTuple_Pack(1, __pyx_n_u_OnRspQryInvestorPositionDetail); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 2799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);

  /* "ptp/TraderApi.pyx":2820
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryNotice', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__133 = PyTuple_Pack(1, __pyx_n_u_OnRspQryNotice); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(0, 2820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__133);
  __Pyx_GIVEREF(__pyx_tuple__133);

  /* "ptp/TraderApi.pyx":2841
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQrySettlementInfoConfirm', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__134 = PyTuple_Pack(1, __pyx_n_u_OnRspQrySettlementInfoConfirm); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 2841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);

  /* "ptp/TraderApi.pyx":2862
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInvestorPositionCombineDetail', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__135 = PyTuple_Pack(1, __pyx_n_u_OnRspQryInvestorPositionCombineD); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 2862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);

  /* "ptp/TraderApi.pyx":2883
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryCFMMCTradingAccountKey', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__136 = PyTuple_Pack(1, __pyx_n_u_OnRspQryCFMMCTradingAccountKey); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(0, 2883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__136);
  __Pyx_GIVEREF(__pyx_tuple__136);

  /* "ptp/TraderApi.pyx":2904
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryEWarrantOffset', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__137 = PyTuple_Pack(1, __pyx_n_u_OnRspQryEWarrantOffset); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(0, 2904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);

  /* "ptp/TraderApi.pyx":2925
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInvestorProductGroupMargin', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__138 = PyTuple_Pack(1, __pyx_n_u_OnRspQryInvestorProductGroupMarg); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(0, 2925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);

  /* "ptp/TraderApi.pyx":2946
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryExchangeMarginRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__139 = PyTuple_Pack(1, __pyx_n_u_OnRspQryExchangeMarginRate); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(0, 2946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__139);
  __Pyx_GIVEREF(__pyx_tuple__139);

  /* "ptp/TraderApi.pyx":2967
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryExchangeMarginRateAdjust', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__140 = PyTuple_Pack(1, __pyx_n_u_OnRspQryExchangeMarginRateAdjust); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(0, 2967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__140);
  __Pyx_GIVEREF(__pyx_tuple__140);

  /* "ptp/TraderApi.pyx":2988
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryExchangeRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__141 = PyTuple_Pack(1, __pyx_n_u_OnRspQryExchangeRate); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(0, 2988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__141);
  __Pyx_GIVEREF(__pyx_tuple__141);

  /* "ptp/TraderApi.pyx":3009
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQrySecAgentACIDMap', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__142 = PyTuple_Pack(1, __pyx_n_u_OnRspQrySecAgentACIDMap); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(0, 3009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__142);
  __Pyx_GIVEREF(__pyx_tuple__142);

  /* "ptp/TraderApi.pyx":3030
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryProductExchRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__143 = PyTuple_Pack(1, __pyx_n_u_OnRspQryProductExchRate); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(0, 3030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__143);
  __Pyx_GIVEREF(__pyx_tuple__143);

  /* "ptp/TraderApi.pyx":3051
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryProductGroup', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__144 = PyTuple_Pack(1, __pyx_n_u_OnRspQryProductGroup); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(0, 3051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__144);
  __Pyx_GIVEREF(__pyx_tuple__144);

  /* "ptp/TraderApi.pyx":3072
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryMMInstrumentCommissionRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__145 = PyTuple_Pack(1, __pyx_n_u_OnRspQryMMInstrumentCommissionRa); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(0, 3072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__145);
  __Pyx_GIVEREF(__pyx_tuple__145);

  /* "ptp/TraderApi.pyx":3093
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryMMOptionInstrCommRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__146 = PyTuple_Pack(1, __pyx_n_u_OnRspQryMMOptionInstrCommRate); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(0, 3093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__146);
  __Pyx_GIVEREF(__pyx_tuple__146);

  /* "ptp/TraderApi.pyx":3114
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInstrumentOrderCommRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__147 = PyTuple_Pack(1, __pyx_n_u_OnRspQryInstrumentOrderCommRate); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(0, 3114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__147);
  __Pyx_GIVEREF(__pyx_tuple__147);

  /* "ptp/TraderApi.pyx":3135
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQrySecAgentTradingAccount', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__148 = PyTuple_Pack(1, __pyx_n_u_OnRspQrySecAgentTradingAccount); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(0, 3135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__148);
  __Pyx_GIVEREF(__pyx_tuple__148);

  /* "ptp/TraderApi.pyx":3156
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQrySecAgentCheckMode', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__149 = PyTuple_Pack(1, __pyx_n_u_OnRspQrySecAgentCheckMode); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(0, 3156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__149);
  __Pyx_GIVEREF(__pyx_tuple__149);

  /* "ptp/TraderApi.pyx":3177
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryOptionInstrTradeCost', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__150 = PyTuple_Pack(1, __pyx_n_u_OnRspQryOptionInstrTradeCost); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(0, 3177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__150);
  __Pyx_GIVEREF(__pyx_tuple__150);

  /* "ptp/TraderApi.pyx":3198
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryOptionInstrCommRate', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__151 = PyTuple_Pack(1, __pyx_n_u_OnRspQryOptionInstrCommRate); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(0, 3198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__151);
  __Pyx_GIVEREF(__pyx_tuple__151);

  /* "ptp/TraderApi.pyx":3219
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryExecOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__152 = PyTuple_Pack(1, __pyx_n_u_OnRspQryExecOrder); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(0, 3219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__152);
  __Pyx_GIVEREF(__pyx_tuple__152);

  /* "ptp/TraderApi.pyx":3240
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryForQuote', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__153 = PyTuple_Pack(1, __pyx_n_u_OnRspQryForQuote); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(0, 3240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__153);
  __Pyx_GIVEREF(__pyx_tuple__153);

  /* "ptp/TraderApi.pyx":3261
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryQuote', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__154 = PyTuple_Pack(1, __pyx_n_u_OnRspQryQuote); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(0, 3261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__154);
  __Pyx_GIVEREF(__pyx_tuple__154);

  /* "ptp/TraderApi.pyx":3282
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryOptionSelfClose', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__155 = PyTuple_Pack(1, __pyx_n_u_OnRspQryOptionSelfClose); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(0, 3282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__155);
  __Pyx_GIVEREF(__pyx_tuple__155);

  /* "ptp/TraderApi.pyx":3303
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryInvestUnit', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__156 = PyTuple_Pack(1, __pyx_n_u_OnRspQryInvestUnit); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(0, 3303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__156);
  __Pyx_GIVEREF(__pyx_tuple__156);

  /* "ptp/TraderApi.pyx":3324
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryCombInstrumentGuard', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__157 = PyTuple_Pack(1, __pyx_n_u_OnRspQryCombInstrumentGuard); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(0, 3324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__157);
  __Pyx_GIVEREF(__pyx_tuple__157);

  /* "ptp/TraderApi.pyx":3345
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryCombAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__158 = PyTuple_Pack(1, __pyx_n_u_OnRspQryCombAction); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(0, 3345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__158);
  __Pyx_GIVEREF(__pyx_tuple__158);

  /* "ptp/TraderApi.pyx":3366
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryTransferSerial', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__159 = PyTuple_Pack(1, __pyx_n_u_OnRspQryTransferSerial); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(0, 3366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__159);
  __Pyx_GIVEREF(__pyx_tuple__159);

  /* "ptp/TraderApi.pyx":3387
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryAccountregister', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__160 = PyTuple_Pack(1, __pyx_n_u_OnRspQryAccountregister); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(0, 3387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__160);
  __Pyx_GIVEREF(__pyx_tuple__160);

  /* "ptp/TraderApi.pyx":3406
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspError', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__161 = PyTuple_Pack(1, __pyx_n_u_OnRspError); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(0, 3406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__161);
  __Pyx_GIVEREF(__pyx_tuple__161);

  /* "ptp/TraderApi.pyx":3421
 *       self.OnRtnOrder(None if pOrder is NULL else py_ApiStructure.OrderField.from_address(<size_t> pOrder))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__162 = PyTuple_Pack(1, __pyx_n_u_OnRtnOrder); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(0, 3421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__162);
  __Pyx_GIVEREF(__pyx_tuple__162);

  /* "ptp/TraderApi.pyx":3436
 *       self.OnRtnTrade(None if pTrade is NULL else py_ApiStructure.TradeField.from_address(<size_t> pTrade))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnTrade', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__163 = PyTuple_Pack(1, __pyx_n_u_OnRtnTrade); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(0, 3436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__163);
  __Pyx_GIVEREF(__pyx_tuple__163);

  /* "ptp/TraderApi.pyx":3453
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnOrderInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__164 = PyTuple_Pack(1, __pyx_n_u_OnErrRtnOrderInsert); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(0, 3453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__164);
  __Pyx_GIVEREF(__pyx_tuple__164);

  /* "ptp/TraderApi.pyx":3470
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__165 = PyTuple_Pack(1, __pyx_n_u_OnErrRtnOrderAction); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(0, 3470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__165);
  __Pyx_GIVEREF(__pyx_tuple__165);

  /* "ptp/TraderApi.pyx":3485
 *       self.OnRtnInstrumentStatus(None if pInstrumentStatus is NULL else py_ApiStructure.InstrumentStatusField.from_address(<size_t> pInstrumentStatus))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnInstrumentStatus', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__166 = PyTuple_Pack(1, __pyx_n_u_OnRtnInstrumentStatus); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(0, 3485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__166);
  __Pyx_GIVEREF(__pyx_tuple__166);

  /* "ptp/TraderApi.pyx":3500
 *       self.OnRtnBulletin(None if pBulletin is NULL else py_ApiStructure.BulletinField.from_address(<size_t> pBulletin))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnBulletin', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__167 = PyTuple_Pack(1, __pyx_n_u_OnRtnBulletin); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(0, 3500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__167);
  __Pyx_GIVEREF(__pyx_tuple__167);

  /* "ptp/TraderApi.pyx":3515
 *       self.OnRtnTradingNotice(None if pTradingNoticeInfo is NULL else py_ApiStructure.TradingNoticeInfoField.from_address(<size_t> pTradingNoticeInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnTradingNotice', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__168 = PyTuple_Pack(1, __pyx_n_u_OnRtnTradingNotice); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(0, 3515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__168);
  __Pyx_GIVEREF(__pyx_tuple__168);

  /* "ptp/TraderApi.pyx":3530
 *       self.OnRtnErrorConditionalOrder(None if pErrorConditionalOrder is NULL else py_ApiStructure.ErrorConditionalOrderField.from_address(<size_t> pErrorConditionalOrder))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnErrorConditionalOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__169 = PyTuple_Pack(1, __pyx_n_u_OnRtnErrorConditionalOrder); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(0, 3530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__169);
  __Pyx_GIVEREF(__pyx_tuple__169);

  /* "ptp/TraderApi.pyx":3545
 *       self.OnRtnExecOrder(None if pExecOrder is NULL else py_ApiStructure.ExecOrderField.from_address(<size_t> pExecOrder))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnExecOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__170 = PyTuple_Pack(1, __pyx_n_u_OnRtnExecOrder); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(0, 3545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__170);
  __Pyx_GIVEREF(__pyx_tuple__170);

  /* "ptp/TraderApi.pyx":3562
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnExecOrderInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__171 = PyTuple_Pack(1, __pyx_n_u_OnErrRtnExecOrderInsert); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(0, 3562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__171);
  __Pyx_GIVEREF(__pyx_tuple__171);

  /* "ptp/TraderApi.pyx":3579
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnExecOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__172 = PyTuple_Pack(1, __pyx_n_u_OnErrRtnExecOrderAction); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(0, 3579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__172);
  __Pyx_GIVEREF(__pyx_tuple__172);

  /* "ptp/TraderApi.pyx":3596
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnForQuoteInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__173 = PyTuple_Pack(1, __pyx_n_u_OnErrRtnForQuoteInsert); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(0, 3596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__173);
  __Pyx_GIVEREF(__pyx_tuple__173);

  /* "ptp/TraderApi.pyx":3611
 *       self.OnRtnQuote(None if pQuote is NULL else py_ApiStructure.QuoteField.from_address(<size_t> pQuote))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnQuote', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__174 = PyTuple_Pack(1, __pyx_n_u_OnRtnQuote); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(0, 3611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__174);
  __Pyx_GIVEREF(__pyx_tuple__174);

  /* "ptp/TraderApi.pyx":3628
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnQuoteInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__175 = PyTuple_Pack(1, __pyx_n_u_OnErrRtnQuoteInsert); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(0, 3628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__175);
  __Pyx_GIVEREF(__pyx_tuple__175);

  /* "ptp/TraderApi.pyx":3645
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnQuoteAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__176 = PyTuple_Pack(1, __pyx_n_u_OnErrRtnQuoteAction); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(0, 3645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__176);
  __Pyx_GIVEREF(__pyx_tuple__176);

  /* "ptp/TraderApi.pyx":3660
 *       self.OnRtnForQuoteRsp(None if pForQuoteRsp is NULL else py_ApiStructure.ForQuoteRspField.from_address(<size_t> pForQuoteRsp))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnForQuoteRsp', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__177 = PyTuple_Pack(1, __pyx_n_u_OnRtnForQuoteRsp); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(0, 3660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__177);
  __Pyx_GIVEREF(__pyx_tuple__177);

  /* "ptp/TraderApi.pyx":3675
 *       self.OnRtnCFMMCTradingAccountToken(None if pCFMMCTradingAccountToken is NULL else py_ApiStructure.CFMMCTradingAccountTokenField.from_address(<size_t> pCFMMCTradingAccountToken))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnCFMMCTradingAccountToken', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__178 = PyTuple_Pack(1, __pyx_n_u_OnRtnCFMMCTradingAccountToken); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(0, 3675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__178);
  __Pyx_GIVEREF(__pyx_tuple__178);

  /* "ptp/TraderApi.pyx":3692
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnBatchOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__179 = PyTuple_Pack(1, __pyx_n_u_OnErrRtnBatchOrderAction); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(0, 3692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__179);
  __Pyx_GIVEREF(__pyx_tuple__179);

  /* "ptp/TraderApi.pyx":3707
 *       self.OnRtnOptionSelfClose(None if pOptionSelfClose is NULL else py_ApiStructure.OptionSelfCloseField.from_address(<size_t> pOptionSelfClose))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnOptionSelfClose', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__180 = PyTuple_Pack(1, __pyx_n_u_OnRtnOptionSelfClose); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(0, 3707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__180);
  __Pyx_GIVEREF(__pyx_tuple__180);

  /* "ptp/TraderApi.pyx":3724
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnOptionSelfCloseInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__181 = PyTuple_Pack(1, __pyx_n_u_OnErrRtnOptionSelfCloseInsert); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(0, 3724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__181);
  __Pyx_GIVEREF(__pyx_tuple__181);

  /* "ptp/TraderApi.pyx":3741
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnOptionSelfCloseAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__182 = PyTuple_Pack(1, __pyx_n_u_OnErrRtnOptionSelfCloseAction); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(0, 3741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__182);
  __Pyx_GIVEREF(__pyx_tuple__182);

  /* "ptp/TraderApi.pyx":3756
 *       self.OnRtnCombAction(None if pCombAction is NULL else py_ApiStructure.CombActionField.from_address(<size_t> pCombAction))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnCombAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__183 = PyTuple_Pack(1, __pyx_n_u_OnRtnCombAction); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(0, 3756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__183);
  __Pyx_GIVEREF(__pyx_tuple__183);

  /* "ptp/TraderApi.pyx":3773
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnCombActionInsert', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__184 = PyTuple_Pack(1, __pyx_n_u_OnErrRtnCombActionInsert); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(0, 3773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__184);
  __Pyx_GIVEREF(__pyx_tuple__184);

  /* "ptp/TraderApi.pyx":3794
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryContractBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__185 = PyTuple_Pack(1, __pyx_n_u_OnRspQryContractBank); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(0, 3794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__185);
  __Pyx_GIVEREF(__pyx_tuple__185);

  /* "ptp/TraderApi.pyx":3815
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryParkedOrder', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__186 = PyTuple_Pack(1, __pyx_n_u_OnRspQryParkedOrder); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(0, 3815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__186);
  __Pyx_GIVEREF(__pyx_tuple__186);

  /* "ptp/TraderApi.pyx":3836
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryParkedOrderAction', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__187 = PyTuple_Pack(1, __pyx_n_u_OnRspQryParkedOrderAction); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(0, 3836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__187);
  __Pyx_GIVEREF(__pyx_tuple__187);

  /* "ptp/TraderApi.pyx":3857
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryTradingNotice', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__188 = PyTuple_Pack(1, __pyx_n_u_OnRspQryTradingNotice); if (unlikely(!__pyx_tuple__188)) __PYX_ERR(0, 3857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__188);
  __Pyx_GIVEREF(__pyx_tuple__188);

  /* "ptp/TraderApi.pyx":3878
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryBrokerTradingParams', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__189 = PyTuple_Pack(1, __pyx_n_u_OnRspQryBrokerTradingParams); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(0, 3878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__189);
  __Pyx_GIVEREF(__pyx_tuple__189);

  /* "ptp/TraderApi.pyx":3899
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQryBrokerTradingAlgos', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__190 = PyTuple_Pack(1, __pyx_n_u_OnRspQryBrokerTradingAlgos); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(0, 3899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__190);
  __Pyx_GIVEREF(__pyx_tuple__190);

  /* "ptp/TraderApi.pyx":3920
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQueryCFMMCTradingAccountToken', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__191 = PyTuple_Pack(1, __pyx_n_u_OnRspQueryCFMMCTradingAccountTok); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(0, 3920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__191);
  __Pyx_GIVEREF(__pyx_tuple__191);

  /* "ptp/TraderApi.pyx":3935
 *       self.OnRtnFromBankToFutureByBank(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnFromBankToFutureByBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__192 = PyTuple_Pack(1, __pyx_n_u_OnRtnFromBankToFutureByBank); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(0, 3935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__192);
  __Pyx_GIVEREF(__pyx_tuple__192);

  /* "ptp/TraderApi.pyx":3950
 *       self.OnRtnFromFutureToBankByBank(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnFromFutureToBankByBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__193 = PyTuple_Pack(1, __pyx_n_u_OnRtnFromFutureToBankByBank); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(0, 3950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__193);
  __Pyx_GIVEREF(__pyx_tuple__193);

  /* "ptp/TraderApi.pyx":3965
 *       self.OnRtnRepealFromBankToFutureByBank(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnRepealFromBankToFutureByBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__194 = PyTuple_Pack(1, __pyx_n_u_OnRtnRepealFromBankToFutureByBan); if (unlikely(!__pyx_tuple__194)) __PYX_ERR(0, 3965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__194);
  __Pyx_GIVEREF(__pyx_tuple__194);

  /* "ptp/TraderApi.pyx":3980
 *       self.OnRtnRepealFromFutureToBankByBank(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnRepealFromFutureToBankByBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__195 = PyTuple_Pack(1, __pyx_n_u_OnRtnRepealFromFutureToBankByBan); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(0, 3980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__195);
  __Pyx_GIVEREF(__pyx_tuple__195);

  /* "ptp/TraderApi.pyx":3995
 *       self.OnRtnFromBankToFutureByFuture(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnFromBankToFutureByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__196 = PyTuple_Pack(1, __pyx_n_u_OnRtnFromBankToFutureByFuture); if (unlikely(!__pyx_tuple__196)) __PYX_ERR(0, 3995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__196);
  __Pyx_GIVEREF(__pyx_tuple__196);

  /* "ptp/TraderApi.pyx":4010
 *       self.OnRtnFromFutureToBankByFuture(None if pRspTransfer is NULL else py_ApiStructure.RspTransferField.from_address(<size_t> pRspTransfer))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnFromFutureToBankByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__197 = PyTuple_Pack(1, __pyx_n_u_OnRtnFromFutureToBankByFuture); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(0, 4010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);

  /* "ptp/TraderApi.pyx":4025
 *       self.OnRtnRepealFromBankToFutureByFutureManual(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnRepealFromBankToFutureByFutureManual', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__198 = PyTuple_Pack(1, __pyx_n_u_OnRtnRepealFromBankToFutureByFut); if (unlikely(!__pyx_tuple__198)) __PYX_ERR(0, 4025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__198);
  __Pyx_GIVEREF(__pyx_tuple__198);

  /* "ptp/TraderApi.pyx":4040
 *       self.OnRtnRepealFromFutureToBankByFutureManual(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnRepealFromFutureToBankByFutureManual', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__199 = PyTuple_Pack(1, __pyx_n_u_OnRtnRepealFromFutureToBankByFut); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(0, 4040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__199);
  __Pyx_GIVEREF(__pyx_tuple__199);

  /* "ptp/TraderApi.pyx":4055
 *       self.OnRtnQueryBankBalanceByFuture(None if pNotifyQueryAccount is NULL else py_ApiStructure.NotifyQueryAccountField.from_address(<size_t> pNotifyQueryAccount))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnQueryBankBalanceByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__200 = PyTuple_Pack(1, __pyx_n_u_OnRtnQueryBankBalanceByFuture); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(0, 4055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__200);
  __Pyx_GIVEREF(__pyx_tuple__200);

  /* "ptp/TraderApi.pyx":4072
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnBankToFutureByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__201 = PyTuple_Pack(1, __pyx_n_u_OnErrRtnBankToFutureByFuture); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(0, 4072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__201);
  __Pyx_GIVEREF(__pyx_tuple__201);

  /* "ptp/TraderApi.pyx":4089
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnFutureToBankByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__202 = PyTuple_Pack(1, __pyx_n_u_OnErrRtnFutureToBankByFuture); if (unlikely(!__pyx_tuple__202)) __PYX_ERR(0, 4089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__202);
  __Pyx_GIVEREF(__pyx_tuple__202);

  /* "ptp/TraderApi.pyx":4106
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnRepealBankToFutureByFutureManual', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__203 = PyTuple_Pack(1, __pyx_n_u_OnErrRtnRepealBankToFutureByFutu); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(0, 4106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__203);
  __Pyx_GIVEREF(__pyx_tuple__203);

  /* "ptp/TraderApi.pyx":4123
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnRepealFutureToBankByFutureManual', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__204 = PyTuple_Pack(1, __pyx_n_u_OnErrRtnRepealFutureToBankByFutu); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(0, 4123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__204);
  __Pyx_GIVEREF(__pyx_tuple__204);

  /* "ptp/TraderApi.pyx":4140
 *     ,None if pRspInfo is NULL else py_ApiStructure.RspInfoField.from_address(<size_t> pRspInfo))
 *   except Exception as err:
 *       myEnv.logger.error('OnErrRtnQueryBankBalanceByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__205 = PyTuple_Pack(1, __pyx_n_u_OnErrRtnQueryBankBalanceByFuture); if (unlikely(!__pyx_tuple__205)) __PYX_ERR(0, 4140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__205);
  __Pyx_GIVEREF(__pyx_tuple__205);

  /* "ptp/TraderApi.pyx":4155
 *       self.OnRtnRepealFromBankToFutureByFuture(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnRepealFromBankToFutureByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__206 = PyTuple_Pack(1, __pyx_n_u_OnRtnRepealFromBankToFutureByFut_2); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(0, 4155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__206);
  __Pyx_GIVEREF(__pyx_tuple__206);

  /* "ptp/TraderApi.pyx":4170
 *       self.OnRtnRepealFromFutureToBankByFuture(None if pRspRepeal is NULL else py_ApiStructure.RspRepealField.from_address(<size_t> pRspRepeal))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnRepealFromFutureToBankByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__207 = PyTuple_Pack(1, __pyx_n_u_OnRtnRepealFromFutureToBankByFut_2); if (unlikely(!__pyx_tuple__207)) __PYX_ERR(0, 4170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__207);
  __Pyx_GIVEREF(__pyx_tuple__207);

  /* "ptp/TraderApi.pyx":4191
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspFromBankToFutureByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__208 = PyTuple_Pack(1, __pyx_n_u_OnRspFromBankToFutureByFuture); if (unlikely(!__pyx_tuple__208)) __PYX_ERR(0, 4191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__208);
  __Pyx_GIVEREF(__pyx_tuple__208);

  /* "ptp/TraderApi.pyx":4212
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspFromFutureToBankByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__209 = PyTuple_Pack(1, __pyx_n_u_OnRspFromFutureToBankByFuture); if (unlikely(!__pyx_tuple__209)) __PYX_ERR(0, 4212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__209);
  __Pyx_GIVEREF(__pyx_tuple__209);

  /* "ptp/TraderApi.pyx":4233
 *     ,bIsLast)
 *   except Exception as err:
 *       myEnv.logger.error('OnRspQueryBankAccountMoneyByFuture', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__210 = PyTuple_Pack(1, __pyx_n_u_OnRspQueryBankAccountMoneyByFutu); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(0, 4233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__210);
  __Pyx_GIVEREF(__pyx_tuple__210);

  /* "ptp/TraderApi.pyx":4248
 *       self.OnRtnOpenAccountByBank(None if pOpenAccount is NULL else py_ApiStructure.OpenAccountField.from_address(<size_t> pOpenAccount))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnOpenAccountByBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__211 = PyTuple_Pack(1, __pyx_n_u_OnRtnOpenAccountByBank); if (unlikely(!__pyx_tuple__211)) __PYX_ERR(0, 4248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__211);
  __Pyx_GIVEREF(__pyx_tuple__211);

  /* "ptp/TraderApi.pyx":4263
 *       self.OnRtnCancelAccountByBank(None if pCancelAccount is NULL else py_ApiStructure.CancelAccountField.from_address(<size_t> pCancelAccount))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnCancelAccountByBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__212 = PyTuple_Pack(1, __pyx_n_u_OnRtnCancelAccountByBank); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(0, 4263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__212);
  __Pyx_GIVEREF(__pyx_tuple__212);

  /* "ptp/TraderApi.pyx":4278
 *       self.OnRtnChangeAccountByBank(None if pChangeAccount is NULL else py_ApiStructure.ChangeAccountField.from_address(<size_t> pChangeAccount))
 *   except Exception as err:
 *       myEnv.logger.error('OnRtnChangeAccountByBank', exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *   return 0
 */
  __pyx_tuple__213 = PyTuple_Pack(1, __pyx_n_u_OnRtnChangeAccountByBank); if (unlikely(!__pyx_tuple__213)) __PYX_ERR(0, 4278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__213);
  __Pyx_GIVEREF(__pyx_tuple__213);

  /* "ptp/TraderApi.pyx":42
 *     printString("TraderApicall_stack","call-<",funName)
 * 
 *   def Inc_RequestID(self):             # <<<<<<<<<<<<<<
 *     self.RequestID = self.RequestID + 1
 *     return self.RequestID
 */
  __pyx_tuple__215 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(0, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__215);
  __Pyx_GIVEREF(__pyx_tuple__215);
  __pyx_codeobj__216 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__215, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_Inc_RequestID, 42, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__216)) __PYX_ERR(0, 42, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":74
 * 
 *   @staticmethod
 *   def GetApiVersion():             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % ("Trader", "GetApiVersion")
 *     printString("TraderApicall_stack","call->",funName)
 */
  __pyx_tuple__217 = PyTuple_Pack(1, __pyx_n_s_funName); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(0, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__217);
  __Pyx_GIVEREF(__pyx_tuple__217);
  __pyx_codeobj__218 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__217, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_GetApiVersion, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__218)) __PYX_ERR(0, 74, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":80
 *     printString("TraderApicall_stack","call-<",funName)
 * 
 *   def Release(self):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */
  __pyx_tuple__219 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_funName); if (unlikely(!__pyx_tuple__219)) __PYX_ERR(0, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__219);
  __Pyx_GIVEREF(__pyx_tuple__219);
  __pyx_codeobj__220 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__219, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_Release, 80, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__220)) __PYX_ERR(0, 80, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":94
 * 
 * 
 *   def Init_Base(self):             # <<<<<<<<<<<<<<
 *     bInit=-1
 *     try:
 */
  __pyx_tuple__221 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_bInit, __pyx_n_s_err); if (unlikely(!__pyx_tuple__221)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__221);
  __Pyx_GIVEREF(__pyx_tuple__221);
  __pyx_codeobj__222 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__221, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_Init_Base, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__222)) __PYX_ERR(0, 94, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":112
 *     return bInit
 * 
 *   def Init_Net(self):             # <<<<<<<<<<<<<<
 *     try:
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  __pyx_tuple__223 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_funName, __pyx_n_s_bInit, __pyx_n_s_logDes, __pyx_n_s_server, __pyx_n_s_err); if (unlikely(!__pyx_tuple__223)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__223);
  __Pyx_GIVEREF(__pyx_tuple__223);
  __pyx_codeobj__224 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__223, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_Init_Net, 112, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__224)) __PYX_ERR(0, 112, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":156
 *     return bInit
 * 
 *   def Join(self):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */
  __pyx_tuple__225 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_funName, __pyx_n_s_result, __pyx_n_s_err); if (unlikely(!__pyx_tuple__225)) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__225);
  __Pyx_GIVEREF(__pyx_tuple__225);
  __pyx_codeobj__226 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__225, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_Join, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__226)) __PYX_ERR(0, 156, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":173
 * 
 * 
 *   def GetTradingDay(self):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */
  __pyx_tuple__227 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_funName, __pyx_n_s_result, __pyx_n_s_err); if (unlikely(!__pyx_tuple__227)) __PYX_ERR(0, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__227);
  __Pyx_GIVEREF(__pyx_tuple__227);
  __pyx_codeobj__228 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__227, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_GetTradingDay, 173, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__228)) __PYX_ERR(0, 173, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":191
 * 
 * 
 *   def RegisterFront(self, char *pszFrontAddress):             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName)
 */
  __pyx_tuple__229 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_pszFrontAddress, __pyx_n_s_pszFrontAddress, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__229);
  __Pyx_GIVEREF(__pyx_tuple__229);
  __pyx_codeobj__230 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__229, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_RegisterFront, 191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__230)) __PYX_ERR(0, 191, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":203
 *       printString("TraderApicall_stack","call-<",funName)
 * 
 *   def RegisterNameServer(self, char *pszNsAddress):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */
  __pyx_tuple__231 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_pszNsAddress, __pyx_n_s_pszNsAddress, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(0, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__231);
  __Pyx_GIVEREF(__pyx_tuple__231);
  __pyx_codeobj__232 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__231, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_RegisterNameServer, 203, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__232)) __PYX_ERR(0, 203, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":215
 *     printString("TraderApicall_stack","call-<",funName)
 * 
 *   def RegisterFensUserInfo(self, pFensUserInfo):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */
  __pyx_tuple__233 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_pFensUserInfo, __pyx_n_s_funName, __pyx_n_s_address, __pyx_n_s_err); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__233);
  __Pyx_GIVEREF(__pyx_tuple__233);
  __pyx_codeobj__234 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__233, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_RegisterFensUserInfo, 215, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__234)) __PYX_ERR(0, 215, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":231
 *     printString("TraderApicall_stack","call-<",funName)
 * 
 *   def SubscribePrivateTopic(self, THOST_TE_RESUME_TYPE nResumeType):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */
  __pyx_tuple__235 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_nResumeType, __pyx_n_s_nResumeType, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__235);
  __Pyx_GIVEREF(__pyx_tuple__235);
  __pyx_codeobj__236 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__235, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_SubscribePrivateTopic, 231, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__236)) __PYX_ERR(0, 231, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":249
 *   #        THOST_TERT_QUICK:
 *   #@remark Init
 *   def SubscribePublicTopic(self, THOST_TE_RESUME_TYPE nResumeType):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */
  __pyx_tuple__237 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_nResumeType, __pyx_n_s_nResumeType, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__237)) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__237);
  __Pyx_GIVEREF(__pyx_tuple__237);
  __pyx_codeobj__238 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__237, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_SubscribePublicTopic, 249, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__238)) __PYX_ERR(0, 249, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":261
 * 
 *   #
 *   def  ReqAuthenticate(self, pReqAuthenticateField, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__239 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pReqAuthenticateField, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__239)) __PYX_ERR(0, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__239);
  __Pyx_GIVEREF(__pyx_tuple__239);
  __pyx_codeobj__240 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__239, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqAuthenticate, 261, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) __PYX_ERR(0, 261, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":284
 * 
 *   #
 *   def  ReqUserLogin(self, pReqUserLoginField, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__241 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pReqUserLoginField, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__241)) __PYX_ERR(0, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__241);
  __Pyx_GIVEREF(__pyx_tuple__241);
  __pyx_codeobj__242 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__241, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqUserLogin, 284, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__242)) __PYX_ERR(0, 284, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":307
 * 
 *   #
 *   def  ReqUserLogout(self, pUserLogout, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__243 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pUserLogout, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(0, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__243);
  __Pyx_GIVEREF(__pyx_tuple__243);
  __pyx_codeobj__244 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__243, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqUserLogout, 307, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__244)) __PYX_ERR(0, 307, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":330
 * 
 *   #
 *   def  ReqUserPasswordUpdate(self, pUserPasswordUpdate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__245 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pUserPasswordUpdate, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__245)) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__245);
  __Pyx_GIVEREF(__pyx_tuple__245);
  __pyx_codeobj__246 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__245, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqUserPasswordUpdate, 330, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__246)) __PYX_ERR(0, 330, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":353
 * 
 *   #
 *   def  ReqTradingAccountPasswordUpdate(self, pTradingAccountPasswordUpdate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__247 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pTradingAccountPasswordUpdate, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__247);
  __Pyx_GIVEREF(__pyx_tuple__247);
  __pyx_codeobj__248 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__247, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqTradingAccountPasswordUpdate, 353, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__248)) __PYX_ERR(0, 353, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":376
 * 
 *   #2
 *   def  ReqUserLogin2(self, pReqUserLogin, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__249 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pReqUserLogin, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__249)) __PYX_ERR(0, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__249);
  __Pyx_GIVEREF(__pyx_tuple__249);
  __pyx_codeobj__250 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__249, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqUserLogin2, 376, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__250)) __PYX_ERR(0, 376, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":399
 * 
 *   #2
 *   def  ReqUserPasswordUpdate2(self, pUserPasswordUpdate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__251 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pUserPasswordUpdate, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__251)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__251);
  __Pyx_GIVEREF(__pyx_tuple__251);
  __pyx_codeobj__252 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__251, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqUserPasswordUpdate2, 399, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__252)) __PYX_ERR(0, 399, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":422
 * 
 *   #
 *   def  ReqOrderInsert(self, pInputOrder, int nRequestID, express="ctp", md_lastPrice=0):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__253 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_pInputOrder, __pyx_n_s_nRequestID, __pyx_n_s_express, __pyx_n_s_md_lastPrice, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__253)) __PYX_ERR(0, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__253);
  __Pyx_GIVEREF(__pyx_tuple__253);
  __pyx_codeobj__254 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__253, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqOrderInsert, 422, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__254)) __PYX_ERR(0, 422, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":445
 * 
 *   #
 *   def  ReqParkedOrderInsert(self, pParkedOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__255 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pParkedOrder, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__255)) __PYX_ERR(0, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__255);
  __Pyx_GIVEREF(__pyx_tuple__255);
  __pyx_codeobj__256 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__255, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqParkedOrderInsert, 445, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__256)) __PYX_ERR(0, 445, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":468
 * 
 *   #
 *   def  ReqParkedOrderAction(self, pParkedOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__257 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pParkedOrderAction, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__257)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__257);
  __Pyx_GIVEREF(__pyx_tuple__257);
  __pyx_codeobj__258 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__257, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqParkedOrderAction, 468, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__258)) __PYX_ERR(0, 468, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":491
 * 
 *   #
 *   def  ReqOrderAction(self, pInputOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__259 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pInputOrderAction, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__259)) __PYX_ERR(0, 491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__259);
  __Pyx_GIVEREF(__pyx_tuple__259);
  __pyx_codeobj__260 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__259, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqOrderAction, 491, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__260)) __PYX_ERR(0, 491, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":514
 * 
 *   #
 *   def  ReqQueryMaxOrderVolume(self, pQueryMaxOrderVolume, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__261 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQueryMaxOrderVolume, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__261)) __PYX_ERR(0, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__261);
  __Pyx_GIVEREF(__pyx_tuple__261);
  __pyx_codeobj__262 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__261, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQueryMaxOrderVolume, 514, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__262)) __PYX_ERR(0, 514, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":536
 * 
 *   #
 *   def  ReqSettlementInfoConfirm(self, pSettlementInfoConfirm, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__263 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pSettlementInfoConfirm, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__263)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__263);
  __Pyx_GIVEREF(__pyx_tuple__263);
  __pyx_codeobj__264 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__263, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqSettlementInfoConfirm, 536, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__264)) __PYX_ERR(0, 536, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":559
 * 
 *   #
 *   def  ReqRemoveParkedOrder(self, pRemoveParkedOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__265 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pRemoveParkedOrder, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__265)) __PYX_ERR(0, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__265);
  __Pyx_GIVEREF(__pyx_tuple__265);
  __pyx_codeobj__266 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__265, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqRemoveParkedOrder, 559, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__266)) __PYX_ERR(0, 559, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":582
 * 
 *   #
 *   def  ReqRemoveParkedOrderAction(self, pRemoveParkedOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__267 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pRemoveParkedOrderAction, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__267)) __PYX_ERR(0, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__267);
  __Pyx_GIVEREF(__pyx_tuple__267);
  __pyx_codeobj__268 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__267, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqRemoveParkedOrderAction, 582, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__268)) __PYX_ERR(0, 582, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":605
 * 
 *   #
 *   def  ReqExecOrderInsert(self, pInputExecOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__269 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pInputExecOrder, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__269)) __PYX_ERR(0, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__269);
  __Pyx_GIVEREF(__pyx_tuple__269);
  __pyx_codeobj__270 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__269, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqExecOrderInsert, 605, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__270)) __PYX_ERR(0, 605, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":628
 * 
 *   #
 *   def  ReqExecOrderAction(self, pInputExecOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__271 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pInputExecOrderAction, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__271)) __PYX_ERR(0, 628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__271);
  __Pyx_GIVEREF(__pyx_tuple__271);
  __pyx_codeobj__272 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__271, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqExecOrderAction, 628, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__272)) __PYX_ERR(0, 628, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":651
 * 
 *   #
 *   def  ReqForQuoteInsert(self, pInputForQuote, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__273 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pInputForQuote, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__273)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__273);
  __Pyx_GIVEREF(__pyx_tuple__273);
  __pyx_codeobj__274 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__273, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqForQuoteInsert, 651, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__274)) __PYX_ERR(0, 651, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":674
 * 
 *   #
 *   def  ReqQuoteInsert(self, pInputQuote, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__275 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pInputQuote, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__275)) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__275);
  __Pyx_GIVEREF(__pyx_tuple__275);
  __pyx_codeobj__276 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__275, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQuoteInsert, 674, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__276)) __PYX_ERR(0, 674, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":697
 * 
 *   #
 *   def  ReqQuoteAction(self, pInputQuoteAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__277 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pInputQuoteAction, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__277)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__277);
  __Pyx_GIVEREF(__pyx_tuple__277);
  __pyx_codeobj__278 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__277, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQuoteAction, 697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__278)) __PYX_ERR(0, 697, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":720
 * 
 *   #
 *   def  ReqBatchOrderAction(self, pInputBatchOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__279 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pInputBatchOrderAction, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__279)) __PYX_ERR(0, 720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__279);
  __Pyx_GIVEREF(__pyx_tuple__279);
  __pyx_codeobj__280 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__279, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqBatchOrderAction, 720, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__280)) __PYX_ERR(0, 720, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":743
 * 
 *   #
 *   def  ReqOptionSelfCloseInsert(self, pInputOptionSelfClose, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__281 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pInputOptionSelfClose, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__281)) __PYX_ERR(0, 743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__281);
  __Pyx_GIVEREF(__pyx_tuple__281);
  __pyx_codeobj__282 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__281, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqOptionSelfCloseInsert, 743, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__282)) __PYX_ERR(0, 743, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":766
 * 
 *   #
 *   def  ReqOptionSelfCloseAction(self, pInputOptionSelfCloseAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__283 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pInputOptionSelfCloseAction, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__283)) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__283);
  __Pyx_GIVEREF(__pyx_tuple__283);
  __pyx_codeobj__284 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__283, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqOptionSelfCloseAction, 766, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__284)) __PYX_ERR(0, 766, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":789
 * 
 *   #
 *   def  ReqCombActionInsert(self, pInputCombAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__285 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pInputCombAction, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__285)) __PYX_ERR(0, 789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__285);
  __Pyx_GIVEREF(__pyx_tuple__285);
  __pyx_codeobj__286 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__285, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqCombActionInsert, 789, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__286)) __PYX_ERR(0, 789, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":812
 * 
 *   #
 *   def  ReqQryOrder(self, pQryOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__287 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryOrder, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__287)) __PYX_ERR(0, 812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__287);
  __Pyx_GIVEREF(__pyx_tuple__287);
  __pyx_codeobj__288 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__287, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryOrder, 812, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__288)) __PYX_ERR(0, 812, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":834
 * 
 *   #
 *   def  ReqQryTrade(self, pQryTrade, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__289 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryTrade, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__289)) __PYX_ERR(0, 834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__289);
  __Pyx_GIVEREF(__pyx_tuple__289);
  __pyx_codeobj__290 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__289, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryTrade, 834, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__290)) __PYX_ERR(0, 834, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":856
 * 
 *   #
 *   def  ReqQryInvestorPosition(self, pQryInvestorPosition, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__291 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryInvestorPosition, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__291)) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__291);
  __Pyx_GIVEREF(__pyx_tuple__291);
  __pyx_codeobj__292 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__291, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryInvestorPosition, 856, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__292)) __PYX_ERR(0, 856, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":878
 * 
 *   #
 *   def  ReqQryTradingAccount(self, pQryTradingAccount, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__293 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryTradingAccount, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__293)) __PYX_ERR(0, 878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__293);
  __Pyx_GIVEREF(__pyx_tuple__293);
  __pyx_codeobj__294 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__293, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryTradingAccount, 878, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__294)) __PYX_ERR(0, 878, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":900
 * 
 *   #
 *   def  ReqQryInvestor(self, pQryInvestor, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__295 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryInvestor, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__295)) __PYX_ERR(0, 900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__295);
  __Pyx_GIVEREF(__pyx_tuple__295);
  __pyx_codeobj__296 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__295, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryInvestor, 900, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__296)) __PYX_ERR(0, 900, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":922
 * 
 *   #
 *   def  ReqQryTradingCode(self, pQryTradingCode, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__297 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryTradingCode, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__297)) __PYX_ERR(0, 922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__297);
  __Pyx_GIVEREF(__pyx_tuple__297);
  __pyx_codeobj__298 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__297, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryTradingCode, 922, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__298)) __PYX_ERR(0, 922, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":944
 * 
 *   #
 *   def  ReqQryInstrumentMarginRate(self, pQryInstrumentMarginRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__299 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryInstrumentMarginRate, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__299)) __PYX_ERR(0, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__299);
  __Pyx_GIVEREF(__pyx_tuple__299);
  __pyx_codeobj__300 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__299, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryInstrumentMarginRate, 944, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__300)) __PYX_ERR(0, 944, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":966
 * 
 *   #
 *   def  ReqQryInstrumentCommissionRate(self, pQryInstrumentCommissionRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__301 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryInstrumentCommissionRate, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__301)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__301);
  __Pyx_GIVEREF(__pyx_tuple__301);
  __pyx_codeobj__302 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__301, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryInstrumentCommissionRate, 966, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__302)) __PYX_ERR(0, 966, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":988
 * 
 *   #
 *   def  ReqQryExchange(self, pQryExchange, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__303 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryExchange, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__303)) __PYX_ERR(0, 988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__303);
  __Pyx_GIVEREF(__pyx_tuple__303);
  __pyx_codeobj__304 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__303, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryExchange, 988, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__304)) __PYX_ERR(0, 988, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1010
 * 
 *   #
 *   def  ReqQryProduct(self, pQryProduct, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__305 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryProduct, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__305)) __PYX_ERR(0, 1010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__305);
  __Pyx_GIVEREF(__pyx_tuple__305);
  __pyx_codeobj__306 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__305, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryProduct, 1010, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__306)) __PYX_ERR(0, 1010, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1032
 * 
 *   #
 *   def  ReqQryInstrument(self, pQryInstrument, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__307 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryInstrument, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__307)) __PYX_ERR(0, 1032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__307);
  __Pyx_GIVEREF(__pyx_tuple__307);
  __pyx_codeobj__308 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__307, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryInstrument, 1032, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__308)) __PYX_ERR(0, 1032, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1054
 * 
 *   #
 *   def  ReqQryDepthMarketData(self, pQryDepthMarketData, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__309 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryDepthMarketData, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__309)) __PYX_ERR(0, 1054, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__309);
  __Pyx_GIVEREF(__pyx_tuple__309);
  __pyx_codeobj__310 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__309, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryDepthMarketData, 1054, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__310)) __PYX_ERR(0, 1054, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1076
 * 
 *   #
 *   def  ReqQrySettlementInfo(self, pQrySettlementInfo, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__311 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQrySettlementInfo, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__311)) __PYX_ERR(0, 1076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__311);
  __Pyx_GIVEREF(__pyx_tuple__311);
  __pyx_codeobj__312 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__311, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQrySettlementInfo, 1076, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__312)) __PYX_ERR(0, 1076, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1098
 * 
 *   #
 *   def  ReqQryTransferBank(self, pQryTransferBank, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__313 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryTransferBank, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__313)) __PYX_ERR(0, 1098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__313);
  __Pyx_GIVEREF(__pyx_tuple__313);
  __pyx_codeobj__314 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__313, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryTransferBank, 1098, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__314)) __PYX_ERR(0, 1098, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1120
 * 
 *   #
 *   def  ReqQryInvestorPositionDetail(self, pQryInvestorPositionDetail, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__315 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryInvestorPositionDetail, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__315)) __PYX_ERR(0, 1120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__315);
  __Pyx_GIVEREF(__pyx_tuple__315);
  __pyx_codeobj__316 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__315, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryInvestorPositionDetail, 1120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__316)) __PYX_ERR(0, 1120, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1142
 * 
 *   #
 *   def  ReqQryNotice(self, pQryNotice, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__317 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryNotice, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__317)) __PYX_ERR(0, 1142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__317);
  __Pyx_GIVEREF(__pyx_tuple__317);
  __pyx_codeobj__318 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__317, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryNotice, 1142, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__318)) __PYX_ERR(0, 1142, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1164
 * 
 *   #
 *   def  ReqQrySettlementInfoConfirm(self, pQrySettlementInfoConfirm, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__319 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQrySettlementInfoConfirm, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__319)) __PYX_ERR(0, 1164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__319);
  __Pyx_GIVEREF(__pyx_tuple__319);
  __pyx_codeobj__320 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__319, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQrySettlementInfoConfirm, 1164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__320)) __PYX_ERR(0, 1164, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1186
 * 
 *   #
 *   def  ReqQryInvestorPositionCombineDetail(self, pQryInvestorPositionCombineDetail, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__321 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryInvestorPositionCombineDetai, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__321)) __PYX_ERR(0, 1186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__321);
  __Pyx_GIVEREF(__pyx_tuple__321);
  __pyx_codeobj__322 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__321, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryInvestorPositionCombineDet, 1186, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__322)) __PYX_ERR(0, 1186, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1208
 * 
 *   #
 *   def  ReqQryCFMMCTradingAccountKey(self, pQryCFMMCTradingAccountKey, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__323 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryCFMMCTradingAccountKey, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__323)) __PYX_ERR(0, 1208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__323);
  __Pyx_GIVEREF(__pyx_tuple__323);
  __pyx_codeobj__324 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__323, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryCFMMCTradingAccountKey, 1208, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__324)) __PYX_ERR(0, 1208, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1230
 * 
 *   #
 *   def  ReqQryEWarrantOffset(self, pQryEWarrantOffset, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__325 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryEWarrantOffset, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__325)) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__325);
  __Pyx_GIVEREF(__pyx_tuple__325);
  __pyx_codeobj__326 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__325, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryEWarrantOffset, 1230, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__326)) __PYX_ERR(0, 1230, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1252
 * 
 *   #/
 *   def  ReqQryInvestorProductGroupMargin(self, pQryInvestorProductGroupMargin, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__327 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryInvestorProductGroupMargin, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__327)) __PYX_ERR(0, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__327);
  __Pyx_GIVEREF(__pyx_tuple__327);
  __pyx_codeobj__328 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__327, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryInvestorProductGroupMargin, 1252, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__328)) __PYX_ERR(0, 1252, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1274
 * 
 *   #
 *   def  ReqQryExchangeMarginRate(self, pQryExchangeMarginRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__329 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryExchangeMarginRate, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__329)) __PYX_ERR(0, 1274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__329);
  __Pyx_GIVEREF(__pyx_tuple__329);
  __pyx_codeobj__330 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__329, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryExchangeMarginRate, 1274, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__330)) __PYX_ERR(0, 1274, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1296
 * 
 *   #
 *   def  ReqQryExchangeMarginRateAdjust(self, pQryExchangeMarginRateAdjust, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__331 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryExchangeMarginRateAdjust, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__331)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__331);
  __Pyx_GIVEREF(__pyx_tuple__331);
  __pyx_codeobj__332 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__331, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryExchangeMarginRateAdjust, 1296, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__332)) __PYX_ERR(0, 1296, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1318
 * 
 *   #
 *   def  ReqQryExchangeRate(self, pQryExchangeRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__333 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryExchangeRate, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__333)) __PYX_ERR(0, 1318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__333);
  __Pyx_GIVEREF(__pyx_tuple__333);
  __pyx_codeobj__334 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__333, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryExchangeRate, 1318, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__334)) __PYX_ERR(0, 1318, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1340
 * 
 *   #
 *   def  ReqQrySecAgentACIDMap(self, pQrySecAgentACIDMap, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__335 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQrySecAgentACIDMap, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__335)) __PYX_ERR(0, 1340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__335);
  __Pyx_GIVEREF(__pyx_tuple__335);
  __pyx_codeobj__336 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__335, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQrySecAgentACIDMap, 1340, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__336)) __PYX_ERR(0, 1340, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1362
 * 
 *   #
 *   def  ReqQryProductExchRate(self, pQryProductExchRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__337 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryProductExchRate, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__337)) __PYX_ERR(0, 1362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__337);
  __Pyx_GIVEREF(__pyx_tuple__337);
  __pyx_codeobj__338 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__337, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryProductExchRate, 1362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__338)) __PYX_ERR(0, 1362, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1384
 * 
 *   #
 *   def  ReqQryProductGroup(self, pQryProductGroup, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__339 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryProductGroup, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__339)) __PYX_ERR(0, 1384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__339);
  __Pyx_GIVEREF(__pyx_tuple__339);
  __pyx_codeobj__340 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__339, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryProductGroup, 1384, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__340)) __PYX_ERR(0, 1384, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1406
 * 
 *   #
 *   def  ReqQryMMInstrumentCommissionRate(self, pQryMMInstrumentCommissionRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__341 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryMMInstrumentCommissionRate, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__341)) __PYX_ERR(0, 1406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__341);
  __Pyx_GIVEREF(__pyx_tuple__341);
  __pyx_codeobj__342 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__341, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryMMInstrumentCommissionRate, 1406, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__342)) __PYX_ERR(0, 1406, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1428
 * 
 *   #
 *   def  ReqQryMMOptionInstrCommRate(self, pQryMMOptionInstrCommRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__343 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryMMOptionInstrCommRate, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__343)) __PYX_ERR(0, 1428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__343);
  __Pyx_GIVEREF(__pyx_tuple__343);
  __pyx_codeobj__344 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__343, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryMMOptionInstrCommRate, 1428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__344)) __PYX_ERR(0, 1428, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1450
 * 
 *   #
 *   def  ReqQryInstrumentOrderCommRate(self, pQryInstrumentOrderCommRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__345 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryInstrumentOrderCommRate, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__345)) __PYX_ERR(0, 1450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__345);
  __Pyx_GIVEREF(__pyx_tuple__345);
  __pyx_codeobj__346 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__345, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryInstrumentOrderCommRate, 1450, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__346)) __PYX_ERR(0, 1450, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1472
 * 
 *   #
 *   def  ReqQrySecAgentTradingAccount(self, pQryTradingAccount, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__347 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryTradingAccount, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__347)) __PYX_ERR(0, 1472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__347);
  __Pyx_GIVEREF(__pyx_tuple__347);
  __pyx_codeobj__348 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__347, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQrySecAgentTradingAccount, 1472, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__348)) __PYX_ERR(0, 1472, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1494
 * 
 *   #
 *   def  ReqQrySecAgentCheckMode(self, pQrySecAgentCheckMode, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__349 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQrySecAgentCheckMode, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__349)) __PYX_ERR(0, 1494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__349);
  __Pyx_GIVEREF(__pyx_tuple__349);
  __pyx_codeobj__350 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__349, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQrySecAgentCheckMode, 1494, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__350)) __PYX_ERR(0, 1494, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1516
 * 
 *   #
 *   def  ReqQryOptionInstrTradeCost(self, pQryOptionInstrTradeCost, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__351 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryOptionInstrTradeCost, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__351)) __PYX_ERR(0, 1516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__351);
  __Pyx_GIVEREF(__pyx_tuple__351);
  __pyx_codeobj__352 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__351, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryOptionInstrTradeCost, 1516, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__352)) __PYX_ERR(0, 1516, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1538
 * 
 *   #
 *   def  ReqQryOptionInstrCommRate(self, pQryOptionInstrCommRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__353 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryOptionInstrCommRate, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__353)) __PYX_ERR(0, 1538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__353);
  __Pyx_GIVEREF(__pyx_tuple__353);
  __pyx_codeobj__354 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__353, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryOptionInstrCommRate, 1538, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__354)) __PYX_ERR(0, 1538, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1560
 * 
 *   #
 *   def  ReqQryExecOrder(self, pQryExecOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__355 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryExecOrder, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__355)) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__355);
  __Pyx_GIVEREF(__pyx_tuple__355);
  __pyx_codeobj__356 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__355, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryExecOrder, 1560, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__356)) __PYX_ERR(0, 1560, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1582
 * 
 *   #
 *   def  ReqQryForQuote(self, pQryForQuote, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__357 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryForQuote, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__357)) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__357);
  __Pyx_GIVEREF(__pyx_tuple__357);
  __pyx_codeobj__358 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__357, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryForQuote, 1582, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__358)) __PYX_ERR(0, 1582, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1604
 * 
 *   #
 *   def  ReqQryQuote(self, pQryQuote, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__359 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryQuote, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__359)) __PYX_ERR(0, 1604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__359);
  __Pyx_GIVEREF(__pyx_tuple__359);
  __pyx_codeobj__360 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__359, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryQuote, 1604, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__360)) __PYX_ERR(0, 1604, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1626
 * 
 *   #
 *   def  ReqQryOptionSelfClose(self, pQryOptionSelfClose, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__361 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryOptionSelfClose, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__361)) __PYX_ERR(0, 1626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__361);
  __Pyx_GIVEREF(__pyx_tuple__361);
  __pyx_codeobj__362 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__361, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryOptionSelfClose, 1626, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__362)) __PYX_ERR(0, 1626, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1648
 * 
 *   #
 *   def  ReqQryInvestUnit(self, pQryInvestUnit, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__363 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryInvestUnit, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__363)) __PYX_ERR(0, 1648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__363);
  __Pyx_GIVEREF(__pyx_tuple__363);
  __pyx_codeobj__364 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__363, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryInvestUnit, 1648, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__364)) __PYX_ERR(0, 1648, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1670
 * 
 *   #
 *   def  ReqQryCombInstrumentGuard(self, pQryCombInstrumentGuard, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__365 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryCombInstrumentGuard, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__365)) __PYX_ERR(0, 1670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__365);
  __Pyx_GIVEREF(__pyx_tuple__365);
  __pyx_codeobj__366 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__365, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryCombInstrumentGuard, 1670, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__366)) __PYX_ERR(0, 1670, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1692
 * 
 *   #
 *   def  ReqQryCombAction(self, pQryCombAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__367 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryCombAction, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__367)) __PYX_ERR(0, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__367);
  __Pyx_GIVEREF(__pyx_tuple__367);
  __pyx_codeobj__368 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__367, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryCombAction, 1692, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__368)) __PYX_ERR(0, 1692, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1714
 * 
 *   #
 *   def  ReqQryTransferSerial(self, pQryTransferSerial, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__369 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryTransferSerial, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__369)) __PYX_ERR(0, 1714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__369);
  __Pyx_GIVEREF(__pyx_tuple__369);
  __pyx_codeobj__370 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__369, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryTransferSerial, 1714, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__370)) __PYX_ERR(0, 1714, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1736
 * 
 *   #
 *   def  ReqQryAccountregister(self, pQryAccountregister, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__371 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryAccountregister, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__371)) __PYX_ERR(0, 1736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__371);
  __Pyx_GIVEREF(__pyx_tuple__371);
  __pyx_codeobj__372 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__371, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryAccountregister, 1736, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__372)) __PYX_ERR(0, 1736, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1758
 * 
 *   #
 *   def  ReqQryContractBank(self, pQryContractBank, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__373 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryContractBank, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__373)) __PYX_ERR(0, 1758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__373);
  __Pyx_GIVEREF(__pyx_tuple__373);
  __pyx_codeobj__374 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__373, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryContractBank, 1758, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__374)) __PYX_ERR(0, 1758, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1780
 * 
 *   #
 *   def  ReqQryParkedOrder(self, pQryParkedOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__375 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryParkedOrder, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__375)) __PYX_ERR(0, 1780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__375);
  __Pyx_GIVEREF(__pyx_tuple__375);
  __pyx_codeobj__376 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__375, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryParkedOrder, 1780, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__376)) __PYX_ERR(0, 1780, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1802
 * 
 *   #
 *   def  ReqQryParkedOrderAction(self, pQryParkedOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__377 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryParkedOrderAction, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__377)) __PYX_ERR(0, 1802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__377);
  __Pyx_GIVEREF(__pyx_tuple__377);
  __pyx_codeobj__378 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__377, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryParkedOrderAction, 1802, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__378)) __PYX_ERR(0, 1802, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1824
 * 
 *   #
 *   def  ReqQryTradingNotice(self, pQryTradingNotice, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__379 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryTradingNotice, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__379)) __PYX_ERR(0, 1824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__379);
  __Pyx_GIVEREF(__pyx_tuple__379);
  __pyx_codeobj__380 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__379, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryTradingNotice, 1824, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__380)) __PYX_ERR(0, 1824, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1846
 * 
 *   #
 *   def  ReqQryBrokerTradingParams(self, pQryBrokerTradingParams, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__381 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryBrokerTradingParams, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__381)) __PYX_ERR(0, 1846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__381);
  __Pyx_GIVEREF(__pyx_tuple__381);
  __pyx_codeobj__382 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__381, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryBrokerTradingParams, 1846, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__382)) __PYX_ERR(0, 1846, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1868
 * 
 *   #
 *   def  ReqQryBrokerTradingAlgos(self, pQryBrokerTradingAlgos, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__383 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQryBrokerTradingAlgos, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__383)) __PYX_ERR(0, 1868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__383);
  __Pyx_GIVEREF(__pyx_tuple__383);
  __pyx_codeobj__384 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__383, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQryBrokerTradingAlgos, 1868, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__384)) __PYX_ERR(0, 1868, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1890
 * 
 *   #
 *   def  ReqQueryCFMMCTradingAccountToken(self, pQueryCFMMCTradingAccountToken, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__385 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pQueryCFMMCTradingAccountToken, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__385)) __PYX_ERR(0, 1890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__385);
  __Pyx_GIVEREF(__pyx_tuple__385);
  __pyx_codeobj__386 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__385, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQueryCFMMCTradingAccountToken, 1890, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__386)) __PYX_ERR(0, 1890, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1912
 * 
 *   #
 *   def  ReqFromBankToFutureByFuture(self, pReqTransfer, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__387 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pReqTransfer, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__387)) __PYX_ERR(0, 1912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__387);
  __Pyx_GIVEREF(__pyx_tuple__387);
  __pyx_codeobj__388 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__387, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqFromBankToFutureByFuture, 1912, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__388)) __PYX_ERR(0, 1912, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1935
 * 
 *   #
 *   def  ReqFromFutureToBankByFuture(self, pReqTransfer, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__389 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pReqTransfer, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__389)) __PYX_ERR(0, 1935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__389);
  __Pyx_GIVEREF(__pyx_tuple__389);
  __pyx_codeobj__390 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__389, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqFromFutureToBankByFuture, 1935, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__390)) __PYX_ERR(0, 1935, __pyx_L1_error)

  /* "ptp/TraderApi.pyx":1958
 * 
 *   #
 *   def  ReqQueryBankAccountMoneyByFuture(self, pReqQueryAccount, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_tuple__391 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_pReqQueryAccount, __pyx_n_s_nRequestID, __pyx_n_s_result, __pyx_n_s_address, __pyx_n_s_dwTime, __pyx_n_s_funName, __pyx_n_s_err); if (unlikely(!__pyx_tuple__391)) __PYX_ERR(0, 1958, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__391);
  __Pyx_GIVEREF(__pyx_tuple__391);
  __pyx_codeobj__392 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__391, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ptp_TraderApi_pyx, __pyx_n_s_ReqQueryBankAccountMoneyByFuture, 1958, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__392)) __PYX_ERR(0, 1958, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_tuple__393 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__393)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__393);
  __Pyx_GIVEREF(__pyx_tuple__393);
  __pyx_codeobj__394 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__393, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__394)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__395 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__395)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__395);
  __Pyx_GIVEREF(__pyx_tuple__395);
  __pyx_codeobj__396 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__395, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__396)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initTraderApi(void); /*proto*/
PyMODINIT_FUNC initTraderApi(void)
#else
PyMODINIT_FUNC PyInit_TraderApi(void); /*proto*/
PyMODINIT_FUNC PyInit_TraderApi(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_TraderApi(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("TraderApi", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_ptp__TraderApi) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "ptp.TraderApi")) {
      if (unlikely(PyDict_SetItemString(modules, "ptp.TraderApi", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_3ptp_9TraderApi_TraderApiWrapper) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
  __pyx_type_3ptp_9TraderApi_TraderApiWrapper.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "TraderApiWrapper", (PyObject *)&__pyx_type_3ptp_9TraderApi_TraderApiWrapper) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ptp_9TraderApi_TraderApiWrapper) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
  __pyx_ptype_3ptp_9TraderApi_TraderApiWrapper = &__pyx_type_3ptp_9TraderApi_TraderApiWrapper;
  /*--- Type import code ---*/
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
  #if CYTHON_COMPILING_IN_PYPY
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error)
  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) __PYX_ERR(3, 8, __pyx_L1_error)
  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) __PYX_ERR(4, 15, __pyx_L1_error)
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "ptp/TraderApi.pyx":10
 * from libcpp        cimport bool as cbool
 * 
 * import ctypes             # <<<<<<<<<<<<<<
 * import configparser
 * import time
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_ctypes, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ctypes, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":11
 * 
 * import ctypes
 * import configparser             # <<<<<<<<<<<<<<
 * import time
 * import sys
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_configparser, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_configparser, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":12
 * import ctypes
 * import configparser
 * import time             # <<<<<<<<<<<<<<
 * import sys
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_1) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":13
 * import configparser
 * import time
 * import sys             # <<<<<<<<<<<<<<
 * 
 * from imp      import reload
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":15
 * import sys
 * 
 * from imp      import reload             # <<<<<<<<<<<<<<
 * from datetime import datetime
 * from ptp      import py_ApiStructure
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_reload);
  __Pyx_GIVEREF(__pyx_n_s_reload);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_reload);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_imp, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_reload); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reload, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ptp/TraderApi.pyx":16
 * 
 * from imp      import reload
 * from datetime import datetime             # <<<<<<<<<<<<<<
 * from ptp      import py_ApiStructure
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_datetime);
  __Pyx_GIVEREF(__pyx_n_s_datetime);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_datetime);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":17
 * from imp      import reload
 * from datetime import datetime
 * from ptp      import py_ApiStructure             # <<<<<<<<<<<<<<
 * 
 * from ptp                import CythonLib
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_py_ApiStructure);
  __Pyx_GIVEREF(__pyx_n_s_py_ApiStructure);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_py_ApiStructure);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_ptp, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_py_ApiStructure); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_py_ApiStructure, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ptp/TraderApi.pyx":19
 * from ptp      import py_ApiStructure
 * 
 * from ptp                import CythonLib             # <<<<<<<<<<<<<<
 * from ptp.CythonLib      import printString
 * from ptp.CythonLib      import printNumber
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_CythonLib);
  __Pyx_GIVEREF(__pyx_n_s_CythonLib);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_CythonLib);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_ptp, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_CythonLib); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CythonLib, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":20
 * 
 * from ptp                import CythonLib
 * from ptp.CythonLib      import printString             # <<<<<<<<<<<<<<
 * from ptp.CythonLib      import printNumber
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_printString);
  __Pyx_GIVEREF(__pyx_n_s_printString);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_printString);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_ptp_CythonLib, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_printString); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_printString, __pyx_t_1) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ptp/TraderApi.pyx":21
 * from ptp                import CythonLib
 * from ptp.CythonLib      import printString
 * from ptp.CythonLib      import printNumber             # <<<<<<<<<<<<<<
 * 
 * import cfg.ptp_env            as myEnv
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_printNumber);
  __Pyx_GIVEREF(__pyx_n_s_printNumber);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_printNumber);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_ptp_CythonLib, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_printNumber); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_printNumber, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":23
 * from ptp.CythonLib      import printNumber
 * 
 * import cfg.ptp_env            as myEnv             # <<<<<<<<<<<<<<
 * import cfg.ptp_can_change_env as myDEnv
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s__214);
  __Pyx_GIVEREF(__pyx_n_s__214);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s__214);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_cfg_ptp_env, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_myEnv, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ptp/TraderApi.pyx":24
 * 
 * import cfg.ptp_env            as myEnv
 * import cfg.ptp_can_change_env as myDEnv             # <<<<<<<<<<<<<<
 * 
 * from .cython2c.ThostFtdcUserApiStruct cimport *
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s__214);
  __Pyx_GIVEREF(__pyx_n_s__214);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s__214);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_cfg_ptp_can_change_env, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_myDEnv, __pyx_t_1) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":42
 *     printString("TraderApicall_stack","call-<",funName)
 * 
 *   def Inc_RequestID(self):             # <<<<<<<<<<<<<<
 *     self.RequestID = self.RequestID + 1
 *     return self.RequestID
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_3Inc_RequestID, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_Inc_RequestID, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__216)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_Inc_RequestID, __pyx_t_1) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":74
 * 
 *   @staticmethod
 *   def GetApiVersion():             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % ("Trader", "GetApiVersion")
 *     printString("TraderApicall_stack","call->",funName)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_7GetApiVersion, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_GetApiVersion, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__218)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_GetApiVersion, __pyx_t_1) < 0) __PYX_ERR(0, 74, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":73
 *   """
 * 
 *   @staticmethod             # <<<<<<<<<<<<<<
 *   def GetApiVersion():
 *     funName = "%s.%s" % ("Trader", "GetApiVersion")
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper, __pyx_n_s_GetApiVersion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_staticmethod, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_GetApiVersion, __pyx_t_1) < 0) __PYX_ERR(0, 74, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":80
 *     printString("TraderApicall_stack","call-<",funName)
 * 
 *   def Release(self):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_9Release, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_Release, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__220)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_Release, __pyx_t_1) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":94
 * 
 * 
 *   def Init_Base(self):             # <<<<<<<<<<<<<<
 *     bInit=-1
 *     try:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_11Init_Base, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_Init_Base, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__222)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_Init_Base, __pyx_t_1) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":112
 *     return bInit
 * 
 *   def Init_Net(self):             # <<<<<<<<<<<<<<
 *     try:
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_13Init_Net, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_Init_Net, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__224)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_Init_Net, __pyx_t_1) < 0) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":156
 *     return bInit
 * 
 *   def Join(self):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_15Join, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_Join, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__226)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_Join, __pyx_t_1) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":173
 * 
 * 
 *   def GetTradingDay(self):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_17GetTradingDay, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_GetTradingDay, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__228)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_GetTradingDay, __pyx_t_1) < 0) __PYX_ERR(0, 173, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":191
 * 
 * 
 *   def RegisterFront(self, char *pszFrontAddress):             # <<<<<<<<<<<<<<
 *       funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *       printString("TraderApicall_stack","call->",funName)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_19RegisterFront, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_RegisterFront, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__230)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_RegisterFront, __pyx_t_1) < 0) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":203
 *       printString("TraderApicall_stack","call-<",funName)
 * 
 *   def RegisterNameServer(self, char *pszNsAddress):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_21RegisterNameServer, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_RegisterNameSer, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__232)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_RegisterNameServer, __pyx_t_1) < 0) __PYX_ERR(0, 203, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":215
 *     printString("TraderApicall_stack","call-<",funName)
 * 
 *   def RegisterFensUserInfo(self, pFensUserInfo):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_23RegisterFensUserInfo, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_RegisterFensUse, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__234)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_RegisterFensUserInfo, __pyx_t_1) < 0) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":231
 *     printString("TraderApicall_stack","call-<",funName)
 * 
 *   def SubscribePrivateTopic(self, THOST_TE_RESUME_TYPE nResumeType):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_25SubscribePrivateTopic, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_SubscribePrivat, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__236)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_SubscribePrivateTopic, __pyx_t_1) < 0) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":249
 *   #        THOST_TERT_QUICK:
 *   #@remark Init
 *   def SubscribePublicTopic(self, THOST_TE_RESUME_TYPE nResumeType):             # <<<<<<<<<<<<<<
 *     funName = "%s.%s" % (self.__class__.__name__, sys._getframe().f_code.co_name)
 *     printString("TraderApicall_stack","call->",funName)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_27SubscribePublicTopic, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_SubscribePublic, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__238)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_SubscribePublicTopic, __pyx_t_1) < 0) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":261
 * 
 *   #
 *   def  ReqAuthenticate(self, pReqAuthenticateField, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_29ReqAuthenticate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqAuthenticate, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__240)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqAuthenticate, __pyx_t_1) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":284
 * 
 *   #
 *   def  ReqUserLogin(self, pReqUserLoginField, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_31ReqUserLogin, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqUserLogin, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__242)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqUserLogin, __pyx_t_1) < 0) __PYX_ERR(0, 284, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":307
 * 
 *   #
 *   def  ReqUserLogout(self, pUserLogout, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_33ReqUserLogout, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqUserLogout, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__244)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqUserLogout, __pyx_t_1) < 0) __PYX_ERR(0, 307, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":330
 * 
 *   #
 *   def  ReqUserPasswordUpdate(self, pUserPasswordUpdate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_35ReqUserPasswordUpdate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqUserPassword, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__246)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqUserPasswordUpdate, __pyx_t_1) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":353
 * 
 *   #
 *   def  ReqTradingAccountPasswordUpdate(self, pTradingAccountPasswordUpdate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_37ReqTradingAccountPasswordUpdate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqTradingAccou, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqTradingAccountPasswordUpdate, __pyx_t_1) < 0) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":376
 * 
 *   #2
 *   def  ReqUserLogin2(self, pReqUserLogin, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_39ReqUserLogin2, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqUserLogin2, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqUserLogin2, __pyx_t_1) < 0) __PYX_ERR(0, 376, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":399
 * 
 *   #2
 *   def  ReqUserPasswordUpdate2(self, pUserPasswordUpdate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_41ReqUserPasswordUpdate2, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqUserPassword_2, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__252)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqUserPasswordUpdate2, __pyx_t_1) < 0) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":422
 * 
 *   #
 *   def  ReqOrderInsert(self, pInputOrder, int nRequestID, express="ctp", md_lastPrice=0):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_43ReqOrderInsert, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqOrderInsert, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__254)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqOrderInsert, __pyx_t_1) < 0) __PYX_ERR(0, 422, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":445
 * 
 *   #
 *   def  ReqParkedOrderInsert(self, pParkedOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_45ReqParkedOrderInsert, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqParkedOrderI, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__256)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqParkedOrderInsert, __pyx_t_1) < 0) __PYX_ERR(0, 445, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":468
 * 
 *   #
 *   def  ReqParkedOrderAction(self, pParkedOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_47ReqParkedOrderAction, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqParkedOrderA, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__258)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqParkedOrderAction, __pyx_t_1) < 0) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":491
 * 
 *   #
 *   def  ReqOrderAction(self, pInputOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_49ReqOrderAction, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqOrderAction, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__260)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqOrderAction, __pyx_t_1) < 0) __PYX_ERR(0, 491, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":514
 * 
 *   #
 *   def  ReqQueryMaxOrderVolume(self, pQueryMaxOrderVolume, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_51ReqQueryMaxOrderVolume, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQueryMaxOrde, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__262)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQueryMaxOrderVolume, __pyx_t_1) < 0) __PYX_ERR(0, 514, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":536
 * 
 *   #
 *   def  ReqSettlementInfoConfirm(self, pSettlementInfoConfirm, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_53ReqSettlementInfoConfirm, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqSettlementIn, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__264)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqSettlementInfoConfirm, __pyx_t_1) < 0) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":559
 * 
 *   #
 *   def  ReqRemoveParkedOrder(self, pRemoveParkedOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_55ReqRemoveParkedOrder, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqRemoveParked, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__266)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqRemoveParkedOrder, __pyx_t_1) < 0) __PYX_ERR(0, 559, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":582
 * 
 *   #
 *   def  ReqRemoveParkedOrderAction(self, pRemoveParkedOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_57ReqRemoveParkedOrderAction, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqRemoveParked_2, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__268)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqRemoveParkedOrderAction, __pyx_t_1) < 0) __PYX_ERR(0, 582, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":605
 * 
 *   #
 *   def  ReqExecOrderInsert(self, pInputExecOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_59ReqExecOrderInsert, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqExecOrderIns, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__270)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqExecOrderInsert, __pyx_t_1) < 0) __PYX_ERR(0, 605, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":628
 * 
 *   #
 *   def  ReqExecOrderAction(self, pInputExecOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_61ReqExecOrderAction, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqExecOrderAct, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__272)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqExecOrderAction, __pyx_t_1) < 0) __PYX_ERR(0, 628, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":651
 * 
 *   #
 *   def  ReqForQuoteInsert(self, pInputForQuote, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_63ReqForQuoteInsert, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqForQuoteInse, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__274)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqForQuoteInsert, __pyx_t_1) < 0) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":674
 * 
 *   #
 *   def  ReqQuoteInsert(self, pInputQuote, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_65ReqQuoteInsert, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQuoteInsert, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__276)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQuoteInsert, __pyx_t_1) < 0) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":697
 * 
 *   #
 *   def  ReqQuoteAction(self, pInputQuoteAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_67ReqQuoteAction, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQuoteAction, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__278)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQuoteAction, __pyx_t_1) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":720
 * 
 *   #
 *   def  ReqBatchOrderAction(self, pInputBatchOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_69ReqBatchOrderAction, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqBatchOrderAc, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__280)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqBatchOrderAction, __pyx_t_1) < 0) __PYX_ERR(0, 720, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":743
 * 
 *   #
 *   def  ReqOptionSelfCloseInsert(self, pInputOptionSelfClose, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_71ReqOptionSelfCloseInsert, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqOptionSelfCl, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__282)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqOptionSelfCloseInsert, __pyx_t_1) < 0) __PYX_ERR(0, 743, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":766
 * 
 *   #
 *   def  ReqOptionSelfCloseAction(self, pInputOptionSelfCloseAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_73ReqOptionSelfCloseAction, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqOptionSelfCl_2, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__284)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqOptionSelfCloseAction, __pyx_t_1) < 0) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":789
 * 
 *   #
 *   def  ReqCombActionInsert(self, pInputCombAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_75ReqCombActionInsert, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqCombActionIn, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__286)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqCombActionInsert, __pyx_t_1) < 0) __PYX_ERR(0, 789, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":812
 * 
 *   #
 *   def  ReqQryOrder(self, pQryOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_77ReqQryOrder, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryOrder, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__288)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryOrder, __pyx_t_1) < 0) __PYX_ERR(0, 812, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":834
 * 
 *   #
 *   def  ReqQryTrade(self, pQryTrade, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_79ReqQryTrade, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryTrade, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__290)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryTrade, __pyx_t_1) < 0) __PYX_ERR(0, 834, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":856
 * 
 *   #
 *   def  ReqQryInvestorPosition(self, pQryInvestorPosition, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_81ReqQryInvestorPosition, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryInvestorP, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__292)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryInvestorPosition, __pyx_t_1) < 0) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":878
 * 
 *   #
 *   def  ReqQryTradingAccount(self, pQryTradingAccount, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_83ReqQryTradingAccount, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryTradingAc, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__294)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryTradingAccount, __pyx_t_1) < 0) __PYX_ERR(0, 878, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":900
 * 
 *   #
 *   def  ReqQryInvestor(self, pQryInvestor, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_85ReqQryInvestor, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryInvestor, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__296)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryInvestor, __pyx_t_1) < 0) __PYX_ERR(0, 900, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":922
 * 
 *   #
 *   def  ReqQryTradingCode(self, pQryTradingCode, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_87ReqQryTradingCode, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryTradingCo, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__298)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryTradingCode, __pyx_t_1) < 0) __PYX_ERR(0, 922, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":944
 * 
 *   #
 *   def  ReqQryInstrumentMarginRate(self, pQryInstrumentMarginRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_89ReqQryInstrumentMarginRate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryInstrumen, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__300)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryInstrumentMarginRate, __pyx_t_1) < 0) __PYX_ERR(0, 944, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":966
 * 
 *   #
 *   def  ReqQryInstrumentCommissionRate(self, pQryInstrumentCommissionRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_91ReqQryInstrumentCommissionRate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryInstrumen_2, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__302)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryInstrumentCommissionRate, __pyx_t_1) < 0) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":988
 * 
 *   #
 *   def  ReqQryExchange(self, pQryExchange, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_93ReqQryExchange, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryExchange, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__304)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryExchange, __pyx_t_1) < 0) __PYX_ERR(0, 988, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1010
 * 
 *   #
 *   def  ReqQryProduct(self, pQryProduct, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_95ReqQryProduct, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryProduct, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__306)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryProduct, __pyx_t_1) < 0) __PYX_ERR(0, 1010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1032
 * 
 *   #
 *   def  ReqQryInstrument(self, pQryInstrument, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_97ReqQryInstrument, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryInstrumen_3, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__308)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryInstrument, __pyx_t_1) < 0) __PYX_ERR(0, 1032, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1054
 * 
 *   #
 *   def  ReqQryDepthMarketData(self, pQryDepthMarketData, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_99ReqQryDepthMarketData, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryDepthMark, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__310)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryDepthMarketData, __pyx_t_1) < 0) __PYX_ERR(0, 1054, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1076
 * 
 *   #
 *   def  ReqQrySettlementInfo(self, pQrySettlementInfo, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_101ReqQrySettlementInfo, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQrySettlemen, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__312)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQrySettlementInfo, __pyx_t_1) < 0) __PYX_ERR(0, 1076, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1098
 * 
 *   #
 *   def  ReqQryTransferBank(self, pQryTransferBank, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_103ReqQryTransferBank, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryTransferB, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__314)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryTransferBank, __pyx_t_1) < 0) __PYX_ERR(0, 1098, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1120
 * 
 *   #
 *   def  ReqQryInvestorPositionDetail(self, pQryInvestorPositionDetail, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_105ReqQryInvestorPositionDetail, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryInvestorP_2, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__316)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryInvestorPositionDetail, __pyx_t_1) < 0) __PYX_ERR(0, 1120, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1142
 * 
 *   #
 *   def  ReqQryNotice(self, pQryNotice, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_107ReqQryNotice, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryNotice, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__318)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryNotice, __pyx_t_1) < 0) __PYX_ERR(0, 1142, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1164
 * 
 *   #
 *   def  ReqQrySettlementInfoConfirm(self, pQrySettlementInfoConfirm, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_109ReqQrySettlementInfoConfirm, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQrySettlemen_2, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__320)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQrySettlementInfoConfirm, __pyx_t_1) < 0) __PYX_ERR(0, 1164, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1186
 * 
 *   #
 *   def  ReqQryInvestorPositionCombineDetail(self, pQryInvestorPositionCombineDetail, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_111ReqQryInvestorPositionCombineDetail, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryInvestorP_3, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__322)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryInvestorPositionCombineDet, __pyx_t_1) < 0) __PYX_ERR(0, 1186, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1208
 * 
 *   #
 *   def  ReqQryCFMMCTradingAccountKey(self, pQryCFMMCTradingAccountKey, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_113ReqQryCFMMCTradingAccountKey, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryCFMMCTrad, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__324)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryCFMMCTradingAccountKey, __pyx_t_1) < 0) __PYX_ERR(0, 1208, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1230
 * 
 *   #
 *   def  ReqQryEWarrantOffset(self, pQryEWarrantOffset, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_115ReqQryEWarrantOffset, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryEWarrantO, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__326)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryEWarrantOffset, __pyx_t_1) < 0) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1252
 * 
 *   #/
 *   def  ReqQryInvestorProductGroupMargin(self, pQryInvestorProductGroupMargin, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_117ReqQryInvestorProductGroupMargin, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryInvestorP_4, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__328)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryInvestorProductGroupMargin, __pyx_t_1) < 0) __PYX_ERR(0, 1252, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1274
 * 
 *   #
 *   def  ReqQryExchangeMarginRate(self, pQryExchangeMarginRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_119ReqQryExchangeMarginRate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryExchangeM, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__330)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryExchangeMarginRate, __pyx_t_1) < 0) __PYX_ERR(0, 1274, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1296
 * 
 *   #
 *   def  ReqQryExchangeMarginRateAdjust(self, pQryExchangeMarginRateAdjust, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_121ReqQryExchangeMarginRateAdjust, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryExchangeM_2, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__332)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryExchangeMarginRateAdjust, __pyx_t_1) < 0) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1318
 * 
 *   #
 *   def  ReqQryExchangeRate(self, pQryExchangeRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_123ReqQryExchangeRate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryExchangeR, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__334)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryExchangeRate, __pyx_t_1) < 0) __PYX_ERR(0, 1318, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1340
 * 
 *   #
 *   def  ReqQrySecAgentACIDMap(self, pQrySecAgentACIDMap, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_125ReqQrySecAgentACIDMap, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQrySecAgentA, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__336)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQrySecAgentACIDMap, __pyx_t_1) < 0) __PYX_ERR(0, 1340, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1362
 * 
 *   #
 *   def  ReqQryProductExchRate(self, pQryProductExchRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_127ReqQryProductExchRate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryProductEx, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__338)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryProductExchRate, __pyx_t_1) < 0) __PYX_ERR(0, 1362, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1384
 * 
 *   #
 *   def  ReqQryProductGroup(self, pQryProductGroup, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_129ReqQryProductGroup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryProductGr, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__340)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryProductGroup, __pyx_t_1) < 0) __PYX_ERR(0, 1384, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1406
 * 
 *   #
 *   def  ReqQryMMInstrumentCommissionRate(self, pQryMMInstrumentCommissionRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_131ReqQryMMInstrumentCommissionRate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryMMInstrum, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__342)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryMMInstrumentCommissionRate, __pyx_t_1) < 0) __PYX_ERR(0, 1406, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1428
 * 
 *   #
 *   def  ReqQryMMOptionInstrCommRate(self, pQryMMOptionInstrCommRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_133ReqQryMMOptionInstrCommRate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryMMOptionI, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__344)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryMMOptionInstrCommRate, __pyx_t_1) < 0) __PYX_ERR(0, 1428, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1450
 * 
 *   #
 *   def  ReqQryInstrumentOrderCommRate(self, pQryInstrumentOrderCommRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_135ReqQryInstrumentOrderCommRate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryInstrumen_4, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__346)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryInstrumentOrderCommRate, __pyx_t_1) < 0) __PYX_ERR(0, 1450, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1472
 * 
 *   #
 *   def  ReqQrySecAgentTradingAccount(self, pQryTradingAccount, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_137ReqQrySecAgentTradingAccount, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQrySecAgentT, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__348)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQrySecAgentTradingAccount, __pyx_t_1) < 0) __PYX_ERR(0, 1472, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1494
 * 
 *   #
 *   def  ReqQrySecAgentCheckMode(self, pQrySecAgentCheckMode, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_139ReqQrySecAgentCheckMode, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQrySecAgentC, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__350)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQrySecAgentCheckMode, __pyx_t_1) < 0) __PYX_ERR(0, 1494, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1516
 * 
 *   #
 *   def  ReqQryOptionInstrTradeCost(self, pQryOptionInstrTradeCost, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_141ReqQryOptionInstrTradeCost, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryOptionIns, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__352)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryOptionInstrTradeCost, __pyx_t_1) < 0) __PYX_ERR(0, 1516, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1538
 * 
 *   #
 *   def  ReqQryOptionInstrCommRate(self, pQryOptionInstrCommRate, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_143ReqQryOptionInstrCommRate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryOptionIns_2, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__354)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryOptionInstrCommRate, __pyx_t_1) < 0) __PYX_ERR(0, 1538, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1560
 * 
 *   #
 *   def  ReqQryExecOrder(self, pQryExecOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_145ReqQryExecOrder, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryExecOrder, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__356)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryExecOrder, __pyx_t_1) < 0) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1582
 * 
 *   #
 *   def  ReqQryForQuote(self, pQryForQuote, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_147ReqQryForQuote, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryForQuote, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__358)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryForQuote, __pyx_t_1) < 0) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1604
 * 
 *   #
 *   def  ReqQryQuote(self, pQryQuote, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_149ReqQryQuote, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryQuote, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__360)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryQuote, __pyx_t_1) < 0) __PYX_ERR(0, 1604, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1626
 * 
 *   #
 *   def  ReqQryOptionSelfClose(self, pQryOptionSelfClose, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_151ReqQryOptionSelfClose, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryOptionSel, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__362)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryOptionSelfClose, __pyx_t_1) < 0) __PYX_ERR(0, 1626, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1648
 * 
 *   #
 *   def  ReqQryInvestUnit(self, pQryInvestUnit, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_153ReqQryInvestUnit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryInvestUni, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__364)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryInvestUnit, __pyx_t_1) < 0) __PYX_ERR(0, 1648, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1670
 * 
 *   #
 *   def  ReqQryCombInstrumentGuard(self, pQryCombInstrumentGuard, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_155ReqQryCombInstrumentGuard, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryCombInstr, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__366)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryCombInstrumentGuard, __pyx_t_1) < 0) __PYX_ERR(0, 1670, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1692
 * 
 *   #
 *   def  ReqQryCombAction(self, pQryCombAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_157ReqQryCombAction, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryCombActio, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__368)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryCombAction, __pyx_t_1) < 0) __PYX_ERR(0, 1692, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1714
 * 
 *   #
 *   def  ReqQryTransferSerial(self, pQryTransferSerial, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_159ReqQryTransferSerial, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryTransferS, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__370)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryTransferSerial, __pyx_t_1) < 0) __PYX_ERR(0, 1714, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1736
 * 
 *   #
 *   def  ReqQryAccountregister(self, pQryAccountregister, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_161ReqQryAccountregister, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryAccountre, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__372)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryAccountregister, __pyx_t_1) < 0) __PYX_ERR(0, 1736, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1758
 * 
 *   #
 *   def  ReqQryContractBank(self, pQryContractBank, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_163ReqQryContractBank, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryContractB, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__374)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryContractBank, __pyx_t_1) < 0) __PYX_ERR(0, 1758, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1780
 * 
 *   #
 *   def  ReqQryParkedOrder(self, pQryParkedOrder, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_165ReqQryParkedOrder, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryParkedOrd, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__376)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryParkedOrder, __pyx_t_1) < 0) __PYX_ERR(0, 1780, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1802
 * 
 *   #
 *   def  ReqQryParkedOrderAction(self, pQryParkedOrderAction, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_167ReqQryParkedOrderAction, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryParkedOrd_2, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__378)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryParkedOrderAction, __pyx_t_1) < 0) __PYX_ERR(0, 1802, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1824
 * 
 *   #
 *   def  ReqQryTradingNotice(self, pQryTradingNotice, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_169ReqQryTradingNotice, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryTradingNo, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__380)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryTradingNotice, __pyx_t_1) < 0) __PYX_ERR(0, 1824, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1846
 * 
 *   #
 *   def  ReqQryBrokerTradingParams(self, pQryBrokerTradingParams, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_171ReqQryBrokerTradingParams, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryBrokerTra, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__382)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryBrokerTradingParams, __pyx_t_1) < 0) __PYX_ERR(0, 1846, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1868
 * 
 *   #
 *   def  ReqQryBrokerTradingAlgos(self, pQryBrokerTradingAlgos, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_173ReqQryBrokerTradingAlgos, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQryBrokerTra_2, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__384)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQryBrokerTradingAlgos, __pyx_t_1) < 0) __PYX_ERR(0, 1868, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1890
 * 
 *   #
 *   def  ReqQueryCFMMCTradingAccountToken(self, pQueryCFMMCTradingAccountToken, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_175ReqQueryCFMMCTradingAccountToken, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQueryCFMMCTr, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__386)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQueryCFMMCTradingAccountToken, __pyx_t_1) < 0) __PYX_ERR(0, 1890, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1912
 * 
 *   #
 *   def  ReqFromBankToFutureByFuture(self, pReqTransfer, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_177ReqFromBankToFutureByFuture, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqFromBankToFu, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__388)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqFromBankToFutureByFuture, __pyx_t_1) < 0) __PYX_ERR(0, 1912, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1935
 * 
 *   #
 *   def  ReqFromFutureToBankByFuture(self, pReqTransfer, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_179ReqFromFutureToBankByFuture, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqFromFutureTo, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__390)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqFromFutureToBankByFuture, __pyx_t_1) < 0) __PYX_ERR(0, 1935, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "ptp/TraderApi.pyx":1958
 * 
 *   #
 *   def  ReqQueryBankAccountMoneyByFuture(self, pReqQueryAccount, int nRequestID):             # <<<<<<<<<<<<<<
 * 
 *     cdef int result = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_181ReqQueryBankAccountMoneyByFuture, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper_ReqQueryBankAcc, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__392)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1958, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper->tp_dict, __pyx_n_s_ReqQueryBankAccountMoneyByFuture, __pyx_t_1) < 0) __PYX_ERR(0, 1958, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_3ptp_9TraderApi_TraderApiWrapper);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_183__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper___reduce_cython, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__394)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3ptp_9TraderApi_16TraderApiWrapper_185__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TraderApiWrapper___setstate_cyth, NULL, __pyx_n_s_ptp_TraderApi, __pyx_d, ((PyObject *)__pyx_codeobj__396)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ptp/TraderApi.pyx":1
 * # encoding:utf-8             # <<<<<<<<<<<<<<
 * # distutils: language=c++
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init ptp.TraderApi", 0, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init ptp.TraderApi");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* KeywordStringCheck */
static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* GetModuleGlobalName */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

/* PyFunctionFastCall */
  #if CYTHON_FAST_PYCALL
#include "frameobject.h"
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = PyThreadState_GET();
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = f->f_localsplus;
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

/* PyCFunctionFastCall */
  #if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
    }
}
#endif

/* PyObjectCall */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyIntBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* PyObjectCallMethO */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallOneArg */
  #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* PyObjectCallNoArg */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* PyErrFetchRestore */
    #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* WriteUnraisableException */
    static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#ifdef _MSC_VER
    else state = (PyGILState_STATE)-1;
#endif
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* SaveResetException */
    #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* PyErrExceptionMatches */
    #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    return PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetException */
    #if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
#endif
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* SwapException */
      #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* RaiseDoubleKeywords */
      static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
      static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* RaiseException */
      #if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
#if PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* SetupReduce */
        #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD;
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = PyObject_GetAttrString(meth, "__name__");
  if (name_attr) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (ret < 0) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject* builtin_object = NULL;
    static PyObject *object_reduce = NULL;
    static PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
    if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD;
    if (object_reduce_ex == NULL) {
        __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object");
        __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__");
        __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__");
    }
    __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__");
    if (reduce_ex == object_reduce_ex) {
        __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__");
        if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
            __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__");
            ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD;
            ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD;
            setstate = PyObject_GetAttrString(type_obj, "__setstate__");
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
            __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__");
                ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD;
                ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (ret < 0) goto BAD;
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto GOOD;
BAD:
    if (!PyErr_Occurred()) PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
    ret = -1;
GOOD:
    Py_XDECREF(builtin_object);
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* Import */
        static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_VERSION_HEX < 0x03030000
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* ImportFrom */
        static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* FetchCommonType */
        static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunction */
        static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
                if (unlikely(!arg0)) return NULL;
                result = (*meth)(self, arg0);
                Py_DECREF(arg0);
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (__pyx_CyFunctionType == NULL) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (!m->defaults)
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* GetNameInClass */
            static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    result = __Pyx_PyObject_GetAttrStr(nmspace, name);
    if (!result)
        result = __Pyx_GetModuleGlobalName(name);
    return result;
}

/* CLineInTraceback */
            static int __Pyx_CLineForTraceback(int c_line) {
#ifdef CYTHON_CLINE_IN_TRACEBACK
    return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0;
#else
    PyObject **cython_runtime_dict;
    PyObject *use_cline;
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (unlikely(!cython_runtime_dict)) {
      PyObject *ptype, *pvalue, *ptraceback;
      PyObject *use_cline_obj;
      PyErr_Fetch(&ptype, &pvalue, &ptraceback);
      use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        use_cline = NULL;
      }
      PyErr_Restore(ptype, pvalue, ptraceback);
    } else {
      use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback);
    }
    if (!use_cline) {
        c_line = 0;
        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (PyObject_Not(use_cline) != 0) {
        c_line = 0;
    }
    return c_line;
#endif
}

/* CodeObjectCache */
            static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
            #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* CIntFromPyVerify */
            #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntToPy */
            static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
            static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
            static CYTHON_INLINE enum THOST_TE_RESUME_TYPE __Pyx_PyInt_As_enum__THOST_TE_RESUME_TYPE(PyObject *x) {
    const enum THOST_TE_RESUME_TYPE neg_one = (enum THOST_TE_RESUME_TYPE) -1, const_zero = (enum THOST_TE_RESUME_TYPE) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(enum THOST_TE_RESUME_TYPE) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(enum THOST_TE_RESUME_TYPE, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (enum THOST_TE_RESUME_TYPE) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum THOST_TE_RESUME_TYPE) 0;
                case  1: __PYX_VERIFY_RETURN_INT(enum THOST_TE_RESUME_TYPE, digit, digits[0])
                case 2:
                    if (8 * sizeof(enum THOST_TE_RESUME_TYPE) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum THOST_TE_RESUME_TYPE, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum THOST_TE_RESUME_TYPE) >= 2 * PyLong_SHIFT) {
                            return (enum THOST_TE_RESUME_TYPE) (((((enum THOST_TE_RESUME_TYPE)digits[1]) << PyLong_SHIFT) | (enum THOST_TE_RESUME_TYPE)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum THOST_TE_RESUME_TYPE) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum THOST_TE_RESUME_TYPE, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum THOST_TE_RESUME_TYPE) >= 3 * PyLong_SHIFT) {
                            return (enum THOST_TE_RESUME_TYPE) (((((((enum THOST_TE_RESUME_TYPE)digits[2]) << PyLong_SHIFT) | (enum THOST_TE_RESUME_TYPE)digits[1]) << PyLong_SHIFT) | (enum THOST_TE_RESUME_TYPE)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum THOST_TE_RESUME_TYPE) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum THOST_TE_RESUME_TYPE, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum THOST_TE_RESUME_TYPE) >= 4 * PyLong_SHIFT) {
                            return (enum THOST_TE_RESUME_TYPE) (((((((((enum THOST_TE_RESUME_TYPE)digits[3]) << PyLong_SHIFT) | (enum THOST_TE_RESUME_TYPE)digits[2]) << PyLong_SHIFT) | (enum THOST_TE_RESUME_TYPE)digits[1]) << PyLong_SHIFT) | (enum THOST_TE_RESUME_TYPE)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (enum THOST_TE_RESUME_TYPE) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(enum THOST_TE_RESUME_TYPE) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum THOST_TE_RESUME_TYPE, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(enum THOST_TE_RESUME_TYPE) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum THOST_TE_RESUME_TYPE, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum THOST_TE_RESUME_TYPE) 0;
                case -1: __PYX_VERIFY_RETURN_INT(enum THOST_TE_RESUME_TYPE, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(enum THOST_TE_RESUME_TYPE,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(enum THOST_TE_RESUME_TYPE) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum THOST_TE_RESUME_TYPE, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum THOST_TE_RESUME_TYPE) - 1 > 2 * PyLong_SHIFT) {
                            return (enum THOST_TE_RESUME_TYPE) (((enum THOST_TE_RESUME_TYPE)-1)*(((((enum THOST_TE_RESUME_TYPE)digits[1]) << PyLong_SHIFT) | (enum THOST_TE_RESUME_TYPE)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(enum THOST_TE_RESUME_TYPE) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum THOST_TE_RESUME_TYPE, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum THOST_TE_RESUME_TYPE) - 1 > 2 * PyLong_SHIFT) {
                            return (enum THOST_TE_RESUME_TYPE) ((((((enum THOST_TE_RESUME_TYPE)digits[1]) << PyLong_SHIFT) | (enum THOST_TE_RESUME_TYPE)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(enum THOST_TE_RESUME_TYPE) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum THOST_TE_RESUME_TYPE, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum THOST_TE_RESUME_TYPE) - 1 > 3 * PyLong_SHIFT) {
                            return (enum THOST_TE_RESUME_TYPE) (((enum THOST_TE_RESUME_TYPE)-1)*(((((((enum THOST_TE_RESUME_TYPE)digits[2]) << PyLong_SHIFT) | (enum THOST_TE_RESUME_TYPE)digits[1]) << PyLong_SHIFT) | (enum THOST_TE_RESUME_TYPE)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum THOST_TE_RESUME_TYPE) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum THOST_TE_RESUME_TYPE, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum THOST_TE_RESUME_TYPE) - 1 > 3 * PyLong_SHIFT) {
                            return (enum THOST_TE_RESUME_TYPE) ((((((((enum THOST_TE_RESUME_TYPE)digits[2]) << PyLong_SHIFT) | (enum THOST_TE_RESUME_TYPE)digits[1]) << PyLong_SHIFT) | (enum THOST_TE_RESUME_TYPE)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(enum THOST_TE_RESUME_TYPE) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum THOST_TE_RESUME_TYPE, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum THOST_TE_RESUME_TYPE) - 1 > 4 * PyLong_SHIFT) {
                            return (enum THOST_TE_RESUME_TYPE) (((enum THOST_TE_RESUME_TYPE)-1)*(((((((((enum THOST_TE_RESUME_TYPE)digits[3]) << PyLong_SHIFT) | (enum THOST_TE_RESUME_TYPE)digits[2]) << PyLong_SHIFT) | (enum THOST_TE_RESUME_TYPE)digits[1]) << PyLong_SHIFT) | (enum THOST_TE_RESUME_TYPE)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum THOST_TE_RESUME_TYPE) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum THOST_TE_RESUME_TYPE, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum THOST_TE_RESUME_TYPE) - 1 > 4 * PyLong_SHIFT) {
                            return (enum THOST_TE_RESUME_TYPE) ((((((((((enum THOST_TE_RESUME_TYPE)digits[3]) << PyLong_SHIFT) | (enum THOST_TE_RESUME_TYPE)digits[2]) << PyLong_SHIFT) | (enum THOST_TE_RESUME_TYPE)digits[1]) << PyLong_SHIFT) | (enum THOST_TE_RESUME_TYPE)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(enum THOST_TE_RESUME_TYPE) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum THOST_TE_RESUME_TYPE, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(enum THOST_TE_RESUME_TYPE) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum THOST_TE_RESUME_TYPE, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            enum THOST_TE_RESUME_TYPE val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (enum THOST_TE_RESUME_TYPE) -1;
        }
    } else {
        enum THOST_TE_RESUME_TYPE val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (enum THOST_TE_RESUME_TYPE) -1;
        val = __Pyx_PyInt_As_enum__THOST_TE_RESUME_TYPE(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to enum THOST_TE_RESUME_TYPE");
    return (enum THOST_TE_RESUME_TYPE) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to enum THOST_TE_RESUME_TYPE");
    return (enum THOST_TE_RESUME_TYPE) -1;
}

/* CIntFromPy */
            static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntFromPy */
            static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
    const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(size_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (size_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
                            return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
                            return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
                            return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (size_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(size_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(size_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            size_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (size_t) -1;
        }
    } else {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyInt_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to size_t");
    return (size_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to size_t");
    return (size_t) -1;
}

/* CIntFromPy */
            static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CheckBinaryVersion */
            static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* ModuleImport */
            #ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

/* TypeImport */
            #ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (!strict && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
            module_name, class_name, basicsize, size);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    else if ((size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
            module_name, class_name, basicsize, size);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

/* InitStrings */
            static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            PyErr_Clear();
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
#if PY_VERSION_HEX < 0x03030000
        char* defenc_c;
        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
        if (!defenc) return NULL;
        defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        {
            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
            char* c;
            for (c = defenc_c; c < end; c++) {
                if ((unsigned char) (*c) >= 128) {
                    PyUnicode_AsASCIIString(o);
                    return NULL;
                }
            }
        }
#endif
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_LENGTH(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else
        return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
  #else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
  #endif
#else
  res = PyNumber_Int(x);
#endif
  if (res) {
#if PY_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(x);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
