def __loadSetting(self):
        """读取策略配置"""
        with open(self.settingfilePath, 'rb') as f:
            df = f.read()
            f.close()
            if type(df) is not str:
                df = ft.str_utf8(df)
            self._global_settings = json.loads(df)
            if self._global_settings is None or 'frame' not in self._global_settings:
                raise Exception("setting.json - no frame config!'")

            # 设置frame参数
            frame_setting = self._global_settings['frame']
            d = self.__dict__
            for key in d.keys():
                if key in frame_setting.keys():
                    d[key] = frame_setting[key]

            # check paramlist
            # for key in d.keys():
            #     if d[key] is None:
            #         str_error = "setting.json - 'frame' config no key:'%s'" % key
            #         raise Exception(str_error)

            # check _env_type / market
            env_list = [ft.TrdEnv.REAL, ft.TrdEnv.SIMULATE]
            if self._env_type not in env_list:
                str_error = "setting.json - 'frame' config '_env_type' can only is '{}'".format(','.join(env_list))
                raise Exception(str_error)

            market_list = [ft.Market.HK, ft.Market.US]
            if self._market not in market_list:
                str_error = "setting.json - 'frame' config '_market' can only is '{}'".format(','.join(market_list))
                raise Exception(str_error)

        return True
读取策略配置