From ca310f014336d93eba73ed5010c1c5645424a1e0 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 04 八月 2023 16:06:28 +0800
Subject: [PATCH] 交易优化

---
 test_l1.py                              |  143 +++++
 constant.py                             |    4 
 trade_client.py                         |   99 ++-
 l1_client.py                            |  218 ++++++++
 xmdapi.py                               |  924 ++++++++++++++++++++++++++++++++++++
 l2_client.py                            |   22 
 _xmdapi.cp37-win32.pyd                  |    0 
 command_manager.py                      |    6 
 tool.py                                 |   13 
 _xmdapi.cpython-37m-x86_64-linux-gnu.so |    0 
 test_profile.py                         |    5 
 l2_data_manager.py                      |   43 +
 client_network.py                       |   13 
 _xmdapi.cp37-win_amd64.pyd              |    0 
 14 files changed, 1,415 insertions(+), 75 deletions(-)

diff --git a/_xmdapi.cp37-win32.pyd b/_xmdapi.cp37-win32.pyd
new file mode 100644
index 0000000..5a5b480
--- /dev/null
+++ b/_xmdapi.cp37-win32.pyd
Binary files differ
diff --git a/_xmdapi.cp37-win_amd64.pyd b/_xmdapi.cp37-win_amd64.pyd
new file mode 100644
index 0000000..0bedebb
--- /dev/null
+++ b/_xmdapi.cp37-win_amd64.pyd
Binary files differ
diff --git a/_xmdapi.cpython-37m-x86_64-linux-gnu.so b/_xmdapi.cpython-37m-x86_64-linux-gnu.so
new file mode 100644
index 0000000..dade739
--- /dev/null
+++ b/_xmdapi.cpython-37m-x86_64-linux-gnu.so
Binary files differ
diff --git a/client_network.py b/client_network.py
index 234c8f3..a966f84 100644
--- a/client_network.py
+++ b/client_network.py
@@ -11,21 +11,22 @@
     @classmethod
     def get_send_response_sk(cls, type):
         if type not in cls.__send_response_sk_dict:
-            client = cls.create_send_response_sk(type)
+            client = cls.create_send_response_sk()
             cls.__send_response_sk_dict[type] = client
         return cls.__send_response_sk_dict[type]
 
     @classmethod
-    def del_send_response_sk(cls, type):
-        if type in cls.__send_response_sk_dict:
+    def del_send_response_sk(cls, type_):
+        if type_ in cls.__send_response_sk_dict:
+            sk = cls.__send_response_sk_dict[type_]
+            cls.__send_response_sk_dict.pop(type_)
             try:
-                cls.__send_response_sk_dict[type].close()
+                sk.close()
             except:
                 pass
-            cls.__send_response_sk_dict.pop(type)
 
     @classmethod
-    def create_send_response_sk(cls, type):
+    def create_send_response_sk(cls):
         addr, port = constant.SERVER_IP, constant.SERVER_PORT
         client = socket.socket()  # 鐢熸垚socket锛岃繛鎺erver
         client.connect((addr, port))
diff --git a/command_manager.py b/command_manager.py
index e67f0fa..20f8a7d 100644
--- a/command_manager.py
+++ b/command_manager.py
@@ -88,6 +88,7 @@
         # 鍙戦�佸績璺�
         cls.__heartbeats_thread(type, key, sk)
         cls.__listen_command_thread(type, key, sk)
+        print("create_and_run_client success",type,key)
         return key, sk
 
     @classmethod
@@ -162,6 +163,7 @@
                 if _type == CLIENT_TYPE_TRADE:
                     if client_id in cls.trade_client_dict:
                         cls.trade_client_dict.pop(client_id)
+                        print("pop trade client", client_id)
                 elif _type == CLIENT_TYPE_MONEY:
                     cls.money_client = None
                 elif _type == CLIENT_TYPE_DEAL_LIST:
@@ -185,7 +187,7 @@
                     json.dumps({"type": "heart", "client_id": client_id}).encode('utf-8')))
                 # print("蹇冭烦淇℃伅鍙戦�佹垚鍔�", client_id)
             except Exception as e:
-                print("蹇冭烦淇℃伅鍙戦�佸け璐�")
+                print("蹇冭烦淇℃伅鍙戦�佸け璐�",_type,client_id)
                 logging.exception(e)
                 if _type == CLIENT_TYPE_TRADE:
                     if client_id in cls.trade_client_dict:
@@ -223,7 +225,7 @@
         while True:
             try:
                 if len(cls.trade_client_dict) < cls.trade_client_count:
-                    print("__maintain_client", CLIENT_TYPE_TRADE)
+                    print("__maintain_client", CLIENT_TYPE_TRADE, cls.trade_client_count - len(cls.trade_client_dict))
                     for i in range(cls.trade_client_count - len(cls.trade_client_dict)):
                         result = cls.__create_and_run_client(CLIENT_TYPE_TRADE)
                         cls.trade_client_dict[result[0]] = result[1]
diff --git a/constant.py b/constant.py
index cf984b0..9397d83 100644
--- a/constant.py
+++ b/constant.py
@@ -1,4 +1,4 @@
 # addr, port = "111.230.16.67", 10008
-SERVER_IP = '111.230.16.67'
+SERVER_IP = '43.138.167.68'
 SERVER_PORT = 10008
-TEST = True
\ No newline at end of file
+TEST = True
diff --git a/l1_client.py b/l1_client.py
new file mode 100644
index 0000000..aa9c87a
--- /dev/null
+++ b/l1_client.py
@@ -0,0 +1,218 @@
+#!/usr/bin/python
+# -*- coding: UTF-8 -*-
+import json
+import logging
+import time
+
+import socket_util
+import tool
+import xmdapi
+from client_network import SendResponseSkManager
+
+level1_data_dict = {
+
+}
+
+
+def __send_response(sk, msg):
+    msg = socket_util.load_header(msg)
+    sk.sendall(msg)
+    result, header_str = socket_util.recv_data(sk)
+    if result:
+        result_json = json.loads(result)
+        if result_json.get("code") == 0:
+            return True
+    return False
+
+
+def get_level1_codes():
+    type_ = "get_level1_codes"
+    fdata = json.dumps(
+        {"type": type_, "data": {}})
+    msg = fdata.encode("utf-8")
+    # 鍙戦�佹秷鎭�
+    for i in range(3):
+        try:
+            sk = SendResponseSkManager.create_send_response_sk()
+            msg = socket_util.load_header(msg)
+            sk.sendall(msg)
+            result, header_str = socket_util.recv_data(sk)
+            # 璇诲彇浠g爜
+            result_json = json.loads(result)
+            if result_json["code"] == 0:
+                codes = result_json["data"]
+                codes_sh = []
+                codes_sz = []
+                for code in codes:
+                    if code.find("00") == 0:
+                        codes_sz.append(code.encode("utf-8"))
+                    else:
+                        codes_sh.append(code.encode("utf-8"))
+                return codes_sh, codes_sz
+        except ConnectionResetError:
+            SendResponseSkManager.del_send_response_sk(type_)
+        except BrokenPipeError:
+            SendResponseSkManager.del_send_response_sk(type_)
+    return None, None
+
+
+class MdSpi(xmdapi.CTORATstpXMdSpi):
+    def __init__(self, api):
+        self.codes_sh, self.codes_sz = get_level1_codes()
+        xmdapi.CTORATstpXMdSpi.__init__(self)
+        self.__api = api
+
+    def OnFrontConnected(self):
+        print("OnFrontConnected")
+
+        # 璇锋眰鐧诲綍锛岀洰鍓嶆湭鏍¢獙鐧诲綍鐢ㄦ埛锛岃姹傚煙缃┖鍗冲彲
+        login_req = xmdapi.CTORATstpReqUserLoginField()
+        self.__api.ReqUserLogin(login_req, 1)
+
+    def OnRspUserLogin(self, pRspUserLoginField, pRspInfoField, nRequestID):
+        if pRspInfoField.ErrorID == 0:
+            print('Login success! [%d]' % nRequestID)
+
+            '''
+            璁㈤槄琛屾儏
+            褰搒ub_arr涓彧鏈変竴涓�"00000000"鐨勫悎绾︿笖ExchangeID濉玊ORA_TSTP_EXD_SSE鎴朤ORA_TSTP_EXD_SZSE鏃讹紝璁㈤槄鍗曞競鍦烘墍鏈夊悎绾﹁鎯�
+			褰搒ub_arr涓彧鏈変竴涓�"00000000"鐨勫悎绾︿笖ExchangeID濉玊ORA_TSTP_EXD_COMM鏃讹紝璁㈤槄鍏ㄥ競鍦烘墍鏈夊悎绾﹁鎯�
+			鍏跺畠鎯呭喌锛岃闃卻ub_arr闆嗗悎涓殑鍚堢害琛屾儏
+            '''
+
+            print(f"璁㈤槄鏁伴噺锛歴h-{len(self.codes_sh)}  sz-{len(self.codes_sz)}")
+            if self.codes_sh:
+                ret = self.__api.SubscribeMarketData(self.codes_sh, xmdapi.TORA_TSTP_EXD_SSE)
+                if ret != 0:
+                    print('SubscribeMarketData fail, ret[%d]' % ret)
+                else:
+                    print('SubscribeMarketData success, ret[%d]' % ret)
+
+            if self.codes_sz:
+                ret = self.__api.SubscribeMarketData(self.codes_sz, xmdapi.TORA_TSTP_EXD_SZSE)
+                if ret != 0:
+                    print('SubscribeMarketData fail, ret[%d]' % ret)
+                else:
+                    print('SubscribeMarketData success, ret[%d]' % ret)
+
+            # sub_arr = [b'600004']
+            # ret = self.__api.UnSubscribeMarketData(sub_arr, xmdapi.TORA_TSTP_EXD_SSE)
+            # if ret != 0:
+            #     print('UnSubscribeMarketData fail, ret[%d]' % ret)
+            # else:
+            #     print('SubscribeMarketData success, ret[%d]' % ret)
+
+
+        else:
+            print('Login fail!!! [%d] [%d] [%s]'
+                  % (nRequestID, pRspInfoField.ErrorID, pRspInfoField.ErrorMsg))
+
+    def OnRspSubMarketData(self, pSpecificSecurityField, pRspInfoField):
+        if pRspInfoField.ErrorID == 0:
+            print('OnRspSubMarketData: OK!')
+        else:
+            print('OnRspSubMarketData: Error! [%d] [%s]'
+                  % (pRspInfoField.ErrorID, pRspInfoField.ErrorMsg))
+
+    def OnRspUnSubMarketData(self, pSpecificSecurityField, pRspInfoField):
+        if pRspInfoField.ErrorID == 0:
+            print('OnRspUnSubMarketData: OK!')
+        else:
+            print('OnRspUnSubMarketData: Error! [%d] [%s]'
+                  % (pRspInfoField.ErrorID, pRspInfoField.ErrorMsg))
+
+    def OnRtnMarketData(self, pMarketDataField):
+        if pMarketDataField.SecurityName.find("S") == 0:
+            return
+        if pMarketDataField.SecurityName.find("ST") >= 0:
+            return
+        close_price = round(pMarketDataField.UpperLimitPrice / 1.1, 2)
+        rate = round((pMarketDataField.LastPrice - close_price) * 100 / close_price, 2)
+        # print(pMarketDataField.SecurityID, pMarketDataField.SecurityName, rate, pMarketDataField.Volume)
+
+        level1_data_dict[pMarketDataField.SecurityID] = (
+            pMarketDataField.SecurityID, pMarketDataField.LastPrice, rate, pMarketDataField.Volume, time.time())
+        # print(
+        #     "SecurityID[%s] SecurityName[%s] LastPrice[%.2f] Volume[%d] Turnover[%.2f] BidPrice1[%.2f] BidVolume1[%d] AskPrice1[%.2f] AskVolume1[%d] UpperLimitPrice[%.2f] LowerLimitPrice[%.2f]"
+        #     % (pMarketDataField.SecurityID, pMarketDataField.SecurityName, pMarketDataField.LastPrice,
+        #        pMarketDataField.Volume,
+        #        pMarketDataField.Turnover, pMarketDataField.BidPrice1, pMarketDataField.BidVolume1,
+        #        pMarketDataField.AskPrice1,
+        #        pMarketDataField.AskVolume1, pMarketDataField.UpperLimitPrice, pMarketDataField.LowerLimitPrice))
+
+
+def __upload_codes_info(datas):
+    if not tool.is_trade_time():
+        return
+    # 涓婁紶鏁版嵁
+    type_ = "set_target_codes"
+    fdata = json.dumps(
+        {"type": type_, "data": {"data": datas}})
+    msg = fdata.encode("utf-8")
+
+    # 鍙戦�佹秷鎭�
+    for i in range(3):
+        try:
+            sk = SendResponseSkManager.get_send_response_sk(type_)
+            if __send_response(sk, msg):
+                break
+        except ConnectionResetError:
+            SendResponseSkManager.del_send_response_sk(type_)
+
+        except BrokenPipeError:
+            SendResponseSkManager.del_send_response_sk(type_)
+
+
+def run():
+    # 鎵撳嵃鎺ュ彛鐗堟湰鍙�
+    print(xmdapi.CTORATstpXMdApi_GetApiVersion())
+
+    # 鍒涘缓鎺ュ彛瀵硅薄
+    api = xmdapi.CTORATstpXMdApi_CreateTstpXMdApi(xmdapi.TORA_TSTP_MST_MCAST)
+
+    # 鍒涘缓鍥炶皟瀵硅薄
+    spi = MdSpi(api)
+
+    # 娉ㄥ唽鍥炶皟鎺ュ彛
+    api.RegisterSpi(spi)
+
+    # 娉ㄥ唽鍗曚釜琛屾儏鍓嶇疆鏈嶅姟鍦板潃
+    # api.RegisterFront("tcp://224.224.1.19:7880")
+    # 娉ㄥ唽澶氫釜琛屾儏鍓嶇疆鏈嶅姟鍦板潃锛岀敤閫楀彿闅斿紑
+    # api.RegisterFront("tcp://10.0.1.101:6402,tcp://10.0.1.101:16402")
+    # 娉ㄥ唽鍚嶅瓧鏈嶅姟鍣ㄥ湴鍧�锛屾敮鎸佸鏈嶅姟鍦板潃閫楀彿闅斿紑
+    # api.RegisterNameServer('tcp://224.224.3.19:7888')
+    # api.RegisterNameServer('tcp://10.0.1.101:52370,tcp://10.0.1.101:62370')
+    api.RegisterMulticast("udp://224.224.1.19:7880", None, "")
+
+    # 鍚姩鎺ュ彛
+    api.Init()
+
+    # 绛夊緟绋嬪簭缁撴潫
+    while True:
+        print("鏁伴噺", len(level1_data_dict))
+        try:
+            if len(level1_data_dict) < 1:
+                continue
+            # 鏍规嵁娑ㄥ箙鎺掑簭
+            list_ = [level1_data_dict[k] for k in level1_data_dict]
+            flist = []
+            for d in list_:
+                if d[2] >= 5:
+                    # 娑ㄥ箙灏忎簬5%鐨勯渶瑕佸垹闄�
+                    flist.append(d)
+            flist.sort(key=lambda x: x[2], reverse=True)
+            datas = flist[:100]
+            codes = [x[0] for x in datas]
+            print("浠g爜鏁伴噺:", len(datas),codes)
+            __upload_codes_info(datas)
+        except Exception as e:
+            logging.exception(e)
+        finally:
+            time.sleep(3)
+    # 閲婃斁鎺ュ彛瀵硅薄
+    api.Release()
+
+
+if __name__ == "__main__":
+    run()
diff --git a/l2_client.py b/l2_client.py
index 30239db..65c6c2f 100644
--- a/l2_client.py
+++ b/l2_client.py
@@ -167,7 +167,7 @@
         print("OnRspSubTransaction")
 
     def OnRspSubOrderDetail(self, pSpecificSecurity, pRspInfo, nRequestID, bIsLast):
-        print("OnRspSubOrderDetail")
+        print("OnRspSubOrderDetail", pRspInfo)
         # try:
         print("璁㈤槄缁撴灉锛�", pSpecificSecurity["ExchangeID"], pSpecificSecurity["SecurityID"], pRspInfo["ErrorID"],
               pRspInfo["ErrorMsg"])
