admin
2023-08-04 ca310f014336d93eba73ed5010c1c5645424a1e0
交易优化
6个文件已修改
8个文件已添加
1490 ■■■■■ 已修改文件
_xmdapi.cp37-win32.pyd 补丁 | 查看 | 原始文档 | blame | 历史
_xmdapi.cp37-win_amd64.pyd 补丁 | 查看 | 原始文档 | blame | 历史
_xmdapi.cpython-37m-x86_64-linux-gnu.so 补丁 | 查看 | 原始文档 | blame | 历史
client_network.py 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
command_manager.py 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
constant.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l1_client.py 218 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2_client.py 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2_data_manager.py 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
test_l1.py 143 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
test_profile.py 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tool.py 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade_client.py 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xmdapi.py 924 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_xmdapi.cp37-win32.pyd
Binary files differ
_xmdapi.cp37-win_amd64.pyd
Binary files differ
_xmdapi.cpython-37m-x86_64-linux-gnu.so
Binary files differ
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,连接server
        client.connect((addr, port))
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]
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
TEST = True
l1_client.py
New file
@@ -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)
            # 读取代码
            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)
            '''
            订阅行情
            当sub_arr中只有一个"00000000"的合约且ExchangeID填TORA_TSTP_EXD_SSE或TORA_TSTP_EXD_SZSE时,订阅单市场所有合约行情
            当sub_arr中只有一个"00000000"的合约且ExchangeID填TORA_TSTP_EXD_COMM时,订阅全市场所有合约行情
            其它情况,订阅sub_arr集合中的合约行情
            '''
            print(f"订阅数量:sh-{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("代码数量:", len(datas),codes)
            __upload_codes_info(datas)
        except Exception as e:
            logging.exception(e)
        finally:
            time.sleep(3)
    # 释放接口对象
    api.Release()
if __name__ == "__main__":
    run()
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())
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):
    # 如果代码没有在目标代码中就不需要运行
@@ -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)
test_l1.py
New file
@@ -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)
            '''
            订阅行情
            当sub_arr中只有一个"00000000"的合约且ExchangeID填TORA_TSTP_EXD_SSE或TORA_TSTP_EXD_SZSE时,订阅单市场所有合约行情
            当sub_arr中只有一个"00000000"的合约且ExchangeID填TORA_TSTP_EXD_COMM时,订阅全市场所有合约行情
            其它情况,订阅sub_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()
test_profile.py
New file
@@ -0,0 +1,5 @@
import pstats
if __name__ == "__main__":
    p = pstats.Stats('D:\\文件传输\\新建文件夹\\000609_1690507874113.log')
    p.print_stats()
tool.py
New file
@@ -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
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"请求下单:client_id-{client_id} request_id-{request_id} data-{data}")
            logger_trade_debug.info(f"---------------------\n请求下单:client_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"请求撤单:client_id-{client_id} request_id-{request_id} data-{data}")
            logger_trade_debug.info(
                f"---------------------\n请求撤单:client_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"请求成交列表:client_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"请求账户:client_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"请求持仓:client_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} 原因:ConnectionResetError")
            SendResponseSkManager.del_send_response_sk(response_client_type)
        except BrokenPipeError:
            logger_trade_debug.error(f"第{i}次发送数据失败:type-{type},request_id-{_request_id} 原因:BrokenPipeError")
            SendResponseSkManager.del_send_response_sk(response_client_type)
        except TimeoutError:
            logger_trade_debug.error(f"第{i}次发送数据失败:type-{type},request_id-{_request_id} 原因:TimeoutError")
            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("非API回调 req_id-{}", req_id)
            print("非API回调")
            # 非API回调
            send_response(
                json.dumps({"type": "trade_callback", "data": {"code": 0, "data": data, "type": type}}).encode('utf-8'),
                type,
                None,
                req_id)
            print("非API结束")
xmdapi.py
New file
@@ -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()