Ejemplo n.º 1
0
    def initialize(self):

        # 初始化各个sensor

        self.user_context.update("DM", DataManager(name=self.name))

        # 初始化辅助类

        self.user_context.update(
            "alphaFactorDataFrame",
            FactorList(file=self.user_context.alpha_file,
                       factor_style=FACTOR_STYLE.ALPHA))

        self.user_context.update(
            "riskFactorDataFrame",
            FactorList(file=self.user_context.risk_file,
                       factor_style=FACTOR_STYLE.RISK))

        # 初始化各个mod
        init_succeed = super().initialize()

        if init_succeed:
            self._init_estimation_flow()

        return init_succeed
Ejemplo n.º 2
0
    def initialize(self):
        # 初始化各个sensor

        self.user_context.update("DM", DataManager(name=self.name))

        # 初始化辅助类

        self.user_context.update(
            "alphaFactorDataFrame",
            FactorList(file=self.user_context.alpha_file,
                       factor_style=FACTOR_STYLE.ALPHA))

        # 初始化各个mod
        init_succeed = super().initialize()

        if init_succeed:
            self._init_prepare_flow()
            self._init_store_flow()
            self._init_prediction_stock()

            self._prepare_flow.run(date="99991231")

        return init_succeed
    def initialize(self):
        self.user_context.update(
            "alphaFactorDataFrame",
            FactorList(file=self.user_context.alpha_file,
                       factor_style=FACTOR_STYLE.ALPHA))

        self.optim_options = {
            "options": {
                "show_progress": False
            },
            "tc": 0.003,
            "risk_condition": {
                "up": {
                    'style_size_2': 0.0005,
                    'style_beta_2': 0.0005,
                    'industry_商贸零售': 0.03,
                    'industry_石油石化': 0.03,
                    'industry_国防军工': 0.03,
                    'industry_传媒': 0.03,
                    'industry_餐饮旅游': 0.03,
                    'industry_汽车': 0.03,
                    'industry_电力及公用事业': 0.03,
                    'industry_电力设备': 0.03,
                    'industry_综合': 0.03,
                    'industry_计算机': 0.03,
                    'industry_医药': 0.03,
                    'industry_建材': 0.03,
                    'industry_农林牧渔': 0.03,
                    'industry_机械': 0.03,
                    'industry_纺织服装': 0.03,
                    'industry_保险Ⅱ': 0.03,
                    'industry_食品饮料': 0.03,
                    'industry_信托及其他': 0.03,
                    'industry_电子元器件': 0.03,
                    'industry_煤炭': 0.03,
                    'industry_建筑': 0.03,
                    'industry_银行': 0.03,
                    'industry_基础化工': 0.03,
                    'industry_证券Ⅱ': 0.03,
                    'industry_家电': 0.03,
                    'industry_交通运输': 0.03,
                    'industry_钢铁': 0.03,
                    'industry_有色金属': 0.03,
                    'industry_通信': 0.03,
                    'industry_轻工制造': 0.03,
                    'industry_房地产': 0.03
                },
                "down": {
                    'style_size_2': 0.0005,
                    'style_beta_2': 0.0005,
                    'industry_商贸零售': 0.03,
                    'industry_石油石化': 0.03,
                    'industry_国防军工': 0.03,
                    'industry_传媒': 0.03,
                    'industry_餐饮旅游': 0.03,
                    'industry_汽车': 0.03,
                    'industry_电力及公用事业': 0.03,
                    'industry_电力设备': 0.03,
                    'industry_综合': 0.03,
                    'industry_计算机': 0.03,
                    'industry_医药': 0.03,
                    'industry_建材': 0.03,
                    'industry_农林牧渔': 0.03,
                    'industry_机械': 0.03,
                    'industry_纺织服装': 0.03,
                    'industry_保险Ⅱ': 0.03,
                    'industry_食品饮料': 0.03,
                    'industry_信托及其他': 0.03,
                    'industry_电子元器件': 0.03,
                    'industry_煤炭': 0.03,
                    'industry_建筑': 0.03,
                    'industry_银行': 0.03,
                    'industry_基础化工': 0.03,
                    'industry_证券Ⅱ': 0.03,
                    'industry_家电': 0.03,
                    'industry_交通运输': 0.03,
                    'industry_钢铁': 0.03,
                    'industry_有色金属': 0.03,
                    'industry_通信': 0.03,
                    'industry_轻工制造': 0.03,
                    'industry_房地产': 0.03
                }
            }
        }
        self.user_context.update("optim_options", {})

        return super().initialize()