@@ -177,21 +177,17 @@
             print("璁㈤槄鎴愬姛")
             self.subscripted_codes.add(pSpecificSecurity['SecurityID'])
         if bIsLast == 1:
-            t1 = threading.Thread(target=lambda: l2_data_manager.add_subscript_codes(self.subscripted_codes),
-                                  daemon=True)
-            # 鍚庡彴杩愯
-            t1.start()
+            print("璁㈤槄鍝嶅簲缁撴潫", self.subscripted_codes)
+            l2_data_manager.add_subscript_codes(self.subscripted_codes)
 
     def OnRspUnSubOrderDetail(self, pSpecificSecurity, pRspInfo, nRequestID, bIsLast):
-        print("OnRspUnSubOrderDetail")
+        print("OnRspUnSubOrderDetail", bIsLast)
         try:
             code = pSpecificSecurity['SecurityID']
             self.subscripted_codes.discard(code)
             if bIsLast == 1:
-                t1 = threading.Thread(target=lambda: l2_data_manager.add_subscript_codes(self.subscripted_codes),
-                                      daemon=True)
-                # 鍚庡彴杩愯
-                t1.start()
+                print("鍙栨秷璁㈤槄鍝嶅簲缁撴潫", self.subscripted_codes)
+                l2_data_manager.add_subscript_codes(self.subscripted_codes)
         except Exception as e:
             logging.exception(e)
 
@@ -234,8 +230,7 @@
              ]}
         market_code_dict[pDepthMarketData['SecurityID']] = time.time()
 
-        t1 = threading.Thread(target=lambda: l2_data_manager.add_market_data(d), daemon=True)
-        t1.start()
+        l2_data_manager.add_market_data(d)
 
         # 杈撳嚭琛屾儏蹇収鏁版嵁
         # print(
@@ -308,7 +303,7 @@
                         "SubSeq": pTransaction['SubSeq'], "BuyNo": pTransaction['BuyNo'],
                         "SellNo": pTransaction['SellNo'],
                         "ExecType": pTransaction['ExecType'].decode()}
-                print("閫愮瑪鎴愪氦", item)
+                # print("閫愮瑪鎴愪氦", item)
                 l2_data_manager.add_transaction_detail(item)
 
         logger_l2_transaction.info(
@@ -541,6 +536,7 @@
         # 鍚庡彴杩愯
         t1.setDaemon(True)
         t1.start()
+    l2_data_manager.run_upload_common()
     global l2CommandManager
     l2CommandManager = command_manager.L2CommandManager()
     l2CommandManager.init(constant.SERVER_IP, constant.SERVER_PORT, MyL2ActionCallback())
diff --git a/l2_data_manager.py b/l2_data_manager.py
index 512803d..89d2e49 100644
--- a/l2_data_manager.py
+++ b/l2_data_manager.py
@@ -4,6 +4,7 @@
 import random
 import threading
 import time
+import socket_util
 
 from client_network import SendResponseSkManager
 from mylog import logger_l2_error, logger_l2_upload
@@ -15,6 +16,7 @@
 tmep_order_detail_queue_dict = {}
 tmep_transaction_queue_dict = {}
 target_codes = set()
+common_queue = queue.Queue()
 
 
 # 娣诲姞濮旀墭璇︽儏
@@ -59,24 +61,24 @@
 
 def add_market_data(data):
     code = data['securityID']
-    upload_data(code, "l2_market_data", data)
+    # 鍔犲叆涓婁紶闃熷垪
+    common_queue.put((code, "l2_market_data", data))
 
 
 def add_subscript_codes(codes):
-    upload_data('', "l2_subscript_codes", list(codes))
+    print("add_subscript_codes", codes)
+    # 鍔犲叆涓婁紶闃熷垪
+    common_queue.put(('', "l2_subscript_codes", list(codes)))
 
 
 def __send_response(sk, msg):
-    msg = SendResponseSkManager.format_response(msg)
+    msg = socket_util.load_header(msg)
     sk.sendall(msg)
-    while True:
-        result = sk.recv(1024)
-        if result:
-            result = result.decode("utf-8")
-            result_json = json.loads(result)
-            if result_json.get("code") == 0:
-                return True
-            break
+    result, header_str = socket_util.recv_data(sk)
+    if result:
+        result_json = json.loads(result)
+        if result_json.get("code") == 0:
+            return True
     return False
 
 
@@ -110,6 +112,7 @@
     # print("璇锋眰寮�濮�", uid, len(datas), len(fdata), f"{fdata[:20]}...{fdata[-20:]}")
     result = None
     start_time = time.time()
+    logger_l2_upload.info(f"{code} 涓婁紶鏁版嵁寮�濮�-{_type}")
     try:
         result = send_response(key, fdata.encode('utf-8'))
     except Exception as e:
@@ -164,6 +167,19 @@
             logger_l2_error.error(f"涓婁紶鎴愪氦鏁版嵁鍑洪敊锛歿str(e)}")
 
 
+def __run_upload_common():
+    print("__run_upload_common")
+    while True:
+        try:
+            while not common_queue.empty():
+                temp = common_queue.get()
+                upload_data(temp[0], temp[1], temp[2])
+            time.sleep(0.01)
+        except Exception as e:
+            logger_l2_error.exception(e)
+            logger_l2_error.error(f"涓婁紶鏅�氭暟鎹嚭閿欙細{str(e)}")
+
+
 # 杩愯涓婁紶浠诲姟
 def run_upload_task(code):
     # 濡傛灉浠g爜娌℃湁鍦ㄧ洰鏍囦唬鐮佷腑灏变笉闇�瑕佽繍琛�
@@ -179,6 +195,11 @@
         t.start()
 
 
+def run_upload_common():
+    t = threading.Thread(target=lambda: __run_upload_common(), daemon=True)
+    t.start()
+
+
 if __name__ == "__main__":
     code = "603809"
     target_codes.add(code)
diff --git a/test_l1.py b/test_l1.py
new file mode 100644
index 0000000..adc8663
--- /dev/null
+++ b/test_l1.py
@@ -0,0 +1,143 @@
+#!/usr/bin/python
+# -*- coding: UTF-8 -*-
+import time
+
+import xmdapi
+
+level1_data_dict = {
+
+}
+
+
+def get_sh_codes():
+    with open("res/codes_sh.txt", encoding="utf-8") as f:
+        lines = f.readlines()
+        codes = []
+        for line in lines:
+            if line and len(line) >= 6:
+                codes.append(line[2:].strip().encode("utf-8"))
+        return codes
+
+
+def get_sz_codes():
+    with open("res/codes_sz.txt", encoding="utf-8") as f:
+        lines = f.readlines()
+        codes = []
+        for line in lines:
+            if line and len(line) >= 6:
+                codes.append(line[2:].strip().encode("utf-8"))
+        return codes
+
+
+class MdSpi(xmdapi.CTORATstpXMdSpi):
+    def __init__(self, api):
+        xmdapi.CTORATstpXMdSpi.__init__(self)
+        self.__api = api
+
+    def OnFrontConnected(self):
+        print("OnFrontConnected")
+
+        # 璇锋眰鐧诲綍锛岀洰鍓嶆湭鏍¢獙鐧诲綍鐢ㄦ埛锛岃姹傚煙缃┖鍗冲彲
+        login_req = xmdapi.CTORATstpReqUserLoginField()
+        self.__api.ReqUserLogin(login_req, 1)
+
+    def OnRspUserLogin(self, pRspUserLoginField, pRspInfoField, nRequestID):
+        if pRspInfoField.ErrorID == 0:
+            print('Login success! [%d]' % nRequestID)
+
+            '''
+            璁㈤槄琛屾儏
+            褰搒ub_arr涓彧鏈変竴涓�"00000000"鐨勫悎绾︿笖ExchangeID濉玊ORA_TSTP_EXD_SSE鎴朤ORA_TSTP_EXD_SZSE鏃讹紝璁㈤槄鍗曞競鍦烘墍鏈夊悎绾﹁鎯�
+			褰搒ub_arr涓彧鏈変竴涓�"00000000"鐨勫悎绾︿笖ExchangeID濉玊ORA_TSTP_EXD_COMM鏃讹紝璁㈤槄鍏ㄥ競鍦烘墍鏈夊悎绾﹁鎯�
+			鍏跺畠鎯呭喌锛岃闃卻ub_arr闆嗗悎涓殑鍚堢害琛屾儏
+            '''
+            sub_arr = get_sh_codes()
+            ret = self.__api.SubscribeMarketData(sub_arr, xmdapi.TORA_TSTP_EXD_SSE)
+            if ret != 0:
+                print('SubscribeMarketData fail, ret[%d]' % ret)
+            else:
+                print('SubscribeMarketData success, ret[%d]' % ret)
+
+            sub_arr = get_sz_codes()
+            ret = self.__api.SubscribeMarketData(sub_arr, xmdapi.TORA_TSTP_EXD_SZSE)
+            if ret != 0:
+                print('SubscribeMarketData fail, ret[%d]' % ret)
+            else:
+                print('SubscribeMarketData success, ret[%d]' % ret)
+
+            # sub_arr = [b'600004']
+            # ret = self.__api.UnSubscribeMarketData(sub_arr, xmdapi.TORA_TSTP_EXD_SSE)
+            # if ret != 0:
+            #     print('UnSubscribeMarketData fail, ret[%d]' % ret)
+            # else:
+            #     print('SubscribeMarketData success, ret[%d]' % ret)
+
+
+        else:
+            print('Login fail!!! [%d] [%d] [%s]'
+                  % (nRequestID, pRspInfoField.ErrorID, pRspInfoField.ErrorMsg))
+
+    def OnRspSubMarketData(self, pSpecificSecurityField, pRspInfoField):
+        if pRspInfoField.ErrorID == 0:
+            print('OnRspSubMarketData: OK!')
+        else:
+            print('OnRspSubMarketData: Error! [%d] [%s]'
+                  % (pRspInfoField.ErrorID, pRspInfoField.ErrorMsg))
+
+    def OnRspUnSubMarketData(self, pSpecificSecurityField, pRspInfoField):
+        if pRspInfoField.ErrorID == 0:
+            print('OnRspUnSubMarketData: OK!')
+        else:
+            print('OnRspUnSubMarketData: Error! [%d] [%s]'
+                  % (pRspInfoField.ErrorID, pRspInfoField.ErrorMsg))
+
+    def OnRtnMarketData(self, pMarketDataField):
+        close_price = round(pMarketDataField.UpperLimitPrice / 1.1, 2)
+        rate = round((pMarketDataField.LastPrice - close_price) * 100 / close_price, 2)
+        # print(pMarketDataField.SecurityID, pMarketDataField.SecurityName, rate, pMarketDataField.Volume)
+        level1_data_dict[pMarketDataField.SecurityID] = (
+        pMarketDataField.SecurityID, rate, pMarketDataField.Volume, time.time())
+        # print(
+        #     "SecurityID[%s] SecurityName[%s] LastPrice[%.2f] Volume[%d] Turnover[%.2f] BidPrice1[%.2f] BidVolume1[%d] AskPrice1[%.2f] AskVolume1[%d] UpperLimitPrice[%.2f] LowerLimitPrice[%.2f]"
+        #     % (pMarketDataField.SecurityID, pMarketDataField.SecurityName, pMarketDataField.LastPrice,
+        #        pMarketDataField.Volume,
+        #        pMarketDataField.Turnover, pMarketDataField.BidPrice1, pMarketDataField.BidVolume1,
+        #        pMarketDataField.AskPrice1,
+        #        pMarketDataField.AskVolume1, pMarketDataField.UpperLimitPrice, pMarketDataField.LowerLimitPrice))
+
+
+if __name__ == "__main__":
+
+    print(get_sh_codes())
+    print(get_sz_codes())
+
+    # 鎵撳嵃鎺ュ彛鐗堟湰鍙�
+    print(xmdapi.CTORATstpXMdApi_GetApiVersion())
+
+    # 鍒涘缓鎺ュ彛瀵硅薄
+    api = xmdapi.CTORATstpXMdApi_CreateTstpXMdApi(xmdapi.TORA_TSTP_MST_MCAST)
+
+    # 鍒涘缓鍥炶皟瀵硅薄
+    spi = MdSpi(api)
+
+    # 娉ㄥ唽鍥炶皟鎺ュ彛
+    api.RegisterSpi(spi)
+
+    # 娉ㄥ唽鍗曚釜琛屾儏鍓嶇疆鏈嶅姟鍦板潃
+    # api.RegisterFront("tcp://224.224.1.19:7880")
+    # 娉ㄥ唽澶氫釜琛屾儏鍓嶇疆鏈嶅姟鍦板潃锛岀敤閫楀彿闅斿紑
+    # api.RegisterFront("tcp://10.0.1.101:6402,tcp://10.0.1.101:16402")
+    # 娉ㄥ唽鍚嶅瓧鏈嶅姟鍣ㄥ湴鍧�锛屾敮鎸佸鏈嶅姟鍦板潃閫楀彿闅斿紑
+    # api.RegisterNameServer('tcp://224.224.3.19:7888')
+    # api.RegisterNameServer('tcp://10.0.1.101:52370,tcp://10.0.1.101:62370')
+    api.RegisterMulticast("udp://224.224.1.19:7880", None, "")
+
+    # 鍚姩鎺ュ彛
+    api.Init()
+
+    # 绛夊緟绋嬪簭缁撴潫
+    while True:
+        print("鏁伴噺", len(level1_data_dict))
+        time.sleep(3)
+    # 閲婃斁鎺ュ彛瀵硅薄
+    api.Release()
diff --git a/test_profile.py b/test_profile.py
new file mode 100644
index 0000000..cc357a2
--- /dev/null
+++ b/test_profile.py
@@ -0,0 +1,5 @@
+import pstats
+
+if __name__ == "__main__":
+    p = pstats.Stats('D:\\鏂囦欢浼犺緭\\鏂板缓鏂囦欢澶筡\000609_1690507874113.log')
+    p.print_stats()
diff --git a/tool.py b/tool.py
new file mode 100644
index 0000000..56b182e
--- /dev/null
+++ b/tool.py
@@ -0,0 +1,13 @@
+import time
+
+
+def is_trade_time():
+    relative_timestamp = time.time() % (24 * 60 * 60) + 8 * 60 * 60
+    start1 = 60 * 60 * 9 + 24 * 60
+    end1 = 60 * 60 * 11 + 31 * 60
+    start2 = 60 * 60 * 12 + 58 * 60
+    end2 = 60 * 60 * 15 + 1 * 60
+    if start1 < relative_timestamp < end1 or start2 < relative_timestamp < end2:
+        return True
+    else:
+        return False
\ No newline at end of file
diff --git a/trade_client.py b/trade_client.py
index 4ed8a27..3aa188e 100644
--- a/trade_client.py
+++ b/trade_client.py
@@ -548,7 +548,7 @@
                         % (nRequestID, pRspInfoField.ErrorID, pRspInfoField.ErrorMsg))
 
     def OnRtnOrder(self, pOrderField: "CTORATstpOrderField") -> "void":
