# Path: dHydra/core/Functions.py
# def get_vendor(name, vendor_name=None, **kwargs):
#     """
#     get_vendor方法，动态加载vendor类
#     """
#     logger = logging.getLogger('Functions')
#     if vendor_name is None:
#         vendor_name = "V-" + name
#     class_name = name
#     module_name = 'Vendor.' + name + '.' + class_name
#     if os.path.exists(
#         os.getcwd() + "/Vendor/" +
#         name + "/" + class_name + ".py"
#     ):
#         try:
#             instance = getattr(
#                 __import__(module_name, globals(), locals(), [class_name], 0),
#                 class_name
#             )(**kwargs)
#         except ImportError:
#             traceback.print_exc()
#     else:
#         try:
#             instance = getattr(
#                 __import__(
#                     "dHydra." + module_name,
#                     globals(),
#                     locals(),
#                     [class_name],
#                     0
#                 ),
#                 class_name
#             )(**kwargs)
#         except ImportError:
#             traceback.print_exc()
#     return instance
# 
# Path: dHydra/core/Vendor.py
# class Vendor:
# 
#     def __init__(
#         self,
#         log_path="log",                     #
#         console_log=True,                   # 屏幕打印日志开关，默认True
#         console_log_level=logging.INFO,     # 屏幕打印日志的级别，默认为INFO
#         critical_log=False,                 # critica单独l写文件日志，默认关闭
#         error_log=True,                     # error级别单独写文件日志，默认开启
#         warning_log=False,                  # warning级别单独写日志，默认关闭
#         info_log=True,                      # info级别单独写日志，默认开启
#         debug_log=False,                    # debug级别日志，默认关闭
#         **kwargs
#     ):
#         self.logger = util.get_logger(
#             log_path=log_path,                     #
#             console_log=console_log,              # 屏幕打印日志开关，默认True
#             console_log_level=console_log_level,  # 屏幕打印日志的级别，默认为INFO
#             critical_log=critical_log,        # critica单独l写文件日志，默认关闭
#             error_log=error_log,             # error级别单独写文件日志，默认开启
#             warning_log=warning_log,         # warning级别单独写日志，默认关闭
#             info_log=info_log,               # info级别单独写日志，默认开启
#             debug_log=debug_log,             # debug级别日志，默认关闭
#             logger_name=self.__class__.__name__,
#         )


from dHydra.core.Functions import get_vendor
from dHydra.core.Vendor import Vendor
from ctp.futures import ApiStruct
from datetime import datetime
import dHydra.core.util as util
import threading
import os
import pandas
import copy
            args=(accounts,)
        )
        deligent_uncle.setDaemon(True)
        deligent_uncle.start()

    def main(self, accounts):
        # read accounts
        self.accounts = self.init_accounts(accounts=accounts)
        self.logger.info("EasyUncle帐号初始化完成")

    def init_accounts(self, accounts="easyuncle.json"):
        """
        初始化acctouns中配置的所有帐号
        @return dict
        {
            "account_name": {
                "type": "ctp/easytrader/other",
                "trader": "生成的实例对象",
                "timestamp": "对象生成时间",
            }
        }
        """
        result = {}
        if accounts[0] != '/':
            accounts = os.getcwd() + '/' + accounts
        accounts_dict = util.read_config(accounts)
        for account in accounts_dict.keys():
            result[account] = dict()
            result[account]["type"] = accounts_dict[account]["type"]
            if result[account]["type"] == "ctp":

# Path: dHydra/core/Functions.py
# def get_vendor(name, vendor_name=None, **kwargs):
#     """
#     get_vendor方法，动态加载vendor类
#     """
#     logger = logging.getLogger('Functions')
#     if vendor_name is None:
#         vendor_name = "V-" + name
#     class_name = name
#     module_name = 'Vendor.' + name + '.' + class_name
#     if os.path.exists(
#         os.getcwd() + "/Vendor/" +
#         name + "/" + class_name + ".py"
#     ):
#         try:
#             instance = getattr(
#                 __import__(module_name, globals(), locals(), [class_name], 0),
#                 class_name
#             )(**kwargs)
#         except ImportError:
#             traceback.print_exc()
#     else:
#         try:
#             instance = getattr(
#                 __import__(
#                     "dHydra." + module_name,
#                     globals(),
#                     locals(),
#                     [class_name],
#                     0
#                 ),
#                 class_name
#             )(**kwargs)
#         except ImportError:
#             traceback.print_exc()
#     return instance
# 
# Path: dHydra/core/Vendor.py
# class Vendor:
# 
#     def __init__(
#         self,
#         log_path="log",                     #
#         console_log=True,                   # 屏幕打印日志开关，默认True
#         console_log_level=logging.INFO,     # 屏幕打印日志的级别，默认为INFO
#         critical_log=False,                 # critica单独l写文件日志，默认关闭
#         error_log=True,                     # error级别单独写文件日志，默认开启
#         warning_log=False,                  # warning级别单独写日志，默认关闭
#         info_log=True,                      # info级别单独写日志，默认开启
#         debug_log=False,                    # debug级别日志，默认关闭
#         **kwargs
#     ):
#         self.logger = util.get_logger(
#             log_path=log_path,                     #
#             console_log=console_log,              # 屏幕打印日志开关，默认True
#             console_log_level=console_log_level,  # 屏幕打印日志的级别，默认为INFO
#             critical_log=critical_log,        # critica单独l写文件日志，默认关闭
#             error_log=error_log,             # error级别单独写文件日志，默认开启
#             warning_log=warning_log,         # warning级别单独写日志，默认关闭
#             info_log=info_log,               # info级别单独写日志，默认开启
#             debug_log=debug_log,             # debug级别日志，默认关闭
#             logger_name=self.__class__.__name__,
#         )


# Path: dHydra/Vendor/EasyUncle/EasyUncle.py
from dHydra.core.Functions import get_vendor
from dHydra.core.Vendor import Vendor
from ctp.futures import ApiStruct
from datetime import datetime
import dHydra.core.util as util
import threading
import os
import pandas
import copy

            args=(accounts,)
        )
        deligent_uncle.setDaemon(True)
        deligent_uncle.start()

    def main(self, accounts):
        # read accounts
        self.accounts = self.init_accounts(accounts=accounts)
        self.logger.info("EasyUncle帐号初始化完成")

    def init_accounts(self, accounts="easyuncle.json"):
        """
        初始化acctouns中配置的所有帐号
        @return dict
        {
            "account_name": {
                "type": "ctp/easytrader/other",
                "trader": "生成的实例对象",
                "timestamp": "对象生成时间",
            }
        }
        """
        result = {}
        if accounts[0] != '/':
            accounts = os.getcwd() + '/' + accounts
        accounts_dict = util.read_config(accounts)
        for account in accounts_dict.keys():
            result[account] = dict()
            result[account]["type"] = accounts_dict[account]["type"]
            if result[account]["type"] == "ctp":

                result[account]["trader"] = get_vendor(