-        logger.info(
+        logger_trade_debug.info(
             '[%d] OnRtnOrder: SInfo[%s] InvestorID[%s] SecurityID[%s] OrderRef[%d] OrderLocalID[%s] LimitPrice[%.2f] VolumeTotalOriginal[%d] OrderSysID[%s] OrderStatus[%s]'
             % (round(time.time() * 1000), pOrderField.SInfo, pOrderField.InvestorID, pOrderField.SecurityID,
                pOrderField.OrderRef, pOrderField.OrderLocalID,
@@ -563,7 +563,7 @@
                                                  "accountID": pOrderField.AccountID})
 
     def OnRtnTrade(self, pTradeField: "CTORATstpTradeField") -> "void":
-        logger.info(
+        logger_trade_debug.info(
             'OnRtnTrade: TradeID[%s] InvestorID[%s] SecurityID[%s] OrderRef[%d] OrderLocalID[%s] Price[%.2f] Volume[%d]'
             % (pTradeField.TradeID, pTradeField.InvestorID, pTradeField.SecurityID,
                pTradeField.OrderRef, pTradeField.OrderLocalID, pTradeField.Price, pTradeField.Volume))
@@ -724,7 +724,7 @@
 
     def OnTrade(self, client_id, request_id, type_, data):
         if type_ == 1:
-            logger_trade_debug.info(f"璇锋眰涓嬪崟锛歝lient_id-{client_id} request_id-{request_id} data-{data}")
+            logger_trade_debug.info(f"---------------------\n璇锋眰涓嬪崟锛歝lient_id-{client_id} request_id-{request_id}")
             # 涓嬪崟
             # 1-涔� 2-鍗�
             direction = data["direction"]
@@ -738,8 +738,8 @@
                     req_rid_dict[sinfo] = (client_id, request_id)
                     self.__tradeSimpleApi.buy(code, volume, price, sinfo)
                 except Exception as e:
-                    SendResponseSkManager.get_send_response_sk(TYPE_ORDER).sendall(
-                        json.dumps({"code": 1, "msg": str(e)}).encode("utf-8"))
+                    send_response(json.dumps({"code": 1, "msg": str(e)}).encode("utf-8"), TYPE_ORDER, client_id,
+                                  request_id)
 
             elif direction == 2:
                 try:
@@ -749,11 +749,12 @@
                     print("sell", req_rid_dict)
                 except Exception as e:
                     logging.exception(e)
-                    SendResponseSkManager.get_send_response_sk(TYPE_ORDER).sendall(
-                        json.dumps({"code": 1, "msg": str(e)}).encode("utf-8"))
+                    send_response(json.dumps({"code": 1, "msg": str(e)}).encode("utf-8"), TYPE_ORDER, client_id,
+                                  request_id)
 
         elif type_ == 2:
-            logger_trade_debug.info(f"璇锋眰鎾ゅ崟锛歝lient_id-{client_id} request_id-{request_id} data-{data}")
+            logger_trade_debug.info(
+                f"---------------------\n璇锋眰鎾ゅ崟锛歝lient_id-{client_id} request_id-{request_id} data-{data}")
             # 鎾ゅ崟
             direction = data["direction"]
             code = data["code"]
@@ -765,8 +766,8 @@
                     req_rid_dict[sinfo] = (client_id, request_id)
                     self.__tradeSimpleApi.cancel_buy(code, orderSysID, sinfo)
                 except Exception as e:
-                    SendResponseSkManager.get_send_response_sk(TYPE_CANCEL_ORDER).sendall(
-                        json.dumps({"code": 1, "msg": str(e)}).encode("utf-8"))
+                    send_response(json.dumps({"code": 1, "msg": str(e)}).encode("utf-8"), TYPE_CANCEL_ORDER, client_id,
+                                  request_id)
 
             elif direction == 2:
                 # 鎾ゅ崠
@@ -774,8 +775,8 @@
                     req_rid_dict[sinfo] = (client_id, request_id)
                     self.__tradeSimpleApi.cancel_sell(code, orderSysID, sinfo)
                 except Exception as e:
-                    SendResponseSkManager.get_send_response_sk(TYPE_CANCEL_ORDER).sendall(
-                        json.dumps({"code": 1, "msg": str(e)}).encode("utf-8"))
+                    send_response(json.dumps({"code": 1, "msg": str(e)}).encode("utf-8"), TYPE_CANCEL_ORDER, client_id,
+                                  request_id)
 
     def OnDealList(self, client_id, request_id):
         logger_trade_debug.info(f"璇锋眰鎴愪氦鍒楄〃锛歝lient_id-{client_id} request_id-{request_id}")
@@ -793,7 +794,8 @@
             req_id = self.__tradeSimpleApi.list_delegate_orders(is_cancel)
             req_rid_dict[req_id] = (client_id, request_id)
         except Exception as e:
-            SendResponseSkManager.send_error_response("common", request_id, client_id, str(e))
+            send_response(json.dumps({"code": 1, "msg": str(e)}).encode("utf-8"), "common", client_id,
+                          request_id)
 
     def OnMoney(self, client_id, request_id):
         logger_trade_debug.info(f"璇锋眰璐︽埛锛歝lient_id-{client_id} request_id-{request_id}")
@@ -801,7 +803,8 @@
             req_id = self.__tradeSimpleApi.get_money_account()
             req_rid_dict[req_id] = (client_id, request_id)
         except Exception as e:
-            SendResponseSkManager.send_error_response("common", request_id, client_id, str(e))
+            send_response(json.dumps({"code": 1, "msg": str(e)}).encode("utf-8"), "common", client_id,
+                          request_id)
 
     def OnPositionList(self, client_id, request_id):
         logger_trade_debug.info(f"璇锋眰鎸佷粨锛歝lient_id-{client_id} request_id-{request_id}")
@@ -809,7 +812,8 @@
             req_id = self.__tradeSimpleApi.list_positions()
             req_rid_dict[req_id] = (client_id, request_id)
         except Exception as e:
-            SendResponseSkManager.send_error_response("common", request_id, client_id, str(e))
+            send_response(json.dumps({"code": 1, "msg": str(e)}).encode("utf-8"), "common", client_id,
+                          request_id)
 
 
 def __init_trade_data_server():
@@ -866,35 +870,44 @@
 
 
 def __send_response(type, data_bytes):
-    sk = SendResponseSkManager.get_send_response_sk(type)
-    data_bytes = socket_util.load_header(data_bytes)
-    sk.sendall(data_bytes)
-    result, header_str = socket_util.recv_data(sk)
-    result = json.loads(result)
-    if result["code"] != 0:
-        raise Exception(result['msg'])
+    sk = SendResponseSkManager.create_send_response_sk()
+    try:
+        data_bytes = socket_util.load_header(data_bytes)
+        sk.sendall(data_bytes)
+        result, header_str = socket_util.recv_data(sk)
+        result = json.loads(result)
+        if result["code"] != 0:
+            raise Exception(result['msg'])
+    finally:
+        sk.close()
+
+
+def send_response(data_bytes, type, _client_id, _request_id):
+    for i in range(3):
+        response_client_type = f"{type}#{_client_id}"
+        try:
+            __send_response(response_client_type, data_bytes)
+            print("鍙戦�佹暟鎹垚鍔�")
+            logger_trade_debug.info(f"绗瑊i}娆″彂閫佹暟鎹垚鍔燂細type-{type},request_id-{_request_id}")
+            break
+        except ConnectionResetError:
+            logger_trade_debug.error(f"绗瑊i}娆″彂閫佹暟鎹け璐ワ細type-{type},request_id-{_request_id} 鍘熷洜锛欳onnectionResetError")
+            SendResponseSkManager.del_send_response_sk(response_client_type)
+        except BrokenPipeError:
+            logger_trade_debug.error(f"绗瑊i}娆″彂閫佹暟鎹け璐ワ細type-{type},request_id-{_request_id} 鍘熷洜锛欱rokenPipeError")
+            SendResponseSkManager.del_send_response_sk(response_client_type)
+        except TimeoutError:
+            logger_trade_debug.error(f"绗瑊i}娆″彂閫佹暟鎹け璐ワ細type-{type},request_id-{_request_id} 鍘熷洜锛歍imeoutError")
+            SendResponseSkManager.del_send_response_sk(response_client_type)
+        except Exception as e1:
+            logger_trade_debug.error(f"绗瑊i}娆″彂閫佹暟鎹け璐ワ細type-{type},request_id-{_request_id} 鍘熷洜锛歿str(e1)}")
+            logger_trade_debug.exception(e1)
+            pass
 
 
 # 浜ゆ槗鍙嶉鍥炶皟
 def __traderapi_callback(type, req_id, data):
-    def send_response(data_str, _client_id, _request_id):
-        for i in range(3):
-            try:
-                __send_response(f"{type}#{_client_id}", data_str)
-                print("鍙戦�佹暟鎹垚鍔�")
-                logger_trade_debug.info(f"绗瑊i}娆″彂閫佹暟鎹垚鍔燂細type-{type},request_id-{_request_id}")
-                break
-            except ConnectionResetError as e:
-                SendResponseSkManager.del_send_response_sk(type)
-            except BrokenPipeError as e:
-                SendResponseSkManager.del_send_response_sk(type)
-            except Exception as e:
-                logger_trade_debug.info(f"绗瑊i}娆″彂閫佹暟鎹け璐ワ細type-{type},request_id-{_request_id}")
-                logger_trade_debug.exception(e)
-                pass
-
-    print("鍥炶皟", type, req_id, data)
-    print("杩涚▼ID", os.getpid())
+    logger_trade_debug.info("鍥炶皟:type-{} req_id-{}", type, req_id)
     key = req_id
     if type == TYPE_ORDER or type == TYPE_CANCEL_ORDER:
         key = data["sinfo"]
@@ -903,16 +916,20 @@
         if req_rid_dict and key in req_rid_dict:
             print("API鍥炶皟")
             client_id, request_id = req_rid_dict.pop(key)
+            logger_trade_debug.info("API鍥炶皟 request_id-{}", request_id)
             # 娴嬭瘯
             send_response(
                 json.dumps({"type": "response", "data": {"code": 0, "data": data}, "client_id": client_id,
-                            "request_id": request_id}).encode('utf-8'), client_id, request_id)
+                            "request_id": request_id}).encode('utf-8'), type, client_id, request_id)
+            logger_trade_debug.info("API鍥炶皟缁撴潫 req_id-{} request_id-{}", req_id, request_id)
             print("API鍥炶皟缁撴潫")
         else:
+            logger_trade_debug.info("闈濧PI鍥炶皟 req_id-{}", req_id)
             print("闈濧PI鍥炶皟")
             # 闈濧PI鍥炶皟
             send_response(
                 json.dumps({"type": "trade_callback", "data": {"code": 0, "data": data, "type": type}}).encode('utf-8'),
+                type,
                 None,
                 req_id)
             print("闈濧PI缁撴潫")
diff --git a/xmdapi.py b/xmdapi.py
new file mode 100644
index 0000000..8c42918
--- /dev/null
+++ b/xmdapi.py
@@ -0,0 +1,924 @@
+# This file was automatically generated by SWIG (http://www.swig.org).
+# Version 4.0.2
+#
+# Do not make changes to this file unless you know what you are doing--modify
+# the SWIG interface file instead.
+
+from sys import version_info as _swig_python_version_info
+if _swig_python_version_info < (2, 7, 0):
+    raise RuntimeError("Python 2.7 or later required")
+
+# Import the low-level C/C++ module
+if __package__ or "." in __name__:
+    from . import _xmdapi
+else:
+    import _xmdapi
+
+try:
+    import builtins as __builtin__
+except ImportError:
+    import __builtin__
+
+def _swig_repr(self):
+    try:
+        strthis = "proxy of " + self.this.__repr__()
+    except __builtin__.Exception:
+        strthis = ""
+    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
+
+
+def _swig_setattr_nondynamic_instance_variable(set):
+    def set_instance_attr(self, name, value):
+        if name == "thisown":
+            self.this.own(value)
+        elif name == "this":
+            set(self, name, value)
+        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
+            set(self, name, value)
+        else:
+            raise AttributeError("You cannot add instance attributes to %s" % self)
+    return set_instance_attr
+
+
+def _swig_setattr_nondynamic_class_variable(set):
+    def set_class_attr(cls, name, value):
+        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
+            set(cls, name, value)
+        else:
+            raise AttributeError("You cannot add class attributes to %s" % cls)
+    return set_class_attr
+
+
+def _swig_add_metaclass(metaclass):
+    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
+    def wrapper(cls):
+        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
+    return wrapper
+
+
+class _SwigNonDynamicMeta(type):
+    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
+    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)
+
+
+import weakref
+
+
+def set_null(*args):
+    return _xmdapi.set_null(*args)
+
+def is_null(*args):
+    return _xmdapi.is_null(*args)
+TORA_TERT_RESTART = _xmdapi.TORA_TERT_RESTART
+TORA_TERT_RESUME = _xmdapi.TORA_TERT_RESUME
+TORA_TERT_QUICK = _xmdapi.TORA_TERT_QUICK
+class CTORATstpReqUserLoginField(object):
+    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
+    __repr__ = _swig_repr
+    LogInAccount = property(_xmdapi.CTORATstpReqUserLoginField_LogInAccount_get, _xmdapi.CTORATstpReqUserLoginField_LogInAccount_set)
+    LogInAccountType = property(_xmdapi.CTORATstpReqUserLoginField_LogInAccountType_get, _xmdapi.CTORATstpReqUserLoginField_LogInAccountType_set)
+    DepartmentID = property(_xmdapi.CTORATstpReqUserLoginField_DepartmentID_get, _xmdapi.CTORATstpReqUserLoginField_DepartmentID_set)
+    AuthMode = property(_xmdapi.CTORATstpReqUserLoginField_AuthMode_get, _xmdapi.CTORATstpReqUserLoginField_AuthMode_set)
+    Password = property(_xmdapi.CTORATstpReqUserLoginField_Password_get, _xmdapi.CTORATstpReqUserLoginField_Password_set)
+    UserProductInfo = property(_xmdapi.CTORATstpReqUserLoginField_UserProductInfo_get, _xmdapi.CTORATstpReqUserLoginField_UserProductInfo_set)
+    InterfaceProductInfo = property(_xmdapi.CTORATstpReqUserLoginField_InterfaceProductInfo_get, _xmdapi.CTORATstpReqUserLoginField_InterfaceProductInfo_set)
+    TerminalInfo = property(_xmdapi.CTORATstpReqUserLoginField_TerminalInfo_get, _xmdapi.CTORATstpReqUserLoginField_TerminalInfo_set)
+    InnerIPAddress = property(_xmdapi.CTORATstpReqUserLoginField_InnerIPAddress_get, _xmdapi.CTORATstpReqUserLoginField_InnerIPAddress_set)
+    OuterIPAddress = property(_xmdapi.CTORATstpReqUserLoginField_OuterIPAddress_get, _xmdapi.CTORATstpReqUserLoginField_OuterIPAddress_set)
+    MacAddress = property(_xmdapi.CTORATstpReqUserLoginField_MacAddress_get, _xmdapi.CTORATstpReqUserLoginField_MacAddress_set)
+    Lang = property(_xmdapi.CTORATstpReqUserLoginField_Lang_get, _xmdapi.CTORATstpReqUserLoginField_Lang_set)
+    DynamicPassword = property(_xmdapi.CTORATstpReqUserLoginField_DynamicPassword_get, _xmdapi.CTORATstpReqUserLoginField_DynamicPassword_set)
+    DeviceID = property(_xmdapi.CTORATstpReqUserLoginField_DeviceID_get, _xmdapi.CTORATstpReqUserLoginField_DeviceID_set)
+    CertSerial = property(_xmdapi.CTORATstpReqUserLoginField_CertSerial_get, _xmdapi.CTORATstpReqUserLoginField_CertSerial_set)
+    DeviceType = property(_xmdapi.CTORATstpReqUserLoginField_DeviceType_get, _xmdapi.CTORATstpReqUserLoginField_DeviceType_set)
+
+    def __init__(self):
+        _xmdapi.CTORATstpReqUserLoginField_swiginit(self, _xmdapi.new_CTORATstpReqUserLoginField())
+    __swig_destroy__ = _xmdapi.delete_CTORATstpReqUserLoginField
+
+# Register CTORATstpReqUserLoginField in _xmdapi:
+_xmdapi.CTORATstpReqUserLoginField_swigregister(CTORATstpReqUserLoginField)
+cvar = _xmdapi.cvar
+INT_NULL_VAL = cvar.INT_NULL_VAL
+FLOAT_NULL_VAL = cvar.FLOAT_NULL_VAL
+CHAR_NULL_VAL = cvar.CHAR_NULL_VAL
+WORD_NULL_VAL = cvar.WORD_NULL_VAL
+LONG_NULL_VAL = cvar.LONG_NULL_VAL
+TORA_TSTP_LACT_UserID = cvar.TORA_TSTP_LACT_UserID
+TORA_TSTP_LACT_AccountID = cvar.TORA_TSTP_LACT_AccountID
+TORA_TSTP_LACT_SHAStock = cvar.TORA_TSTP_LACT_SHAStock
+TORA_TSTP_LACT_SZAStock = cvar.TORA_TSTP_LACT_SZAStock
+TORA_TSTP_LACT_SHBStock = cvar.TORA_TSTP_LACT_SHBStock
+TORA_TSTP_LACT_SZBStock = cvar.TORA_TSTP_LACT_SZBStock
+TORA_TSTP_LACT_ThreeNewBoardA = cvar.TORA_TSTP_LACT_ThreeNewBoardA
+TORA_TSTP_LACT_ThreeNewBoardB = cvar.TORA_TSTP_LACT_ThreeNewBoardB
+TORA_TSTP_LACT_HKStock = cvar.TORA_TSTP_LACT_HKStock
+TORA_TSTP_LACT_UnifiedUserID = cvar.TORA_TSTP_LACT_UnifiedUserID
+TORA_TSTP_AM_Password = cvar.TORA_TSTP_AM_Password
+TORA_TSTP_AM_FingerPrint = cvar.TORA_TSTP_AM_FingerPrint
+TORA_TSTP_AM_CertInfo = cvar.TORA_TSTP_AM_CertInfo
+TORA_TSTP_LGT_ZHCN = cvar.TORA_TSTP_LGT_ZHCN
+TORA_TSTP_LGT_ZHHK = cvar.TORA_TSTP_LGT_ZHHK
+TORA_TSTP_LGT_ENUS = cvar.TORA_TSTP_LGT_ENUS
+TORA_TSTP_DT_PC = cvar.TORA_TSTP_DT_PC
+TORA_TSTP_DT_Mobile = cvar.TORA_TSTP_DT_Mobile
+TORA_TSTP_UTYPE_BrokerUser = cvar.TORA_TSTP_UTYPE_BrokerUser
+TORA_TSTP_UTYPE_SuperUser = cvar.TORA_TSTP_UTYPE_SuperUser
+TORA_TSTP_UTYPE_Investor = cvar.TORA_TSTP_UTYPE_Investor
+TORA_TSTP_EXD_SSE = cvar.TORA_TSTP_EXD_SSE
+TORA_TSTP_EXD_SZSE = cvar.TORA_TSTP_EXD_SZSE
+TORA_TSTP_EXD_HK = cvar.TORA_TSTP_EXD_HK
+TORA_TSTP_EXD_BSE = cvar.TORA_TSTP_EXD_BSE
+TORA_TSTP_MKD_SHA = cvar.TORA_TSTP_MKD_SHA
+TORA_TSTP_MKD_SZA = cvar.TORA_TSTP_MKD_SZA
+TORA_TSTP_MKD_SHB = cvar.TORA_TSTP_MKD_SHB
+TORA_TSTP_MKD_SZB = cvar.TORA_TSTP_MKD_SZB
+TORA_TSTP_MKD_SZThreeA = cvar.TORA_TSTP_MKD_SZThreeA
+TORA_TSTP_MKD_SZThreeB = cvar.TORA_TSTP_MKD_SZThreeB
+TORA_TSTP_MKD_Foreign = cvar.TORA_TSTP_MKD_Foreign
+TORA_TSTP_MKD_SZHK = cvar.TORA_TSTP_MKD_SZHK
+TORA_TSTP_MKD_SHHK = cvar.TORA_TSTP_MKD_SHHK
+TORA_TSTP_MKD_BJMain = cvar.TORA_TSTP_MKD_BJMain
+TORA_TSTP_MSST_PreOpen = cvar.TORA_TSTP_MSST_PreOpen
+TORA_TSTP_MSST_CallAuction = cvar.TORA_TSTP_MSST_CallAuction
+TORA_TSTP_MSST_Continous = cvar.TORA_TSTP_MSST_Continous
+TORA_TSTP_MSST_Pause = cvar.TORA_TSTP_MSST_Pause
+TORA_TSTP_MSST_Suspend = cvar.TORA_TSTP_MSST_Suspend
+TORA_TSTP_MSST_LongSuspend = cvar.TORA_TSTP_MSST_LongSuspend
+TORA_TSTP_MSST_UndulationInt = cvar.TORA_TSTP_MSST_UndulationInt
+TORA_TSTP_MSST_CircuitBreak = cvar.TORA_TSTP_MSST_CircuitBreak
+TORA_TSTP_MSST_CircuitBreakU = cvar.TORA_TSTP_MSST_CircuitBreakU
+TORA_TSTP_MSST_Close = cvar.TORA_TSTP_MSST_Close
+TORA_TSTP_MSST_Other = cvar.TORA_TSTP_MSST_Other
+TORA_TSTP_MSST_CloseCallAuction = cvar.TORA_TSTP_MSST_CloseCallAuction
+TORA_TSTP_MSST_CallMatch = cvar.TORA_TSTP_MSST_CallMatch
+TORA_TSTP_MSST_PostContinous = cvar.TORA_TSTP_MSST_PostContinous
+TORA_TSTP_MSST_PostClose = cvar.TORA_TSTP_MSST_PostClose
+TORA_TSTP_MSST_PrePostOpen = cvar.TORA_TSTP_MSST_PrePostOpen
+TORA_TSTP_EF_ToBeContinued = cvar.TORA_TSTP_EF_ToBeContinued
+TORA_TSTP_EF_BatchEnd = cvar.TORA_TSTP_EF_BatchEnd
+TORA_TSTP_EF_Completed = cvar.TORA_TSTP_EF_Completed
+TORA_TSTP_EF_NOP = cvar.TORA_TSTP_EF_NOP
+TORA_TSTP_MST_UnKnown = cvar.TORA_TSTP_MST_UnKnown
+TORA_TSTP_MST_BeforeTrading = cvar.TORA_TSTP_MST_BeforeTrading
+TORA_TSTP_MST_Continous = cvar.TORA_TSTP_MST_Continous
+TORA_TSTP_MST_Closed = cvar.TORA_TSTP_MST_Closed
+TORA_TSTP_MST_OpenCallAuction = cvar.TORA_TSTP_MST_OpenCallAuction
+TORA_TSTP_MST_SZSEHKUnopened = cvar.TORA_TSTP_MST_SZSEHKUnopened
+TORA_TSTP_MST_SZSEHKOpenCallAuctionInput = cvar.TORA_TSTP_MST_SZSEHKOpenCallAuctionInput
+TORA_TSTP_MST_SZSEHKOpenCallAuctionBeforeMatch = cvar.TORA_TSTP_MST_SZSEHKOpenCallAuctionBeforeMatch
+TORA_TSTP_MST_SZSEHKOpenCallAuctionMatch = cvar.TORA_TSTP_MST_SZSEHKOpenCallAuctionMatch
+TORA_TSTP_MST_SZSEHKHalt = cvar.TORA_TSTP_MST_SZSEHKHalt
+TORA_TSTP_MST_SZSEHKContinous = cvar.TORA_TSTP_MST_SZSEHKContinous
+TORA_TSTP_MST_SZSEHKExchangeIntervention = cvar.TORA_TSTP_MST_SZSEHKExchangeIntervention
+TORA_TSTP_MST_SZSEHKCloseCallAuctionReferencePrice = cvar.TORA_TSTP_MST_SZSEHKCloseCallAuctionReferencePrice
+TORA_TSTP_MST_SZSEHKCloseCallAuctionInput = cvar.TORA_TSTP_MST_SZSEHKCloseCallAuctionInput
+TORA_TSTP_MST_SZSEHKCloseCallAuctionCannotCancel = cvar.TORA_TSTP_MST_SZSEHKCloseCallAuctionCannotCancel
+TORA_TSTP_MST_SZSEHKCloseCallAuctionMatch = cvar.TORA_TSTP_MST_SZSEHKCloseCallAuctionMatch
+TORA_TSTP_MST_SZSEHKCloseCallAuctionRandomClosed = cvar.TORA_TSTP_MST_SZSEHKCloseCallAuctionRandomClosed
+TORA_TSTP_MST_SZSEHKCancel = cvar.TORA_TSTP_MST_SZSEHKCancel
+TORA_TSTP_MST_SZSEHKClosed = cvar.TORA_TSTP_MST_SZSEHKClosed
+TORA_TSTP_MST_SZSEHKWholeClosed = cvar.TORA_TSTP_MST_SZSEHKWholeClosed
+TORA_TSTP_MST_TCP = cvar.TORA_TSTP_MST_TCP
+TORA_TSTP_MST_UDP = cvar.TORA_TSTP_MST_UDP
+TORA_TSTP_MST_MCAST = cvar.TORA_TSTP_MST_MCAST
+
+class CTORATstpRspUserLoginField(object):
+    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
+    __repr__ = _swig_repr
+    DepartmentID = property(_xmdapi.CTORATstpRspUserLoginField_DepartmentID_get, _xmdapi.CTORATstpRspUserLoginField_DepartmentID_set)
+    LogInAccount = property(_xmdapi.CTORATstpRspUserLoginField_LogInAccount_get, _xmdapi.CTORATstpRspUserLoginField_LogInAccount_set)
+    LogInAccountType = property(_xmdapi.CTORATstpRspUserLoginField_LogInAccountType_get, _xmdapi.CTORATstpRspUserLoginField_LogInAccountType_set)
+    FrontID = property(_xmdapi.CTORATstpRspUserLoginField_FrontID_get, _xmdapi.CTORATstpRspUserLoginField_FrontID_set)
+    SessionID = property(_xmdapi.CTORATstpRspUserLoginField_SessionID_get, _xmdapi.CTORATstpRspUserLoginField_SessionID_set)
+    MaxOrderRef = property(_xmdapi.CTORATstpRspUserLoginField_MaxOrderRef_get, _xmdapi.CTORATstpRspUserLoginField_MaxOrderRef_set)
+    PrivateFlowCount = property(_xmdapi.CTORATstpRspUserLoginField_PrivateFlowCount_get, _xmdapi.CTORATstpRspUserLoginField_PrivateFlowCount_set)
+    PublicFlowCount = property(_xmdapi.CTORATstpRspUserLoginField_PublicFlowCount_get, _xmdapi.CTORATstpRspUserLoginField_PublicFlowCount_set)
+    LoginTime = property(_xmdapi.CTORATstpRspUserLoginField_LoginTime_get, _xmdapi.CTORATstpRspUserLoginField_LoginTime_set)
+    SystemName = property(_xmdapi.CTORATstpRspUserLoginField_SystemName_get, _xmdapi.CTORATstpRspUserLoginField_SystemName_set)
+    TradingDay = property(_xmdapi.CTORATstpRspUserLoginField_TradingDay_get, _xmdapi.CTORATstpRspUserLoginField_TradingDay_set)
+    UserID = property(_xmdapi.CTORATstpRspUserLoginField_UserID_get, _xmdapi.CTORATstpRspUserLoginField_UserID_set)
+    UserName = property(_xmdapi.CTORATstpRspUserLoginField_UserName_get, _xmdapi.CTORATstpRspUserLoginField_UserName_set)
+    UserType = property(_xmdapi.CTORATstpRspUserLoginField_UserType_get, _xmdapi.CTORATstpRspUserLoginField_UserType_set)
+    OrderInsertCommFlux = property(_xmdapi.CTORATstpRspUserLoginField_OrderInsertCommFlux_get, _xmdapi.CTORATstpRspUserLoginField_OrderInsertCommFlux_set)
+    OrderActionCommFlux = property(_xmdapi.CTORATstpRspUserLoginField_OrderActionCommFlux_get, _xmdapi.CTORATstpRspUserLoginField_OrderActionCommFlux_set)
+    PasswordExpiryDate = property(_xmdapi.CTORATstpRspUserLoginField_PasswordExpiryDate_get, _xmdapi.CTORATstpRspUserLoginField_PasswordExpiryDate_set)
+    NeedUpdatePassword = property(_xmdapi.CTORATstpRspUserLoginField_NeedUpdatePassword_get, _xmdapi.CTORATstpRspUserLoginField_NeedUpdatePassword_set)
+    CertSerial = property(_xmdapi.CTORATstpRspUserLoginField_CertSerial_get, _xmdapi.CTORATstpRspUserLoginField_CertSerial_set)
+    InnerIPAddress = property(_xmdapi.CTORATstpRspUserLoginField_InnerIPAddress_get, _xmdapi.CTORATstpRspUserLoginField_InnerIPAddress_set)
+    OuterIPAddress = property(_xmdapi.CTORATstpRspUserLoginField_OuterIPAddress_get, _xmdapi.CTORATstpRspUserLoginField_OuterIPAddress_set)
+    MacAddress = property(_xmdapi.CTORATstpRspUserLoginField_MacAddress_get, _xmdapi.CTORATstpRspUserLoginField_MacAddress_set)
+
+    def __init__(self):
+        _xmdapi.CTORATstpRspUserLoginField_swiginit(self, _xmdapi.new_CTORATstpRspUserLoginField())
+    __swig_destroy__ = _xmdapi.delete_CTORATstpRspUserLoginField
+
+# Register CTORATstpRspUserLoginField in _xmdapi:
+_xmdapi.CTORATstpRspUserLoginField_swigregister(CTORATstpRspUserLoginField)
+
+class CTORATstpRspInfoField(object):
+    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
+    __repr__ = _swig_repr
+    ErrorID = property(_xmdapi.CTORATstpRspInfoField_ErrorID_get, _xmdapi.CTORATstpRspInfoField_ErrorID_set)
+    ErrorMsg = property(_xmdapi.CTORATstpRspInfoField_ErrorMsg_get, _xmdapi.CTORATstpRspInfoField_ErrorMsg_set)
+
+    def __init__(self):
+        _xmdapi.CTORATstpRspInfoField_swiginit(self, _xmdapi.new_CTORATstpRspInfoField())
+    __swig_destroy__ = _xmdapi.delete_CTORATstpRspInfoField
+
+# Register CTORATstpRspInfoField in _xmdapi:
+_xmdapi.CTORATstpRspInfoField_swigregister(CTORATstpRspInfoField)
+
+class CTORATstpUserLogoutField(object):
+    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
+    __repr__ = _swig_repr
+    UserID = property(_xmdapi.CTORATstpUserLogoutField_UserID_get, _xmdapi.CTORATstpUserLogoutField_UserID_set)
+
+    def __init__(self):
+        _xmdapi.CTORATstpUserLogoutField_swiginit(self, _xmdapi.new_CTORATstpUserLogoutField())
+    __swig_destroy__ = _xmdapi.delete_CTORATstpUserLogoutField
+
+# Register CTORATstpUserLogoutField in _xmdapi:
+_xmdapi.CTORATstpUserLogoutField_swigregister(CTORATstpUserLogoutField)
+
+class CTORATstpSpecificSecurityField(object):
+    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
+    __repr__ = _swig_repr
+    ExchangeID = property(_xmdapi.CTORATstpSpecificSecurityField_ExchangeID_get, _xmdapi.CTORATstpSpecificSecurityField_ExchangeID_set)
+    SecurityID = property(_xmdapi.CTORATstpSpecificSecurityField_SecurityID_get, _xmdapi.CTORATstpSpecificSecurityField_SecurityID_set)
+
+    def __init__(self):
+        _xmdapi.CTORATstpSpecificSecurityField_swiginit(self, _xmdapi.new_CTORATstpSpecificSecurityField())
+    __swig_destroy__ = _xmdapi.delete_CTORATstpSpecificSecurityField
+
+# Register CTORATstpSpecificSecurityField in _xmdapi:
+_xmdapi.CTORATstpSpecificSecurityField_swigregister(CTORATstpSpecificSecurityField)
+
+class CTORATstpSpecificMarketField(object):
+    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
+    __repr__ = _swig_repr
+    MarketID = property(_xmdapi.CTORATstpSpecificMarketField_MarketID_get, _xmdapi.CTORATstpSpecificMarketField_MarketID_set)
+
+    def __init__(self):
+        _xmdapi.CTORATstpSpecificMarketField_swiginit(self, _xmdapi.new_CTORATstpSpecificMarketField())
+    __swig_destroy__ = _xmdapi.delete_CTORATstpSpecificMarketField
+
+# Register CTORATstpSpecificMarketField in _xmdapi:
+_xmdapi.CTORATstpSpecificMarketField_swigregister(CTORATstpSpecificMarketField)
+
+class CTORATstpInquiryMarketDataField(object):
+    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
+    __repr__ = _swig_repr
+    ExchangeID = property(_xmdapi.CTORATstpInquiryMarketDataField_ExchangeID_get, _xmdapi.CTORATstpInquiryMarketDataField_ExchangeID_set)
+    SecurityID = property(_xmdapi.CTORATstpInquiryMarketDataField_SecurityID_get, _xmdapi.CTORATstpInquiryMarketDataField_SecurityID_set)
+
+    def __init__(self):
+        _xmdapi.CTORATstpInquiryMarketDataField_swiginit(self, _xmdapi.new_CTORATstpInquiryMarketDataField())
+    __swig_destroy__ = _xmdapi.delete_CTORATstpInquiryMarketDataField
+
+# Register CTORATstpInquiryMarketDataField in _xmdapi:
+_xmdapi.CTORATstpInquiryMarketDataField_swigregister(CTORATstpInquiryMarketDataField)
+
+class CTORATstpMarketDataField(object):
+    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
+    __repr__ = _swig_repr
+    TradingDay = property(_xmdapi.CTORATstpMarketDataField_TradingDay_get, _xmdapi.CTORATstpMarketDataField_TradingDay_set)
+    SecurityID = property(_xmdapi.CTORATstpMarketDataField_SecurityID_get, _xmdapi.CTORATstpMarketDataField_SecurityID_set)
+    ExchangeID = property(_xmdapi.CTORATstpMarketDataField_ExchangeID_get, _xmdapi.CTORATstpMarketDataField_ExchangeID_set)
+    SecurityName = property(_xmdapi.CTORATstpMarketDataField_SecurityName_get, _xmdapi.CTORATstpMarketDataField_SecurityName_set)
+    PreClosePrice = property(_xmdapi.CTORATstpMarketDataField_PreClosePrice_get, _xmdapi.CTORATstpMarketDataField_PreClosePrice_set)
+    OpenPrice = property(_xmdapi.CTORATstpMarketDataField_OpenPrice_get, _xmdapi.CTORATstpMarketDataField_OpenPrice_set)
+    Volume = property(_xmdapi.CTORATstpMarketDataField_Volume_get, _xmdapi.CTORATstpMarketDataField_Volume_set)
+    Turnover = property(_xmdapi.CTORATstpMarketDataField_Turnover_get, _xmdapi.CTORATstpMarketDataField_Turnover_set)
+    TradingCount = property(_xmdapi.CTORATstpMarketDataField_TradingCount_get, _xmdapi.CTORATstpMarketDataField_TradingCount_set)
+    LastPrice = property(_xmdapi.CTORATstpMarketDataField_LastPrice_get, _xmdapi.CTORATstpMarketDataField_LastPrice_set)
+    HighestPrice = property(_xmdapi.CTORATstpMarketDataField_HighestPrice_get, _xmdapi.CTORATstpMarketDataField_HighestPrice_set)
+    LowestPrice = property(_xmdapi.CTORATstpMarketDataField_LowestPrice_get, _xmdapi.CTORATstpMarketDataField_LowestPrice_set)
+    BidPrice1 = property(_xmdapi.CTORATstpMarketDataField_BidPrice1_get, _xmdapi.CTORATstpMarketDataField_BidPrice1_set)
+    AskPrice1 = property(_xmdapi.CTORATstpMarketDataField_AskPrice1_get, _xmdapi.CTORATstpMarketDataField_AskPrice1_set)
+    UpperLimitPrice = property(_xmdapi.CTORATstpMarketDataField_UpperLimitPrice_get, _xmdapi.CTORATstpMarketDataField_UpperLimitPrice_set)
+    LowerLimitPrice = property(_xmdapi.CTORATstpMarketDataField_LowerLimitPrice_get, _xmdapi.CTORATstpMarketDataField_LowerLimitPrice_set)
+    PERatio1 = property(_xmdapi.CTORATstpMarketDataField_PERatio1_get, _xmdapi.CTORATstpMarketDataField_PERatio1_set)
+    PERatio2 = property(_xmdapi.CTORATstpMarketDataField_PERatio2_get, _xmdapi.CTORATstpMarketDataField_PERatio2_set)
+    PriceUpDown1 = property(_xmdapi.CTORATstpMarketDataField_PriceUpDown1_get, _xmdapi.CTORATstpMarketDataField_PriceUpDown1_set)
+    PriceUpDown2 = property(_xmdapi.CTORATstpMarketDataField_PriceUpDown2_get, _xmdapi.CTORATstpMarketDataField_PriceUpDown2_set)
+    OpenInterest = property(_xmdapi.CTORATstpMarketDataField_OpenInterest_get, _xmdapi.CTORATstpMarketDataField_OpenInterest_set)
+    BidVolume1 = property(_xmdapi.CTORATstpMarketDataField_BidVolume1_get, _xmdapi.CTORATstpMarketDataField_BidVolume1_set)
+    AskVolume1 = property(_xmdapi.CTORATstpMarketDataField_AskVolume1_get, _xmdapi.CTORATstpMarketDataField_AskVolume1_set)
+    BidPrice2 = property(_xmdapi.CTORATstpMarketDataField_BidPrice2_get, _xmdapi.CTORATstpMarketDataField_BidPrice2_set)
+    BidVolume2 = property(_xmdapi.CTORATstpMarketDataField_BidVolume2_get, _xmdapi.CTORATstpMarketDataField_BidVolume2_set)
+    AskPrice2 = property(_xmdapi.CTORATstpMarketDataField_AskPrice2_get, _xmdapi.CTORATstpMarketDataField_AskPrice2_set)
+    AskVolume2 = property(_xmdapi.CTORATstpMarketDataField_AskVolume2_get, _xmdapi.CTORATstpMarketDataField_AskVolume2_set)
+    BidPrice3 = property(_xmdapi.CTORATstpMarketDataField_BidPrice3_get, _xmdapi.CTORATstpMarketDataField_BidPrice3_set)
+    BidVolume3 = property(_xmdapi.CTORATstpMarketDataField_BidVolume3_get, _xmdapi.CTORATstpMarketDataField_BidVolume3_set)
+    AskPrice3 = property(_xmdapi.CTORATstpMarketDataField_AskPrice3_get, _xmdapi.CTORATstpMarketDataField_AskPrice3_set)
+    AskVolume3 = property(_xmdapi.CTORATstpMarketDataField_AskVolume3_get, _xmdapi.CTORATstpMarketDataField_AskVolume3_set)
+    BidPrice4 = property(_xmdapi.CTORATstpMarketDataField_BidPrice4_get, _xmdapi.CTORATstpMarketDataField_BidPrice4_set)
+    BidVolume4 = property(_xmdapi.CTORATstpMarketDataField_BidVolume4_get, _xmdapi.CTORATstpMarketDataField_BidVolume4_set)
+    AskPrice4 = property(_xmdapi.CTORATstpMarketDataField_AskPrice4_get, _xmdapi.CTORATstpMarketDataField_AskPrice4_set)
+    AskVolume4 = property(_xmdapi.CTORATstpMarketDataField_AskVolume4_get, _xmdapi.CTORATstpMarketDataField_AskVolume4_set)
+    BidPrice5 = property(_xmdapi.CTORATstpMarketDataField_BidPrice5_get, _xmdapi.CTORATstpMarketDataField_BidPrice5_set)
+    BidVolume5 = property(_xmdapi.CTORATstpMarketDataField_BidVolume5_get, _xmdapi.CTORATstpMarketDataField_BidVolume5_set)
+    AskPrice5 = property(_xmdapi.CTORATstpMarketDataField_AskPrice5_get, _xmdapi.CTORATstpMarketDataField_AskPrice5_set)
+    AskVolume5 = property(_xmdapi.CTORATstpMarketDataField_AskVolume5_get, _xmdapi.CTORATstpMarketDataField_AskVolume5_set)
+    UpdateTime = property(_xmdapi.CTORATstpMarketDataField_UpdateTime_get, _xmdapi.CTORATstpMarketDataField_UpdateTime_set)
+    UpdateMillisec = property(_xmdapi.CTORATstpMarketDataField_UpdateMillisec_get, _xmdapi.CTORATstpMarketDataField_UpdateMillisec_set)
+    ClosePrice = property(_xmdapi.CTORATstpMarketDataField_ClosePrice_get, _xmdapi.CTORATstpMarketDataField_ClosePrice_set)
+    SettlementPrice = property(_xmdapi.CTORATstpMarketDataField_SettlementPrice_get, _xmdapi.CTORATstpMarketDataField_SettlementPrice_set)
+    MDSecurityStat = property(_xmdapi.CTORATstpMarketDataField_MDSecurityStat_get, _xmdapi.CTORATstpMarketDataField_MDSecurityStat_set)
+    HWLevel = property(_xmdapi.CTORATstpMarketDataField_HWLevel_get, _xmdapi.CTORATstpMarketDataField_HWLevel_set)
+    PreCloseIOPV = property(_xmdapi.CTORATstpMarketDataField_PreCloseIOPV_get, _xmdapi.CTORATstpMarketDataField_PreCloseIOPV_set)
+    IOPV = property(_xmdapi.CTORATstpMarketDataField_IOPV_get, _xmdapi.CTORATstpMarketDataField_IOPV_set)
+
+    def __init__(self):
+        _xmdapi.CTORATstpMarketDataField_swiginit(self, _xmdapi.new_CTORATstpMarketDataField())
+    __swig_destroy__ = _xmdapi.delete_CTORATstpMarketDataField
+
+# Register CTORATstpMarketDataField in _xmdapi:
+_xmdapi.CTORATstpMarketDataField_swigregister(CTORATstpMarketDataField)
+
+class CTORATstpQryRspInfoField(object):
+    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
+    __repr__ = _swig_repr
+    EndFlag = property(_xmdapi.CTORATstpQryRspInfoField_EndFlag_get, _xmdapi.CTORATstpQryRspInfoField_EndFlag_set)
+    ErrorID = property(_xmdapi.CTORATstpQryRspInfoField_ErrorID_get, _xmdapi.CTORATstpQryRspInfoField_ErrorID_set)
+    ErrorMsg = property(_xmdapi.CTORATstpQryRspInfoField_ErrorMsg_get, _xmdapi.CTORATstpQryRspInfoField_ErrorMsg_set)
+
+    def __init__(self):
+        _xmdapi.CTORATstpQryRspInfoField_swiginit(self, _xmdapi.new_CTORATstpQryRspInfoField())
+    __swig_destroy__ = _xmdapi.delete_CTORATstpQryRspInfoField
+
+# Register CTORATstpQryRspInfoField in _xmdapi:
+_xmdapi.CTORATstpQryRspInfoField_swigregister(CTORATstpQryRspInfoField)
+
+class CTORATstpPHMarketDataField(object):
+    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
+    __repr__ = _swig_repr
+    TradingDay = property(_xmdapi.CTORATstpPHMarketDataField_TradingDay_get, _xmdapi.CTORATstpPHMarketDataField_TradingDay_set)
+    SecurityID = property(_xmdapi.CTORATstpPHMarketDataField_SecurityID_get, _xmdapi.CTORATstpPHMarketDataField_SecurityID_set)
+    ExchangeID = property(_xmdapi.CTORATstpPHMarketDataField_ExchangeID_get, _xmdapi.CTORATstpPHMarketDataField_ExchangeID_set)
+    SecurityName = property(_xmdapi.CTORATstpPHMarketDataField_SecurityName_get, _xmdapi.CTORATstpPHMarketDataField_SecurityName_set)
+    Volume = property(_xmdapi.CTORATstpPHMarketDataField_Volume_get, _xmdapi.CTORATstpPHMarketDataField_Volume_set)
+    Turnover = property(_xmdapi.CTORATstpPHMarketDataField_Turnover_get, _xmdapi.CTORATstpPHMarketDataField_Turnover_set)
+    ClosePrice = property(_xmdapi.CTORATstpPHMarketDataField_ClosePrice_get, _xmdapi.CTORATstpPHMarketDataField_ClosePrice_set)
+    UpperLimitPrice = property(_xmdapi.CTORATstpPHMarketDataField_UpperLimitPrice_get, _xmdapi.CTORATstpPHMarketDataField_UpperLimitPrice_set)
+    LowerLimitPrice = property(_xmdapi.CTORATstpPHMarketDataField_LowerLimitPrice_get, _xmdapi.CTORATstpPHMarketDataField_LowerLimitPrice_set)
+    BidVolume = property(_xmdapi.CTORATstpPHMarketDataField_BidVolume_get, _xmdapi.CTORATstpPHMarketDataField_BidVolume_set)
+    AskVolume = property(_xmdapi.CTORATstpPHMarketDataField_AskVolume_get, _xmdapi.CTORATstpPHMarketDataField_AskVolume_set)
+    UpdateTime = property(_xmdapi.CTORATstpPHMarketDataField_UpdateTime_get, _xmdapi.CTORATstpPHMarketDataField_UpdateTime_set)
+    UpdateMillisec = property(_xmdapi.CTORATstpPHMarketDataField_UpdateMillisec_get, _xmdapi.CTORATstpPHMarketDataField_UpdateMillisec_set)
+    MDSecurityStat = property(_xmdapi.CTORATstpPHMarketDataField_MDSecurityStat_get, _xmdapi.CTORATstpPHMarketDataField_MDSecurityStat_set)
+    HWLevel = property(_xmdapi.CTORATstpPHMarketDataField_HWLevel_get, _xmdapi.CTORATstpPHMarketDataField_HWLevel_set)
+
+    def __init__(self):
+        _xmdapi.CTORATstpPHMarketDataField_swiginit(self, _xmdapi.new_CTORATstpPHMarketDataField())
+    __swig_destroy__ = _xmdapi.delete_CTORATstpPHMarketDataField
+
+# Register CTORATstpPHMarketDataField in _xmdapi:
+_xmdapi.CTORATstpPHMarketDataField_swigregister(CTORATstpPHMarketDataField)
+
+class CTORATstpInquirySpecialMarketDataField(object):
+    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
+    __repr__ = _swig_repr
+    ExchangeID = property(_xmdapi.CTORATstpInquirySpecialMarketDataField_ExchangeID_get, _xmdapi.CTORATstpInquirySpecialMarketDataField_ExchangeID_set)
+    SecurityID = property(_xmdapi.CTORATstpInquirySpecialMarketDataField_SecurityID_get, _xmdapi.CTORATstpInquirySpecialMarketDataField_SecurityID_set)
+
+    def __init__(self):
+        _xmdapi.CTORATstpInquirySpecialMarketDataField_swiginit(self, _xmdapi.new_CTORATstpInquirySpecialMarketDataField())
+    __swig_destroy__ = _xmdapi.delete_CTORATstpInquirySpecialMarketDataField
+
+# Register CTORATstpInquirySpecialMarketDataField in _xmdapi:
+_xmdapi.CTORATstpInquirySpecialMarketDataField_swigregister(CTORATstpInquirySpecialMarketDataField)
+
+class CTORATstpSpecialMarketDataField(object):
+    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
+    __repr__ = _swig_repr
+    TradingDay = property(_xmdapi.CTORATstpSpecialMarketDataField_TradingDay_get, _xmdapi.CTORATstpSpecialMarketDataField_TradingDay_set)
+    SecurityID = property(_xmdapi.CTORATstpSpecialMarketDataField_SecurityID_get, _xmdapi.CTORATstpSpecialMarketDataField_SecurityID_set)
+    ExchangeID = property(_xmdapi.CTORATstpSpecialMarketDataField_ExchangeID_get, _xmdapi.CTORATstpSpecialMarketDataField_ExchangeID_set)
+    SecurityName = property(_xmdapi.CTORATstpSpecialMarketDataField_SecurityName_get, _xmdapi.CTORATstpSpecialMarketDataField_SecurityName_set)
+    MovingAvgPrice = property(_xmdapi.CTORATstpSpecialMarketDataField_MovingAvgPrice_get, _xmdapi.CTORATstpSpecialMarketDataField_MovingAvgPrice_set)
+    MovingAvgPriceSamplingNum = property(_xmdapi.CTORATstpSpecialMarketDataField_MovingAvgPriceSamplingNum_get, _xmdapi.CTORATstpSpecialMarketDataField_MovingAvgPriceSamplingNum_set)
+    UpdateTime = property(_xmdapi.CTORATstpSpecialMarketDataField_UpdateTime_get, _xmdapi.CTORATstpSpecialMarketDataField_UpdateTime_set)
+    UpdateMillisec = property(_xmdapi.CTORATstpSpecialMarketDataField_UpdateMillisec_get, _xmdapi.CTORATstpSpecialMarketDataField_UpdateMillisec_set)
+
+    def __init__(self):
+        _xmdapi.CTORATstpSpecialMarketDataField_swiginit(self, _xmdapi.new_CTORATstpSpecialMarketDataField())
+    __swig_destroy__ = _xmdapi.delete_CTORATstpSpecialMarketDataField
+
+# Register CTORATstpSpecialMarketDataField in _xmdapi:
+_xmdapi.CTORATstpSpecialMarketDataField_swigregister(CTORATstpSpecialMarketDataField)
+
+class CTORATstpSimplifyMarketDataField(object):
+    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
+    __repr__ = _swig_repr
+    ExchangeID = property(_xmdapi.CTORATstpSimplifyMarketDataField_ExchangeID_get, _xmdapi.CTORATstpSimplifyMarketDataField_ExchangeID_set)
+    SecurityID = property(_xmdapi.CTORATstpSimplifyMarketDataField_SecurityID_get, _xmdapi.CTORATstpSimplifyMarketDataField_SecurityID_set)
+    SecurityName = property(_xmdapi.CTORATstpSimplifyMarketDataField_SecurityName_get, _xmdapi.CTORATstpSimplifyMarketDataField_SecurityName_set)
+    PreClosePrice = property(_xmdapi.CTORATstpSimplifyMarketDataField_PreClosePrice_get, _xmdapi.CTORATstpSimplifyMarketDataField_PreClosePrice_set)
+    LastPrice = property(_xmdapi.CTORATstpSimplifyMarketDataField_LastPrice_get, _xmdapi.CTORATstpSimplifyMarketDataField_LastPrice_set)
+    BidPrice1 = property(_xmdapi.CTORATstpSimplifyMarketDataField_BidPrice1_get, _xmdapi.CTORATstpSimplifyMarketDataField_BidPrice1_set)
+    AskPrice1 = property(_xmdapi.CTORATstpSimplifyMarketDataField_AskPrice1_get, _xmdapi.CTORATstpSimplifyMarketDataField_AskPrice1_set)
+    HighestPrice = property(_xmdapi.CTORATstpSimplifyMarketDataField_HighestPrice_get, _xmdapi.CTORATstpSimplifyMarketDataField_HighestPrice_set)
+    LowestPrice = property(_xmdapi.CTORATstpSimplifyMarketDataField_LowestPrice_get, _xmdapi.CTORATstpSimplifyMarketDataField_LowestPrice_set)
+    UpperLimitPrice = property(_xmdapi.CTORATstpSimplifyMarketDataField_UpperLimitPrice_get, _xmdapi.CTORATstpSimplifyMarketDataField_UpperLimitPrice_set)
+    LowerLimitPrice = property(_xmdapi.CTORATstpSimplifyMarketDataField_LowerLimitPrice_get, _xmdapi.CTORATstpSimplifyMarketDataField_LowerLimitPrice_set)
+    ClosePrice = property(_xmdapi.CTORATstpSimplifyMarketDataField_ClosePrice_get, _xmdapi.CTORATstpSimplifyMarketDataField_ClosePrice_set)
+    SettlementPrice = property(_xmdapi.CTORATstpSimplifyMarketDataField_SettlementPrice_get, _xmdapi.CTORATstpSimplifyMarketDataField_SettlementPrice_set)
+    UpdateTime = property(_xmdapi.CTORATstpSimplifyMarketDataField_UpdateTime_get, _xmdapi.CTORATstpSimplifyMarketDataField_UpdateTime_set)
+
+    def __init__(self):
+        _xmdapi.CTORATstpSimplifyMarketDataField_swiginit(self, _xmdapi.new_CTORATstpSimplifyMarketDataField())
+    __swig_destroy__ = _xmdapi.delete_CTORATstpSimplifyMarketDataField
+
+# Register CTORATstpSimplifyMarketDataField in _xmdapi:
+_xmdapi.CTORATstpSimplifyMarketDataField_swigregister(CTORATstpSimplifyMarketDataField)
+
+class CTORATstpSecurityStatusField(object):
+    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
+    __repr__ = _swig_repr
+    ExchangeID = property(_xmdapi.CTORATstpSecurityStatusField_ExchangeID_get, _xmdapi.CTORATstpSecurityStatusField_ExchangeID_set)
+    SecurityID = property(_xmdapi.CTORATstpSecurityStatusField_SecurityID_get, _xmdapi.CTORATstpSecurityStatusField_SecurityID_set)
+    IsSuspend = property(_xmdapi.CTORATstpSecurityStatusField_IsSuspend_get, _xmdapi.CTORATstpSecurityStatusField_IsSuspend_set)
+    IsBreak = property(_xmdapi.CTORATstpSecurityStatusField_IsBreak_get, _xmdapi.CTORATstpSecurityStatusField_IsBreak_set)
+    IsLongSuspend = property(_xmdapi.CTORATstpSecurityStatusField_IsLongSuspend_get, _xmdapi.CTORATstpSecurityStatusField_IsLongSuspend_set)
+    IsCircuitBreak = property(_xmdapi.CTORATstpSecurityStatusField_IsCircuitBreak_get, _xmdapi.CTORATstpSecurityStatusField_IsCircuitBreak_set)
+    IsSupportMarginBuy = property(_xmdapi.CTORATstpSecurityStatusField_IsSupportMarginBuy_get, _xmdapi.CTORATstpSecurityStatusField_IsSupportMarginBuy_set)
+    IsSupportShortSell = property(_xmdapi.CTORATstpSecurityStatusField_IsSupportShortSell_get, _xmdapi.CTORATstpSecurityStatusField_IsSupportShortSell_set)
+    IsSupportPur = property(_xmdapi.CTORATstpSecurityStatusField_IsSupportPur_get, _xmdapi.CTORATstpSecurityStatusField_IsSupportPur_set)
+    IsSupportRed = property(_xmdapi.CTORATstpSecurityStatusField_IsSupportRed_get, _xmdapi.CTORATstpSecurityStatusField_IsSupportRed_set)
+    IsSupportSplit = property(_xmdapi.CTORATstpSecurityStatusField_IsSupportSplit_get, _xmdapi.CTORATstpSecurityStatusField_IsSupportSplit_set)
+    IsSupportMerge = property(_xmdapi.CTORATstpSecurityStatusField_IsSupportMerge_get, _xmdapi.CTORATstpSecurityStatusField_IsSupportMerge_set)
+    IsSupportPleadgeIn = property(_xmdapi.CTORATstpSecurityStatusField_IsSupportPleadgeIn_get, _xmdapi.CTORATstpSecurityStatusField_IsSupportPleadgeIn_set)
+    IsSupportPleadgeOut = property(_xmdapi.CTORATstpSecurityStatusField_IsSupportPleadgeOut_get, _xmdapi.CTORATstpSecurityStatusField_IsSupportPleadgeOut_set)
+    IsSupportRoundLotBuy = property(_xmdapi.CTORATstpSecurityStatusField_IsSupportRoundLotBuy_get, _xmdapi.CTORATstpSecurityStatusField_IsSupportRoundLotBuy_set)
+    IsSupportRoundLotSell = property(_xmdapi.CTORATstpSecurityStatusField_IsSupportRoundLotSell_get, _xmdapi.CTORATstpSecurityStatusField_IsSupportRoundLotSell_set)
+    IsSupportOddLotBuy = property(_xmdapi.CTORATstpSecurityStatusField_IsSupportOddLotBuy_get, _xmdapi.CTORATstpSecurityStatusField_IsSupportOddLotBuy_set)
+    IsSupportOddLotSell = property(_xmdapi.CTORATstpSecurityStatusField_IsSupportOddLotSell_get, _xmdapi.CTORATstpSecurityStatusField_IsSupportOddLotSell_set)
+    IsSupportExercise = property(_xmdapi.CTORATstpSecurityStatusField_IsSupportExercise_get, _xmdapi.CTORATstpSecurityStatusField_IsSupportExercise_set)
+    IsLimitBuy = property(_xmdapi.CTORATstpSecurityStatusField_IsLimitBuy_get, _xmdapi.CTORATstpSecurityStatusField_IsLimitBuy_set)
+    IsLimitSell = property(_xmdapi.CTORATstpSecurityStatusField_IsLimitSell_get, _xmdapi.CTORATstpSecurityStatusField_IsLimitSell_set)
+    IsLimitCover = property(_xmdapi.CTORATstpSecurityStatusField_IsLimitCover_get, _xmdapi.CTORATstpSecurityStatusField_IsLimitCover_set)
+    IsLimitMarketMaker = property(_xmdapi.CTORATstpSecurityStatusField_IsLimitMarketMaker_get, _xmdapi.CTORATstpSecurityStatusField_IsLimitMarketMaker_set)
+
+    def __init__(self):
+        _xmdapi.CTORATstpSecurityStatusField_swiginit(self, _xmdapi.new_CTORATstpSecurityStatusField())
+    __swig_destroy__ = _xmdapi.delete_CTORATstpSecurityStatusField
+
+# Register CTORATstpSecurityStatusField in _xmdapi:
+_xmdapi.CTORATstpSecurityStatusField_swigregister(CTORATstpSecurityStatusField)
+
+class CTORATstpMarketStatusField(object):
+    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
+    __repr__ = _swig_repr
+    MarketID = property(_xmdapi.CTORATstpMarketStatusField_MarketID_get, _xmdapi.CTORATstpMarketStatusField_MarketID_set)
+    MarketStatus = property(_xmdapi.CTORATstpMarketStatusField_MarketStatus_get, _xmdapi.CTORATstpMarketStatusField_MarketStatus_set)
+
+    def __init__(self):
+        _xmdapi.CTORATstpMarketStatusField_swiginit(self, _xmdapi.new_CTORATstpMarketStatusField())
+    __swig_destroy__ = _xmdapi.delete_CTORATstpMarketStatusField
+
+# Register CTORATstpMarketStatusField in _xmdapi:
+_xmdapi.CTORATstpMarketStatusField_swigregister(CTORATstpMarketStatusField)
+
+class CTORATstpImcParamsField(object):
+    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
+    __repr__ = _swig_repr
+    MarketID = property(_xmdapi.CTORATstpImcParamsField_MarketID_get, _xmdapi.CTORATstpImcParamsField_MarketID_set)
+    OpenFlag = property(_xmdapi.CTORATstpImcParamsField_OpenFlag_get, _xmdapi.CTORATstpImcParamsField_OpenFlag_set)
+    ThresholdAmount = property(_xmdapi.CTORATstpImcParamsField_ThresholdAmount_get, _xmdapi.CTORATstpImcParamsField_ThresholdAmount_set)
+    PosAmt = property(_xmdapi.CTORATstpImcParamsField_PosAmt_get, _xmdapi.CTORATstpImcParamsField_PosAmt_set)
+    AmountStatus = property(_xmdapi.CTORATstpImcParamsField_AmountStatus_get, _xmdapi.CTORATstpImcParamsField_AmountStatus_set)
+
+    def __init__(self):
+        _xmdapi.CTORATstpImcParamsField_swiginit(self, _xmdapi.new_CTORATstpImcParamsField())
+    __swig_destroy__ = _xmdapi.delete_CTORATstpImcParamsField
+
+# Register CTORATstpImcParamsField in _xmdapi:
+_xmdapi.CTORATstpImcParamsField_swigregister(CTORATstpImcParamsField)
+
+class CTORATstpRapidMarketDataField(object):
+    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
+    __repr__ = _swig_repr
+    SecurityID = property(_xmdapi.CTORATstpRapidMarketDataField_SecurityID_get, _xmdapi.CTORATstpRapidMarketDataField_SecurityID_set)
+    ExchangeID = property(_xmdapi.CTORATstpRapidMarketDataField_ExchangeID_get, _xmdapi.CTORATstpRapidMarketDataField_ExchangeID_set)
+    DataTimeStamp = property(_xmdapi.CTORATstpRapidMarketDataField_DataTimeStamp_get, _xmdapi.CTORATstpRapidMarketDataField_DataTimeStamp_set)
+    PreClosePrice = property(_xmdapi.CTORATstpRapidMarketDataField_PreClosePrice_get, _xmdapi.CTORATstpRapidMarketDataField_PreClosePrice_set)
+    OpenPrice = property(_xmdapi.CTORATstpRapidMarketDataField_OpenPrice_get, _xmdapi.CTORATstpRapidMarketDataField_OpenPrice_set)
+    NumTrades = property(_xmdapi.CTORATstpRapidMarketDataField_NumTrades_get, _xmdapi.CTORATstpRapidMarketDataField_NumTrades_set)
+    TotalVolumeTrade = property(_xmdapi.CTORATstpRapidMarketDataField_TotalVolumeTrade_get, _xmdapi.CTORATstpRapidMarketDataField_TotalVolumeTrade_set)
+    TotalValueTrade = property(_xmdapi.CTORATstpRapidMarketDataField_TotalValueTrade_get, _xmdapi.CTORATstpRapidMarketDataField_TotalValueTrade_set)
+    HighestPrice = property(_xmdapi.CTORATstpRapidMarketDataField_HighestPrice_get, _xmdapi.CTORATstpRapidMarketDataField_HighestPrice_set)
+    LowestPrice = property(_xmdapi.CTORATstpRapidMarketDataField_LowestPrice_get, _xmdapi.CTORATstpRapidMarketDataField_LowestPrice_set)
+    LastPrice = property(_xmdapi.CTORATstpRapidMarketDataField_LastPrice_get, _xmdapi.CTORATstpRapidMarketDataField_LastPrice_set)
+    BidPrice1 = property(_xmdapi.CTORATstpRapidMarketDataField_BidPrice1_get, _xmdapi.CTORATstpRapidMarketDataField_BidPrice1_set)
+    BidVolume1 = property(_xmdapi.CTORATstpRapidMarketDataField_BidVolume1_get, _xmdapi.CTORATstpRapidMarketDataField_BidVolume1_set)
+    AskPrice1 = property(_xmdapi.CTORATstpRapidMarketDataField_AskPrice1_get, _xmdapi.CTORATstpRapidMarketDataField_AskPrice1_set)
+    AskVolume1 = property(_xmdapi.CTORATstpRapidMarketDataField_AskVolume1_get, _xmdapi.CTORATstpRapidMarketDataField_AskVolume1_set)
+    AskPrice2 = property(_xmdapi.CTORATstpRapidMarketDataField_AskPrice2_get, _xmdapi.CTORATstpRapidMarketDataField_AskPrice2_set)
+    AskVolume2 = property(_xmdapi.CTORATstpRapidMarketDataField_AskVolume2_get, _xmdapi.CTORATstpRapidMarketDataField_AskVolume2_set)
+    AskPrice3 = property(_xmdapi.CTORATstpRapidMarketDataField_AskPrice3_get, _xmdapi.CTORATstpRapidMarketDataField_AskPrice3_set)
+    AskVolume3 = property(_xmdapi.CTORATstpRapidMarketDataField_AskVolume3_get, _xmdapi.CTORATstpRapidMarketDataField_AskVolume3_set)
+    BidPrice2 = property(_xmdapi.CTORATstpRapidMarketDataField_BidPrice2_get, _xmdapi.CTORATstpRapidMarketDataField_BidPrice2_set)
+    BidVolume2 = property(_xmdapi.CTORATstpRapidMarketDataField_BidVolume2_get, _xmdapi.CTORATstpRapidMarketDataField_BidVolume2_set)
+    BidPrice3 = property(_xmdapi.CTORATstpRapidMarketDataField_BidPrice3_get, _xmdapi.CTORATstpRapidMarketDataField_BidPrice3_set)
+    BidVolume3 = property(_xmdapi.CTORATstpRapidMarketDataField_BidVolume3_get, _xmdapi.CTORATstpRapidMarketDataField_BidVolume3_set)
+    AskPrice4 = property(_xmdapi.CTORATstpRapidMarketDataField_AskPrice4_get, _xmdapi.CTORATstpRapidMarketDataField_AskPrice4_set)
+    AskVolume4 = property(_xmdapi.CTORATstpRapidMarketDataField_AskVolume4_get, _xmdapi.CTORATstpRapidMarketDataField_AskVolume4_set)
+    AskPrice5 = property(_xmdapi.CTORATstpRapidMarketDataField_AskPrice5_get, _xmdapi.CTORATstpRapidMarketDataField_AskPrice5_set)
+    AskVolume5 = property(_xmdapi.CTORATstpRapidMarketDataField_AskVolume5_get, _xmdapi.CTORATstpRapidMarketDataField_AskVolume5_set)
+    BidPrice4 = property(_xmdapi.CTORATstpRapidMarketDataField_BidPrice4_get, _xmdapi.CTORATstpRapidMarketDataField_BidPrice4_set)
+    BidVolume4 = property(_xmdapi.CTORATstpRapidMarketDataField_BidVolume4_get, _xmdapi.CTORATstpRapidMarketDataField_BidVolume4_set)
+    BidPrice5 = property(_xmdapi.CTORATstpRapidMarketDataField_BidPrice5_get, _xmdapi.CTORATstpRapidMarketDataField_BidPrice5_set)
+    BidVolume5 = property(_xmdapi.CTORATstpRapidMarketDataField_BidVolume5_get, _xmdapi.CTORATstpRapidMarketDataField_BidVolume5_set)
+    AskPrice6 = property(_xmdapi.CTORATstpRapidMarketDataField_AskPrice6_get, _xmdapi.CTORATstpRapidMarketDataField_AskPrice6_set)
+    AskVolume6 = property(_xmdapi.CTORATstpRapidMarketDataField_AskVolume6_get, _xmdapi.CTORATstpRapidMarketDataField_AskVolume6_set)
+    AskPrice7 = property(_xmdapi.CTORATstpRapidMarketDataField_AskPrice7_get, _xmdapi.CTORATstpRapidMarketDataField_AskPrice7_set)
+    AskVolume7 = property(_xmdapi.CTORATstpRapidMarketDataField_AskVolume7_get, _xmdapi.CTORATstpRapidMarketDataField_AskVolume7_set)
+    BidPrice6 = property(_xmdapi.CTORATstpRapidMarketDataField_BidPrice6_get, _xmdapi.CTORATstpRapidMarketDataField_BidPrice6_set)
+    BidVolume6 = property(_xmdapi.CTORATstpRapidMarketDataField_BidVolume6_get, _xmdapi.CTORATstpRapidMarketDataField_BidVolume6_set)
+    BidPrice7 = property(_xmdapi.CTORATstpRapidMarketDataField_BidPrice7_get, _xmdapi.CTORATstpRapidMarketDataField_BidPrice7_set)
+    BidVolume7 = property(_xmdapi.CTORATstpRapidMarketDataField_BidVolume7_get, _xmdapi.CTORATstpRapidMarketDataField_BidVolume7_set)
+    AskPrice8 = property(_xmdapi.CTORATstpRapidMarketDataField_AskPrice8_get, _xmdapi.CTORATstpRapidMarketDataField_AskPrice8_set)
+    AskVolume8 = property(_xmdapi.CTORATstpRapidMarketDataField_AskVolume8_get, _xmdapi.CTORATstpRapidMarketDataField_AskVolume8_set)
+    AskPrice9 = property(_xmdapi.CTORATstpRapidMarketDataField_AskPrice9_get, _xmdapi.CTORATstpRapidMarketDataField_AskPrice9_set)
+    AskVolume9 = property(_xmdapi.CTORATstpRapidMarketDataField_AskVolume9_get, _xmdapi.CTORATstpRapidMarketDataField_AskVolume9_set)
+    BidPrice8 = property(_xmdapi.CTORATstpRapidMarketDataField_BidPrice8_get, _xmdapi.CTORATstpRapidMarketDataField_BidPrice8_set)
+    BidVolume8 = property(_xmdapi.CTORATstpRapidMarketDataField_BidVolume8_get, _xmdapi.CTORATstpRapidMarketDataField_BidVolume8_set)
+    BidPrice9 = property(_xmdapi.CTORATstpRapidMarketDataField_BidPrice9_get, _xmdapi.CTORATstpRapidMarketDataField_BidPrice9_set)
+    BidVolume9 = property(_xmdapi.CTORATstpRapidMarketDataField_BidVolume9_get, _xmdapi.CTORATstpRapidMarketDataField_BidVolume9_set)
+    BidPrice10 = property(_xmdapi.CTORATstpRapidMarketDataField_BidPrice10_get, _xmdapi.CTORATstpRapidMarketDataField_BidPrice10_set)
+    BidVolume10 = property(_xmdapi.CTORATstpRapidMarketDataField_BidVolume10_get, _xmdapi.CTORATstpRapidMarketDataField_BidVolume10_set)
+    AskPrice10 = property(_xmdapi.CTORATstpRapidMarketDataField_AskPrice10_get, _xmdapi.CTORATstpRapidMarketDataField_AskPrice10_set)
+    AskVolume10 = property(_xmdapi.CTORATstpRapidMarketDataField_AskVolume10_get, _xmdapi.CTORATstpRapidMarketDataField_AskVolume10_set)
+    UpperLimitPrice = property(_xmdapi.CTORATstpRapidMarketDataField_UpperLimitPrice_get, _xmdapi.CTORATstpRapidMarketDataField_UpperLimitPrice_set)
+    LowerLimitPrice = property(_xmdapi.CTORATstpRapidMarketDataField_LowerLimitPrice_get, _xmdapi.CTORATstpRapidMarketDataField_LowerLimitPrice_set)
+    ClosePrice = property(_xmdapi.CTORATstpRapidMarketDataField_ClosePrice_get, _xmdapi.CTORATstpRapidMarketDataField_ClosePrice_set)
+    MDSecurityStat = property(_xmdapi.CTORATstpRapidMarketDataField_MDSecurityStat_get, _xmdapi.CTORATstpRapidMarketDataField_MDSecurityStat_set)
+    IOPV = property(_xmdapi.CTORATstpRapidMarketDataField_IOPV_get, _xmdapi.CTORATstpRapidMarketDataField_IOPV_set)
+    InnerSell = property(_xmdapi.CTORATstpRapidMarketDataField_InnerSell_get, _xmdapi.CTORATstpRapidMarketDataField_InnerSell_set)
+    OuterBuy = property(_xmdapi.CTORATstpRapidMarketDataField_OuterBuy_get, _xmdapi.CTORATstpRapidMarketDataField_OuterBuy_set)
+    BidCount1 = property(_xmdapi.CTORATstpRapidMarketDataField_BidCount1_get, _xmdapi.CTORATstpRapidMarketDataField_BidCount1_set)
+    AskCount1 = property(_xmdapi.CTORATstpRapidMarketDataField_AskCount1_get, _xmdapi.CTORATstpRapidMarketDataField_AskCount1_set)
+    AskCount2 = property(_xmdapi.CTORATstpRapidMarketDataField_AskCount2_get, _xmdapi.CTORATstpRapidMarketDataField_AskCount2_set)
+    AskCount3 = property(_xmdapi.CTORATstpRapidMarketDataField_AskCount3_get, _xmdapi.CTORATstpRapidMarketDataField_AskCount3_set)
+    BidCount2 = property(_xmdapi.CTORATstpRapidMarketDataField_BidCount2_get, _xmdapi.CTORATstpRapidMarketDataField_BidCount2_set)
+    BidCount3 = property(_xmdapi.CTORATstpRapidMarketDataField_BidCount3_get, _xmdapi.CTORATstpRapidMarketDataField_BidCount3_set)
+    AskCount4 = property(_xmdapi.CTORATstpRapidMarketDataField_AskCount4_get, _xmdapi.CTORATstpRapidMarketDataField_AskCount4_set)
+    AskCount5 = property(_xmdapi.CTORATstpRapidMarketDataField_AskCount5_get, _xmdapi.CTORATstpRapidMarketDataField_AskCount5_set)
+    BidCount4 = property(_xmdapi.CTORATstpRapidMarketDataField_BidCount4_get, _xmdapi.CTORATstpRapidMarketDataField_BidCount4_set)
+    BidCount5 = property(_xmdapi.CTORATstpRapidMarketDataField_BidCount5_get, _xmdapi.CTORATstpRapidMarketDataField_BidCount5_set)
+    AskCount6 = property(_xmdapi.CTORATstpRapidMarketDataField_AskCount6_get, _xmdapi.CTORATstpRapidMarketDataField_AskCount6_set)
+    AskCount7 = property(_xmdapi.CTORATstpRapidMarketDataField_AskCount7_get, _xmdapi.CTORATstpRapidMarketDataField_AskCount7_set)
+    BidCount6 = property(_xmdapi.CTORATstpRapidMarketDataField_BidCount6_get, _xmdapi.CTORATstpRapidMarketDataField_BidCount6_set)
+    BidCount7 = property(_xmdapi.CTORATstpRapidMarketDataField_BidCount7_get, _xmdapi.CTORATstpRapidMarketDataField_BidCount7_set)
+    AskCount8 = property(_xmdapi.CTORATstpRapidMarketDataField_AskCount8_get, _xmdapi.CTORATstpRapidMarketDataField_AskCount8_set)
+    AskCount9 = property(_xmdapi.CTORATstpRapidMarketDataField_AskCount9_get, _xmdapi.CTORATstpRapidMarketDataField_AskCount9_set)
+    BidCount8 = property(_xmdapi.CTORATstpRapidMarketDataField_BidCount8_get, _xmdapi.CTORATstpRapidMarketDataField_BidCount8_set)
+    BidCount9 = property(_xmdapi.CTORATstpRapidMarketDataField_BidCount9_get, _xmdapi.CTORATstpRapidMarketDataField_BidCount9_set)
+    BidCount10 = property(_xmdapi.CTORATstpRapidMarketDataField_BidCount10_get, _xmdapi.CTORATstpRapidMarketDataField_BidCount10_set)
+    AskCount10 = property(_xmdapi.CTORATstpRapidMarketDataField_AskCount10_get, _xmdapi.CTORATstpRapidMarketDataField_AskCount10_set)
+
+    def __init__(self):
+        _xmdapi.CTORATstpRapidMarketDataField_swiginit(self, _xmdapi.new_CTORATstpRapidMarketDataField())
+    __swig_destroy__ = _xmdapi.delete_CTORATstpRapidMarketDataField
+
+# Register CTORATstpRapidMarketDataField in _xmdapi:
+_xmdapi.CTORATstpRapidMarketDataField_swigregister(CTORATstpRapidMarketDataField)
+
+class CTORATstpFensUserInfoField(object):
+    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
+    __repr__ = _swig_repr
+    FensVer = property(_xmdapi.CTORATstpFensUserInfoField_FensVer_get, _xmdapi.CTORATstpFensUserInfoField_FensVer_set)
+    FensEnvID = property(_xmdapi.CTORATstpFensUserInfoField_FensEnvID_get, _xmdapi.CTORATstpFensUserInfoField_FensEnvID_set)
+    FensNodeID = property(_xmdapi.CTORATstpFensUserInfoField_FensNodeID_get, _xmdapi.CTORATstpFensUserInfoField_FensNodeID_set)
+    FensUserID = property(_xmdapi.CTORATstpFensUserInfoField_FensUserID_get, _xmdapi.CTORATstpFensUserInfoField_FensUserID_set)
+    UserID = property(_xmdapi.CTORATstpFensUserInfoField_UserID_get, _xmdapi.CTORATstpFensUserInfoField_UserID_set)
+    ClientInfo = property(_xmdapi.CTORATstpFensUserInfoField_ClientInfo_get, _xmdapi.CTORATstpFensUserInfoField_ClientInfo_set)
+
+    def __init__(self):
+        _xmdapi.CTORATstpFensUserInfoField_swiginit(self, _xmdapi.new_CTORATstpFensUserInfoField())
+    __swig_destroy__ = _xmdapi.delete_CTORATstpFensUserInfoField
+
+# Register CTORATstpFensUserInfoField in _xmdapi:
+_xmdapi.CTORATstpFensUserInfoField_swigregister(CTORATstpFensUserInfoField)
+
+class CTORATstpConnectionInfoField(object):
+    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
+    __repr__ = _swig_repr
+    InnerIPAddress = property(_xmdapi.CTORATstpConnectionInfoField_InnerIPAddress_get, _xmdapi.CTORATstpConnectionInfoField_InnerIPAddress_set)
+    InnerPort = property(_xmdapi.CTORATstpConnectionInfoField_InnerPort_get, _xmdapi.CTORATstpConnectionInfoField_InnerPort_set)
+    OuterIPAddress = property(_xmdapi.CTORATstpConnectionInfoField_OuterIPAddress_get, _xmdapi.CTORATstpConnectionInfoField_OuterIPAddress_set)
+    OuterPort = property(_xmdapi.CTORATstpConnectionInfoField_OuterPort_get, _xmdapi.CTORATstpConnectionInfoField_OuterPort_set)
+    MacAddress = property(_xmdapi.CTORATstpConnectionInfoField_MacAddress_get, _xmdapi.CTORATstpConnectionInfoField_MacAddress_set)
+
+    def __init__(self):
+        _xmdapi.CTORATstpConnectionInfoField_swiginit(self, _xmdapi.new_CTORATstpConnectionInfoField())
+    __swig_destroy__ = _xmdapi.delete_CTORATstpConnectionInfoField
+
+# Register CTORATstpConnectionInfoField in _xmdapi:
+_xmdapi.CTORATstpConnectionInfoField_swigregister(CTORATstpConnectionInfoField)
+
+class CTORATstpXMdSpi(object):
+    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
+    __repr__ = _swig_repr
+
+    def OnFrontConnected(self):
+        return _xmdapi.CTORATstpXMdSpi_OnFrontConnected(self)
+
+    def OnFrontDisconnected(self, nReason):
+        return _xmdapi.CTORATstpXMdSpi_OnFrontDisconnected(self, nReason)
+
+    def OnRspGetConnectionInfo(self, pConnectionInfoField, pRspInfoField, nRequestID):
+        return _xmdapi.CTORATstpXMdSpi_OnRspGetConnectionInfo(self, pConnectionInfoField, pRspInfoField, nRequestID)
+
+    def OnRspUserLogin(self, pRspUserLoginField, pRspInfoField, nRequestID):
+        return _xmdapi.CTORATstpXMdSpi_OnRspUserLogin(self, pRspUserLoginField, pRspInfoField, nRequestID)
+
+    def OnRspUserLogout(self, pUserLogoutField, pRspInfoField, nRequestID):
+        return _xmdapi.CTORATstpXMdSpi_OnRspUserLogout(self, pUserLogoutField, pRspInfoField, nRequestID)
+
+    def OnRspSubMarketData(self, pSpecificSecurityField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspSubMarketData(self, pSpecificSecurityField, pRspInfoField)
+
+    def OnRspUnSubMarketData(self, pSpecificSecurityField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspUnSubMarketData(self, pSpecificSecurityField, pRspInfoField)
+
+    def OnRspSubPHMarketData(self, pSpecificSecurityField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspSubPHMarketData(self, pSpecificSecurityField, pRspInfoField)
+
+    def OnRspUnSubPHMarketData(self, pSpecificSecurityField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspUnSubPHMarketData(self, pSpecificSecurityField, pRspInfoField)
+
+    def OnRspSubSpecialMarketData(self, pSpecificSecurityField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspSubSpecialMarketData(self, pSpecificSecurityField, pRspInfoField)
+
+    def OnRspUnSubSpecialMarketData(self, pSpecificSecurityField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspUnSubSpecialMarketData(self, pSpecificSecurityField, pRspInfoField)
+
+    def OnRspSubSimplifyMarketData(self, pSpecificSecurityField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspSubSimplifyMarketData(self, pSpecificSecurityField, pRspInfoField)
+
+    def OnRspUnSubSimplifyMarketData(self, pSpecificSecurityField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspUnSubSimplifyMarketData(self, pSpecificSecurityField, pRspInfoField)
+
+    def OnRspSubSecurityStatus(self, pSpecificSecurityField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspSubSecurityStatus(self, pSpecificSecurityField, pRspInfoField)
+
+    def OnRspUnSubSecurityStatus(self, pSpecificSecurityField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspUnSubSecurityStatus(self, pSpecificSecurityField, pRspInfoField)
+
+    def OnRspSubMarketStatus(self, pSpecificMarketField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspSubMarketStatus(self, pSpecificMarketField, pRspInfoField)
+
+    def OnRspUnSubMarketStatus(self, pSpecificMarketField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspUnSubMarketStatus(self, pSpecificMarketField, pRspInfoField)
+
+    def OnRspSubImcParams(self, pSpecificMarketField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspSubImcParams(self, pSpecificMarketField, pRspInfoField)
+
+    def OnRspUnSubImcParams(self, pSpecificMarketField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspUnSubImcParams(self, pSpecificMarketField, pRspInfoField)
+
+    def OnRspInquiryMarketDataMirror(self, pMarketDataField, pRspInfoField, nRequestID, bIsLast):
+        return _xmdapi.CTORATstpXMdSpi_OnRspInquiryMarketDataMirror(self, pMarketDataField, pRspInfoField, nRequestID, bIsLast)
+
+    def OnRspInquiryPHMarketDataMirror(self, pPHMarketDataField, pRspInfoField, nRequestID, bIsLast):
+        return _xmdapi.CTORATstpXMdSpi_OnRspInquiryPHMarketDataMirror(self, pPHMarketDataField, pRspInfoField, nRequestID, bIsLast)
+
+    def OnRspInquirySpecialMarketDataMirror(self, pMarketDataField, pRspInfoField, nRequestID, bIsLast):
+        return _xmdapi.CTORATstpXMdSpi_OnRspInquirySpecialMarketDataMirror(self, pMarketDataField, pRspInfoField, nRequestID, bIsLast)
+
+    def OnRspSubSPMarketData(self, pSpecificSecurityField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspSubSPMarketData(self, pSpecificSecurityField, pRspInfoField)
+
+    def OnRspUnSubSPMarketData(self, pSpecificSecurityField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspUnSubSPMarketData(self, pSpecificSecurityField, pRspInfoField)
+
+    def OnRspSubSPSimplifyMarketData(self, pSpecificSecurityField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspSubSPSimplifyMarketData(self, pSpecificSecurityField, pRspInfoField)
+
+    def OnRspUnSubSPSimplifyMarketData(self, pSpecificSecurityField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspUnSubSPSimplifyMarketData(self, pSpecificSecurityField, pRspInfoField)
+
+    def OnRspSubSPSecurityStatus(self, pSpecificSecurityField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspSubSPSecurityStatus(self, pSpecificSecurityField, pRspInfoField)
+
+    def OnRspUnSubSPSecurityStatus(self, pSpecificSecurityField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspUnSubSPSecurityStatus(self, pSpecificSecurityField, pRspInfoField)
+
+    def OnRspSubSPMarketStatus(self, pSpecificMarketField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspSubSPMarketStatus(self, pSpecificMarketField, pRspInfoField)
+
+    def OnRspUnSubSPMarketStatus(self, pSpecificMarketField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspUnSubSPMarketStatus(self, pSpecificMarketField, pRspInfoField)
+
+    def OnRspInquirySPMarketDataMirror(self, pMarketDataField, pRspInfoField, nRequestID, bIsLast):
+        return _xmdapi.CTORATstpXMdSpi_OnRspInquirySPMarketDataMirror(self, pMarketDataField, pRspInfoField, nRequestID, bIsLast)
+
+    def OnRtnMarketData(self, pMarketDataField):
+        return _xmdapi.CTORATstpXMdSpi_OnRtnMarketData(self, pMarketDataField)
+
+    def OnRtnPHMarketData(self, pPHMarketDataField):
+        return _xmdapi.CTORATstpXMdSpi_OnRtnPHMarketData(self, pPHMarketDataField)
+
+    def OnRtnSpecialMarketData(self, pSpecialMarketDataField):
+        return _xmdapi.CTORATstpXMdSpi_OnRtnSpecialMarketData(self, pSpecialMarketDataField)
+
+    def OnRtnSimplifyMarketData(self, pSimplifyMarketDataField):
+        return _xmdapi.CTORATstpXMdSpi_OnRtnSimplifyMarketData(self, pSimplifyMarketDataField)
+
+    def OnRtnSecurityStatus(self, pSecurityStatusField):
+        return _xmdapi.CTORATstpXMdSpi_OnRtnSecurityStatus(self, pSecurityStatusField)
+
+    def OnRtnMarketStatus(self, pMarketStatusField):
+        return _xmdapi.CTORATstpXMdSpi_OnRtnMarketStatus(self, pMarketStatusField)
+
+    def OnRtnImcParams(self, pImcParamsField):
+        return _xmdapi.CTORATstpXMdSpi_OnRtnImcParams(self, pImcParamsField)
+
+    def OnRtnSPMarketData(self, pMarketDataField):
+        return _xmdapi.CTORATstpXMdSpi_OnRtnSPMarketData(self, pMarketDataField)
+
+    def OnRtnSPSimplifyMarketData(self, pSimplifyMarketDataField):
+        return _xmdapi.CTORATstpXMdSpi_OnRtnSPSimplifyMarketData(self, pSimplifyMarketDataField)
+
+    def OnRtnSPSecurityStatus(self, pSecurityStatusField):
+        return _xmdapi.CTORATstpXMdSpi_OnRtnSPSecurityStatus(self, pSecurityStatusField)
+
+    def OnRtnSPMarketStatus(self, pMarketStatusField):
+        return _xmdapi.CTORATstpXMdSpi_OnRtnSPMarketStatus(self, pMarketStatusField)
+
+    def OnRspSubRapidMarketData(self, pSpecificSecurityField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspSubRapidMarketData(self, pSpecificSecurityField, pRspInfoField)
+
+    def OnRspUnSubRapidMarketData(self, pSpecificSecurityField, pRspInfoField):
+        return _xmdapi.CTORATstpXMdSpi_OnRspUnSubRapidMarketData(self, pSpecificSecurityField, pRspInfoField)
+
+    def OnRtnRapidMarketData(self, pRapidMarketDataField):
+        return _xmdapi.CTORATstpXMdSpi_OnRtnRapidMarketData(self, pRapidMarketDataField)
+
+    def __init__(self):
+        if self.__class__ == CTORATstpXMdSpi:
+            _self = None
+        else:
+            _self = self
+        _xmdapi.CTORATstpXMdSpi_swiginit(self, _xmdapi.new_CTORATstpXMdSpi(_self, ))
+    __swig_destroy__ = _xmdapi.delete_CTORATstpXMdSpi
+    def __disown__(self):
+        self.this.disown()
+        _xmdapi.disown_CTORATstpXMdSpi(self)
+        return weakref.proxy(self)
+
+# Register CTORATstpXMdSpi in _xmdapi:
+_xmdapi.CTORATstpXMdSpi_swigregister(CTORATstpXMdSpi)
+
+class CTORATstpXMdApi(object):
+    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
+
+    def __init__(self, *args, **kwargs):
+        raise AttributeError("No constructor defined - class is abstract")
+    __repr__ = _swig_repr
+
+    @staticmethod
+    def CreateTstpXMdApi(*args):
+        return _xmdapi.CTORATstpXMdApi_CreateTstpXMdApi(*args)
+
+    @staticmethod
+    def GetApiVersion():
+        return _xmdapi.CTORATstpXMdApi_GetApiVersion()
+
+    def Release(self):
+        return _xmdapi.CTORATstpXMdApi_Release(self)
+
+    def Init(self, *args):
+        return _xmdapi.CTORATstpXMdApi_Init(self, *args)
+
+    def Join(self):
+        return _xmdapi.CTORATstpXMdApi_Join(self)
+
+    def RegisterFront(self, pszFrontAddress):
+        return _xmdapi.CTORATstpXMdApi_RegisterFront(self, pszFrontAddress)
+
+    def RegisterNameServer(self, pszNsAddress):
+        return _xmdapi.CTORATstpXMdApi_RegisterNameServer(self, pszNsAddress)
+
+    def RegisterFensUserInfo(self, pFensUserInfoField):
+        return _xmdapi.CTORATstpXMdApi_RegisterFensUserInfo(self, pFensUserInfoField)
+
+    def RegisterMulticast(self, pszMulticastAddress, pszInterfaceIP, pszSourceIp):
+        return _xmdapi.CTORATstpXMdApi_RegisterMulticast(self, pszMulticastAddress, pszInterfaceIP, pszSourceIp)
+
+    def RegisterDeriveServer(self, pszDeriveAddress):
+        return _xmdapi.CTORATstpXMdApi_RegisterDeriveServer(self, pszDeriveAddress)
+
+    def RegisterDeriveMulticast(self, pszMulticastAddress, pszInterfaceIP, pszSourceIp):
+        return _xmdapi.CTORATstpXMdApi_RegisterDeriveMulticast(self, pszMulticastAddress, pszInterfaceIP, pszSourceIp)
+
+    def RegisterSpi(self, pSpi):
+        return _xmdapi.CTORATstpXMdApi_RegisterSpi(self, pSpi)
+
+    def ReqGetConnectionInfo(self, nRequestID):
+        return _xmdapi.CTORATstpXMdApi_ReqGetConnectionInfo(self, nRequestID)
+
+    def ReqUserLogin(self, pReqUserLoginField, nRequestID):
+        return _xmdapi.CTORATstpXMdApi_ReqUserLogin(self, pReqUserLoginField, nRequestID)
+
+    def ReqUserLogout(self, pUserLogoutField, nRequestID):
+        return _xmdapi.CTORATstpXMdApi_ReqUserLogout(self, pUserLogoutField, nRequestID)
+
+    def SubscribeMarketData(self, ppSecurityID, ExchangeID):
+        return _xmdapi.CTORATstpXMdApi_SubscribeMarketData(self, ppSecurityID, ExchangeID)
+
+    def UnSubscribeMarketData(self, ppSecurityID, ExchangeID):
+        return _xmdapi.CTORATstpXMdApi_UnSubscribeMarketData(self, ppSecurityID, ExchangeID)
+
+    def SubscribePHMarketData(self, ppSecurityID, ExchangeID):
+        return _xmdapi.CTORATstpXMdApi_SubscribePHMarketData(self, ppSecurityID, ExchangeID)
+
+    def UnSubscribePHMarketData(self, ppSecurityID, ExchangeID):
+        return _xmdapi.CTORATstpXMdApi_UnSubscribePHMarketData(self, ppSecurityID, ExchangeID)
+
+    def SubscribeSpecialMarketData(self, ppSecurityID, ExchangeID):
+        return _xmdapi.CTORATstpXMdApi_SubscribeSpecialMarketData(self, ppSecurityID, ExchangeID)
+
+    def UnSubscribeSpecialMarketData(self, ppSecurityID, ExchangeID):
+        return _xmdapi.CTORATstpXMdApi_UnSubscribeSpecialMarketData(self, ppSecurityID, ExchangeID)
+
+    def SubscribeSimplifyMarketData(self, ppSecurityID, ExchangeID):
+        return _xmdapi.CTORATstpXMdApi_SubscribeSimplifyMarketData(self, ppSecurityID, ExchangeID)
+
+    def UnSubscribeSimplifyMarketData(self, ppSecurityID, ExchangeID):
+        return _xmdapi.CTORATstpXMdApi_UnSubscribeSimplifyMarketData(self, ppSecurityID, ExchangeID)
+
+    def SubscribeSecurityStatus(self, ppSecurityID, ExchangeID):
+        return _xmdapi.CTORATstpXMdApi_SubscribeSecurityStatus(self, ppSecurityID, ExchangeID)
+
+    def UnSubscribeSecurityStatus(self, ppSecurityID, ExchangeID):
+        return _xmdapi.CTORATstpXMdApi_UnSubscribeSecurityStatus(self, ppSecurityID, ExchangeID)
+
+    def SubscribeMarketStatus(self, MarketID):
+        return _xmdapi.CTORATstpXMdApi_SubscribeMarketStatus(self, MarketID)
+
+    def UnSubscribeMarketStatus(self, MarketID):
+        return _xmdapi.CTORATstpXMdApi_UnSubscribeMarketStatus(self, MarketID)
+
+    def SubscribeImcParams(self, MarketID):
+        return _xmdapi.CTORATstpXMdApi_SubscribeImcParams(self, MarketID)
+
+    def UnSubscribeImcParams(self, MarketID):
+        return _xmdapi.CTORATstpXMdApi_UnSubscribeImcParams(self, MarketID)
+
+    def ReqInquiryMarketDataMirror(self, pInquiryMarketDataField, nRequestID):
+        return _xmdapi.CTORATstpXMdApi_ReqInquiryMarketDataMirror(self, pInquiryMarketDataField, nRequestID)
+
+    def ReqInquiryPHMarketDataMirror(self, pInquiryMarketDataField, nRequestID):
+        return _xmdapi.CTORATstpXMdApi_ReqInquiryPHMarketDataMirror(self, pInquiryMarketDataField, nRequestID)
+
+    def ReqInquirySpecialMarketDataMirror(self, pInquirySpecialMarketDataField, nRequestID):
+        return _xmdapi.CTORATstpXMdApi_ReqInquirySpecialMarketDataMirror(self, pInquirySpecialMarketDataField, nRequestID)
+
+    def SubscribeSPMarketData(self, ppSecurityID, ExchangeID):
+        return _xmdapi.CTORATstpXMdApi_SubscribeSPMarketData(self, ppSecurityID, ExchangeID)
+
+    def UnSubscribeSPMarketData(self, ppSecurityID, ExchangeID):
+        return _xmdapi.CTORATstpXMdApi_UnSubscribeSPMarketData(self, ppSecurityID, ExchangeID)
+
+    def SubscribeSPSimplifyMarketData(self, ppSecurityID, ExchangeID):
+        return _xmdapi.CTORATstpXMdApi_SubscribeSPSimplifyMarketData(self, ppSecurityID, ExchangeID)
+
+    def UnSubscribeSPSimplifyMarketData(self, ppSecurityID, ExchangeID):
+        return _xmdapi.CTORATstpXMdApi_UnSubscribeSPSimplifyMarketData(self, ppSecurityID, ExchangeID)
+
+    def SubscribeSPSecurityStatus(self, ppSecurityID, ExchangeID):
+        return _xmdapi.CTORATstpXMdApi_SubscribeSPSecurityStatus(self, ppSecurityID, ExchangeID)
+
+    def UnSubscribeSPSecurityStatus(self, ppSecurityID, ExchangeID):
+        return _xmdapi.CTORATstpXMdApi_UnSubscribeSPSecurityStatus(self, ppSecurityID, ExchangeID)
+
+    def SubscribeSPMarketStatus(self, MarketID):
+        return _xmdapi.CTORATstpXMdApi_SubscribeSPMarketStatus(self, MarketID)
+
+    def UnSubscribeSPMarketStatus(self, MarketID):
+        return _xmdapi.CTORATstpXMdApi_UnSubscribeSPMarketStatus(self, MarketID)
+
+    def ReqInquirySPMarketDataMirror(self, pInquiryMarketDataField, nRequestID):
+        return _xmdapi.CTORATstpXMdApi_ReqInquirySPMarketDataMirror(self, pInquiryMarketDataField, nRequestID)
+
+    def SubscribeRapidMarketData(self, ppSecurityID, ExchangeID):
+        return _xmdapi.CTORATstpXMdApi_SubscribeRapidMarketData(self, ppSecurityID, ExchangeID)
+
+    def UnSubscribeRapidMarketData(self, ppSecurityID, ExchangeID):
+        return _xmdapi.CTORATstpXMdApi_UnSubscribeRapidMarketData(self, ppSecurityID, ExchangeID)
+
+# Register CTORATstpXMdApi in _xmdapi:
+_xmdapi.CTORATstpXMdApi_swigregister(CTORATstpXMdApi)
+
+def CTORATstpXMdApi_CreateTstpXMdApi(*args):
+    return _xmdapi.CTORATstpXMdApi_CreateTstpXMdApi(*args)
+
+def CTORATstpXMdApi_GetApiVersion():
+    return _xmdapi.CTORATstpXMdApi_GetApiVersion()
+
+
+

--
Gitblit v1.8.0