克隆策略

    {"description":"实验创建于2017/8/26","graph":{"edges":[{"to_node_id":"-322:features","from_node_id":"-331:data"},{"to_node_id":"-322:instruments","from_node_id":"-312:data"},{"to_node_id":"-1136:input_data","from_node_id":"-322:data"},{"to_node_id":"-322:user_functions","from_node_id":"-932:functions"},{"to_node_id":"-932:input_functions","from_node_id":"-1111:functions"},{"to_node_id":"-1111:input_functions","from_node_id":"-2016:functions"},{"to_node_id":"-1136:features","from_node_id":"-2149:data"},{"to_node_id":"-2016:input_functions","from_node_id":"-584:functions"}],"nodes":[{"node_id":"-331","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"_c = close\n_o = open\n_v = volume\n# _bmc = bar1m_000905_HIX__close\n# _bmo = bar1m_000905_HIX__open\n_ret = ret_sim(_c, _o)\n_rk1 = _ret.loc[93500:100000]\n_rk2 = _ret.loc[110000:113000]\n_rk3 = _ret.loc[143000:145700]\n# _bm_ret = ret_sim(_bmc, _bmo)\n\n# 收益方差\nRVar = RVar(_ret)\n\n# 收益偏度\nRSkew = RSkew(_ret, RVar)\n\n# # 收益峰度\nRKurt = RKurt(_ret, RVar)\n\n# # 成交量占比\nvolume_ratio_1 = _v.loc[93500:100000].sum() / _v.sum()\nvolume_ratio_2 = _v.loc[100100:103000].sum() / _v.sum()\nvolume_ratio_3 = _v.loc[103100:110000].sum() / _v.sum()\nvolume_ratio_4 = _v.loc[110100:113000].sum() / _v.sum()\nvolume_ratio_5 = _v.loc[143000:145700].sum() / _v.sum()\n\n# 量价相关性\n_Volume = _v\n_Price = _c\n_corr= _Volume.corr(_Price, method='pearson')\ncorr_PV = where(np.isnan(_corr), 0, _corr)\n\n# 资金流入因子\n_diff_close = _c.diff().fillna(0)\n# Amount = amount.sum()\nflowIn_oneday = _v.mul(_c).mul(_diff_close).div((_diff_close).abs()).fillna(0).sum()\n\n# 趋势强度因子\ntrend_str = where(_diff_close.iloc[1:].abs().sum()==0, 1, _c.iloc[-1] - _c.iloc[0] / (_diff_close.iloc[1:].abs().sum()))\n\n# 改进反转因子\ninverse_plus = (_c.iloc[-1] - _c.loc[100000]) / _c.loc[100000]\n\n# 日内动量因子\ndaily_mom_1 = (_c.loc[103000] - _c.loc[93500]) / _c.loc[93500]\ndaily_mom_2 = (_c.loc[110000] - _c.loc[93500]) / _c.loc[93500]\ndaily_mom_3 = (_c.loc[143000] - _c.loc[93500]) / _c.loc[93500]\ndaily_mom_4 = (_c.loc[145700] - _c.loc[93500]) / _c.loc[93500]\n\n\n\n\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-331"}],"output_ports":[{"name":"data","node_id":"-331"}],"cacheable":true,"seq_num":1,"comment":"","comment_collapsed":true},{"node_id":"-312","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2014-03-03","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2021-12-31","type":"Literal","bound_global_parameter":null},{"name":"market","value":"CN_STOCK_A","type":"Literal","bound_global_parameter":null},{"name":"instrument_list","value":"000001.SZA\n000002.SZA\n000005.SZA","type":"Literal","bound_global_parameter":null},{"name":"max_count","value":0,"type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"rolling_conf","node_id":"-312"}],"output_ports":[{"name":"data","node_id":"-312"}],"cacheable":true,"seq_num":2,"comment":"","comment_collapsed":true},{"node_id":"-322","module_id":"BigQuantSpace.feature_extractor_1m.feature_extractor_1m-v1","parameters":[{"name":"start_date","value":"","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"","type":"Literal","bound_global_parameter":null},{"name":"before_start_days","value":"20","type":"Literal","bound_global_parameter":null},{"name":"workers","value":2,"type":"Literal","bound_global_parameter":null},{"name":"parallel_mode","value":"测试","type":"Literal","bound_global_parameter":null},{"name":"table_1m","value":"level2_bar1m_CN_STOCK_A","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-322"},{"name":"features","node_id":"-322"},{"name":"user_functions","node_id":"-322"}],"output_ports":[{"name":"data","node_id":"-322"}],"cacheable":true,"seq_num":3,"comment":"","comment_collapsed":true},{"node_id":"-932","module_id":"BigQuantSpace.feature_extractor_user_function.feature_extractor_user_function-v1","parameters":[{"name":"name","value":"RVar","type":"Literal","bound_global_parameter":null},{"name":"func","value":"def bigquant_run(df, ret):\n return np.power(ret, 2).sum()\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_functions","node_id":"-932"}],"output_ports":[{"name":"functions","node_id":"-932"}],"cacheable":false,"seq_num":5,"comment":"","comment_collapsed":true},{"node_id":"-1111","module_id":"BigQuantSpace.feature_extractor_user_function.feature_extractor_user_function-v1","parameters":[{"name":"name","value":"RSkew","type":"Literal","bound_global_parameter":null},{"name":"func","value":"def bigquant_run(df, ret, RVar):\n if RVar == 0:\n result = 0\n else:\n result = (np.power(ret, 3).sum()) * np.sqrt(240) / np.power(RVar, 1.5)\n return result\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_functions","node_id":"-1111"}],"output_ports":[{"name":"functions","node_id":"-1111"}],"cacheable":false,"seq_num":6,"comment":"","comment_collapsed":true},{"node_id":"-2016","module_id":"BigQuantSpace.feature_extractor_user_function.feature_extractor_user_function-v1","parameters":[{"name":"name","value":"RKurt","type":"Literal","bound_global_parameter":null},{"name":"func","value":"def bigquant_run(df, ret, RVar):\n if RVar == 0:\n result = 1\n else:\n result = (np.power(ret, 4).sum()) * (240) / np.power(RVar, 2)\n \n return result\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_functions","node_id":"-2016"}],"output_ports":[{"name":"functions","node_id":"-2016"}],"cacheable":false,"seq_num":4,"comment":"","comment_collapsed":true},{"node_id":"-1136","module_id":"BigQuantSpace.derived_feature_extractor.derived_feature_extractor-v3","parameters":[{"name":"date_col","value":"date","type":"Literal","bound_global_parameter":null},{"name":"instrument_col","value":"instrument","type":"Literal","bound_global_parameter":null},{"name":"drop_na","value":"False","type":"Literal","bound_global_parameter":null},{"name":"remove_extra_columns","value":"False","type":"Literal","bound_global_parameter":null},{"name":"user_functions","value":"def nanmean(df, x_name, N):\n return df.groupby('instrument')[x_name.name].apply(lambda x: x.rolling(N,1).mean())\n\ndef nansum(df, x_name, N):\n return df.groupby('instrument')[x_name.name].apply(lambda x: x.rolling(N,1).sum())\n\nbigquant_run = {\n 'nanmean': nanmean,\n 'nansum': nansum\n}","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_data","node_id":"-1136"},{"name":"features","node_id":"-1136"}],"output_ports":[{"name":"data","node_id":"-1136"}],"cacheable":true,"seq_num":7,"comment":"","comment_collapsed":true},{"node_id":"-2149","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"flowInRatio = nansum(flowIn_oneday, 5) / nansum(Amount, 5)\n\nvolume_ratio_1 = nanmean(volume_ratio_1 , 20)\nvolume_ratio_2 = nanmean(volume_ratio_2 , 20)\nvolume_ratio_3 = nanmean(volume_ratio_3 , 20)\nvolume_ratio_4 = nanmean(volume_ratio_4 , 20)\nvolume_ratio_5 = nanmean(volume_ratio_5 , 20)\n\ncorr_PV = nanmean(corr_PV, 20)\n\ntrend_str_mean5 = nanmean(trend_str, 5)\ntrend_str_mean10 = nanmean(trend_str, 10)\ntrend_str_mean20 = nanmean(trend_str, 20)\n\ninverse_plus = nanmean(inverse_plus, 22)","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-2149"}],"output_ports":[{"name":"data","node_id":"-2149"}],"cacheable":true,"seq_num":8,"comment":"","comment_collapsed":true},{"node_id":"-584","module_id":"BigQuantSpace.feature_extractor_user_function.feature_extractor_user_function-v1","parameters":[{"name":"name","value":"ret_sim","type":"Literal","bound_global_parameter":null},{"name":"func","value":"def bigquant_run(df, close, op):\n res = close.pct_change()\n res.iloc[0] = close.iloc[0] / op.iloc[0] - 1\n return res\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_functions","node_id":"-584"}],"output_ports":[{"name":"functions","node_id":"-584"}],"cacheable":false,"seq_num":9,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-331' Position='8,-279,200,200'/><node_position Node='-312' Position='-319,-281,200,200'/><node_position Node='-322' Position='0,-62.56494903564453,200,200'/><node_position Node='-932' Position='34,-418,200,200'/><node_position Node='-1111' Position='33,-473,200,200'/><node_position Node='-2016' Position='31,-532,200,200'/><node_position Node='-1136' Position='177,100,200,200'/><node_position Node='-2149' Position='323,-62,200,200'/><node_position Node='-584' Position='31.870086669921875,-598.95458984375,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
    In [10]:
    # 本代码由可视化策略环境自动生成 2021年7月9日14:57
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    def m9_func_bigquant_run(df, close, op):
        res = close.pct_change()
        res.iloc[0] = close.iloc[0] / op.iloc[0] - 1
        return res
    
    def m4_func_bigquant_run(df, ret, RVar):
        if RVar == 0:
            result = 1
        else:
            result = (np.power(ret, 4).sum()) * (240) / np.power(RVar, 2)
        
        return result
    
    def m6_func_bigquant_run(df, ret, RVar):
        if RVar == 0:
            result = 0
        else:
            result = (np.power(ret, 3).sum()) * np.sqrt(240) / np.power(RVar, 1.5)
        return result
    
    def m5_func_bigquant_run(df, ret):
        return np.power(ret, 2).sum()
    
    def nanmean(df, x_name, N):
        return df.groupby('instrument')[x_name.name].apply(lambda x: x.rolling(N,1).mean())
    
    def nansum(df, x_name, N):
        return df.groupby('instrument')[x_name.name].apply(lambda x: x.rolling(N,1).sum())
    
    m7_user_functions_bigquant_run = {
        'nanmean': nanmean,
        'nansum': nansum
    }
    
    m1 = M.input_features.v1(
        features="""_c = close
    _o = open
    _v = volume
    # _bmc = bar1m_000905_HIX__close
    # _bmo = bar1m_000905_HIX__open
    _ret = ret_sim(_c, _o)
    _rk1 = _ret.loc[93500:100000]
    _rk2 = _ret.loc[110000:113000]
    _rk3 = _ret.loc[143000:145700]
    # _bm_ret = ret_sim(_bmc, _bmo)
    
    # 收益方差
    RVar = RVar(_ret)
    
    # 收益偏度
    RSkew = RSkew(_ret, RVar)
    
    # # 收益峰度
    RKurt = RKurt(_ret, RVar)
    
    # # 成交量占比
    volume_ratio_1 = _v.loc[93500:100000].sum() / _v.sum()
    volume_ratio_2 = _v.loc[100100:103000].sum() / _v.sum()
    volume_ratio_3 = _v.loc[103100:110000].sum() / _v.sum()
    volume_ratio_4 = _v.loc[110100:113000].sum() / _v.sum()
    volume_ratio_5 = _v.loc[143000:145700].sum() / _v.sum()
    
    # 量价相关性
    _Volume = _v
    _Price = _c
    _corr= _Volume.corr(_Price, method='pearson')
    corr_PV = where(np.isnan(_corr), 0, _corr)
    
    # 资金流入因子
    _diff_close = _c.diff().fillna(0)
    # Amount = amount.sum()
    flowIn_oneday = _v.mul(_c).mul(_diff_close).div((_diff_close).abs()).fillna(0).sum()
    
    # 趋势强度因子
    trend_str = where(_diff_close.iloc[1:].abs().sum()==0, 1, _c.iloc[-1] - _c.iloc[0] / (_diff_close.iloc[1:].abs().sum()))
    
    # 改进反转因子
    inverse_plus = (_c.iloc[-1] - _c.loc[100000]) / _c.loc[100000]
    
    # 日内动量因子
    daily_mom_1 = (_c.loc[103000] - _c.loc[93500]) / _c.loc[93500]
    daily_mom_2 = (_c.loc[110000] - _c.loc[93500]) / _c.loc[93500]
    daily_mom_3 = (_c.loc[143000] - _c.loc[93500]) / _c.loc[93500]
    daily_mom_4 = (_c.loc[145700] - _c.loc[93500]) / _c.loc[93500]
    
    
    
    
    """
    )
    
    m2 = M.instruments.v2(
        start_date='2014-03-03',
        end_date='2021-12-31',
        market='CN_STOCK_A',
        instrument_list="""000001.SZA
    000002.SZA
    000005.SZA""",
        max_count=0
    )
    
    m8 = M.input_features.v1(
        features="""flowInRatio = nansum(flowIn_oneday, 5) / nansum(Amount, 5)
    
    volume_ratio_1 = nanmean(volume_ratio_1 , 20)
    volume_ratio_2 = nanmean(volume_ratio_2 , 20)
    volume_ratio_3 = nanmean(volume_ratio_3 , 20)
    volume_ratio_4 = nanmean(volume_ratio_4 , 20)
    volume_ratio_5 = nanmean(volume_ratio_5 , 20)
    
    corr_PV = nanmean(corr_PV, 20)
    
    trend_str_mean5 = nanmean(trend_str, 5)
    trend_str_mean10 = nanmean(trend_str, 10)
    trend_str_mean20 = nanmean(trend_str, 20)
    
    inverse_plus = nanmean(inverse_plus, 22)"""
    )
    
    m9 = M.feature_extractor_user_function.v1(
        name='ret_sim',
        func=m9_func_bigquant_run
    )
    
    m4 = M.feature_extractor_user_function.v1(
        input_functions=m9.functions,
        name='RKurt',
        func=m4_func_bigquant_run
    )
    
    m6 = M.feature_extractor_user_function.v1(
        input_functions=m4.functions,
        name='RSkew',
        func=m6_func_bigquant_run
    )
    
    m5 = M.feature_extractor_user_function.v1(
        input_functions=m6.functions,
        name='RVar',
        func=m5_func_bigquant_run
    )
    
    m3 = M.feature_extractor_1m.v1(
        instruments=m2.data,
        features=m1.data,
        user_functions=m5.functions,
        start_date='',
        end_date='',
        before_start_days=20,
        workers=2,
        parallel_mode='测试',
        table_1m='level2_bar1m_CN_STOCK_A'
    )
    
    m7 = M.derived_feature_extractor.v3(
        input_data=m3.data,
        features=m8.data,
        date_col='date',
        instrument_col='instrument',
        drop_na=False,
        remove_extra_columns=False,
        user_functions=m7_user_functions_bigquant_run
    )
    
    In [11]:
    dt = m7.data.read()
    dt.shape, dt.date.min(), dt.date.max()
    
    Out[11]:
    ((729, 21), Timestamp('2020-01-02 00:00:00'), Timestamp('2020-12-31 00:00:00'))
    In [12]:
    dt.head().T
    
    Out[12]:
    0 1 2 3 4
    RVar 0.000431 0.000587 0.001088 0.00027 0.000276
    RSkew 1.047927 0.069402 0.052861 1.105082 0.102527
    RKurt 8.230084 8.235238 2.750429 7.394212 7.387867
    flowIn_oneday 153651310.104244 -76710407.979855 -221925.559337 371063410.669184 -253271006.590902
    trend_str 12.368649 28.479662 0.040939 11.263328 25.984936
    daily_mom_1 0.003569 -0.008958 -0.003185 0.00526 -0.01538
    daily_mom_2 0.007139 -0.01493 0.0 -0.001169 -0.01661
    daily_mom_3 0.002974 -0.021798 -0.003185 0.008182 -0.010766
    daily_mom_4 0.002974 -0.028665 -0.003185 0.003507 -0.013534
    date 2020-01-02 00:00:00 2020-01-02 00:00:00 2020-01-02 00:00:00 2020-01-03 00:00:00 2020-01-03 00:00:00
    instrument 000001.SZA 000002.SZA 000005.SZA 000001.SZA 000002.SZA
    volume_ratio_1 0.299472 0.204757 0.153446 0.243237 0.210904
    volume_ratio_2 0.181562 0.180252 0.179855 0.167818 0.159121
    volume_ratio_3 0.096245 0.156735 0.128181 0.093017 0.139092
    volume_ratio_4 0.074475 0.071333 0.081232 0.070713 0.069312
    volume_ratio_5 0.052487 0.103403 0.131225 0.066717 0.115779
    corr_PV -0.300752 0.336809 -0.068722 -0.140373 0.3731
    trend_str_mean5 12.368649 28.479662 0.040939 11.815989 27.232299
    trend_str_mean10 12.368649 28.479662 0.040939 11.815989 27.232299
    trend_str_mean20 12.368649 28.479662 0.040939 11.815989 27.232299
    inverse_plus 0.010785 -0.023688 0.003195 0.008026 -0.012312
    In [13]:
    dt.isna().sum()
    
    Out[13]:
    RVar                0
    RSkew               0
    RKurt               0
    flowIn_oneday       0
    trend_str           0
    daily_mom_1         0
    daily_mom_2         0
    daily_mom_3         0
    daily_mom_4         0
    date                0
    instrument          0
    volume_ratio_1      0
    volume_ratio_2      0
    volume_ratio_3      0
    volume_ratio_4      0
    volume_ratio_5      0
    corr_PV             0
    trend_str_mean5     0
    trend_str_mean10    0
    trend_str_mean20    0
    inverse_plus        0
    dtype: int64
    In [14]:
    dt.describe().T
    
    Out[14]:
    count mean std min 25% 50% 75% max
    RVar 729.0 7.554301e-04 6.065420e-04 0.000000e+00 2.727777e-04 0.000533 1.193668e-03 4.742859e-03
    RSkew 729.0 1.818319e-01 1.009579e+00 -5.650973e+00 -1.619114e-01 0.071266 4.775091e-01 9.137768e+00
    RKurt 729.0 6.856221e+00 7.767365e+00 1.000000e+00 3.610083e+00 4.902572 6.959804e+00 1.103873e+02
    flowIn_oneday 729.0 4.347176e+06 2.540462e+08 -9.694646e+08 -7.669584e+07 -547441.205575 3.378613e+07 1.810231e+09
    trend_str 729.0 1.086825e+01 9.593094e+00 -2.706525e+00 1.646416e-01 10.212191 2.062259e+01 2.908537e+01
    daily_mom_1 729.0 3.566883e-04 1.191399e-02 -3.934415e-02 -6.349124e-03 0.000000 5.917107e-03 1.041666e-01
    daily_mom_2 729.0 3.742048e-04 1.259896e-02 -4.229839e-02 -7.042247e-03 0.000000 6.788892e-03 1.041666e-01
    daily_mom_3 729.0 2.910437e-04 1.506282e-02 -5.573765e-02 -8.097241e-03 0.000000 7.936406e-03 1.041666e-01
    daily_mom_4 729.0 9.337573e-04 1.595636e-02 -5.901634e-02 -7.812586e-03 0.000000 9.831485e-03 1.041666e-01
    volume_ratio_1 729.0 1.884945e-01 1.490386e-02 1.223230e-01 1.794122e-01 0.188462 1.975449e-01 2.994716e-01
    volume_ratio_2 729.0 1.384547e-01 1.159096e-02 9.765451e-02 1.319900e-01 0.138603 1.454864e-01 1.815619e-01
    volume_ratio_3 729.0 1.035187e-01 1.054426e-02 7.450033e-02 9.619130e-02 0.103980 1.106916e-01 1.567354e-01
    volume_ratio_4 729.0 8.547974e-02 8.323179e-03 6.375121e-02 7.991989e-02 0.085407 9.146229e-02 1.069608e-01
    volume_ratio_5 729.0 1.236669e-01 1.911274e-02 5.248668e-02 1.104617e-01 0.120695 1.318337e-01 1.983895e-01
    corr_PV 729.0 6.207629e-02 6.201593e-02 -3.007515e-01 2.391688e-02 0.059457 1.009452e-01 3.731003e-01
    trend_str_mean5 729.0 1.087139e+01 9.564092e+00 -1.190266e+00 9.818664e-02 10.012152 2.069618e+01 2.847966e+01
    trend_str_mean10 729.0 1.088032e+01 9.559356e+00 -8.905927e-01 9.051087e-02 9.915288 2.072692e+01 2.847966e+01
    trend_str_mean20 729.0 1.088695e+01 9.549329e+00 -6.838769e-01 1.086811e-01 9.787344 2.120351e+01 2.847966e+01
    inverse_plus 729.0 5.987261e-04 2.781582e-03 -2.368807e-02 -1.254285e-03 0.000413 2.582472e-03 1.078492e-02
    In [15]:
    dt2 = dt.set_index(['date','instrument'])
    dt2.head()
    
    Out[15]:
    RVar RSkew RKurt flowIn_oneday trend_str daily_mom_1 daily_mom_2 daily_mom_3 daily_mom_4 volume_ratio_1 volume_ratio_2 volume_ratio_3 volume_ratio_4 volume_ratio_5 corr_PV trend_str_mean5 trend_str_mean10 trend_str_mean20 inverse_plus
    date instrument
    2020-01-02 000001.SZA 0.000431 1.047927 8.230084 1.536513e+08 12.368649 0.003569 0.007139 0.002974 0.002974 0.299472 0.181562 0.096245 0.074475 0.052487 -0.300752 12.368649 12.368649 12.368649 0.010785
    000002.SZA 0.000587 0.069402 8.235238 -7.671041e+07 28.479662 -0.008958 -0.014930 -0.021798 -0.028665 0.204757 0.180252 0.156735 0.071333 0.103403 0.336809 28.479662 28.479662 28.479662 -0.023688
    000005.SZA 0.001088 0.052861 2.750429 -2.219256e+05 0.040939 -0.003185 0.000000 -0.003185 -0.003185 0.153446 0.179855 0.128181 0.081232 0.131225 -0.068722 0.040939 0.040939 0.040939 0.003195
    2020-01-03 000001.SZA 0.000270 1.105082 7.394212 3.710634e+08 11.263328 0.005260 -0.001169 0.008182 0.003507 0.243237 0.167818 0.093017 0.070713 0.066717 -0.140373 11.815989 11.815989 11.815989 0.008026
    000002.SZA 0.000276 0.102527 7.387867 -2.532710e+08 25.984936 -0.015380 -0.016610 -0.010766 -0.013534 0.210904 0.159121 0.139092 0.069312 0.115779 0.373100 27.232299 27.232299 27.232299 -0.012312
    In [16]:
    import seaborn as sns
    import matplotlib.pyplot as plt
    
    In [19]:
    # %%time
    n=4#行数
    m=dt2.shape[1]
    x=m%n
    fig,axes=plt.subplots(n,int((m - x + (n if x else x))/n),figsize=(20, 10))
    axes=axes.reshape((-1,))
    for i in range(dt2.shape[1]):    
        sns.distplot(dt2[dt2.columns[i]],ax=axes[i])
    plt.subplots_adjust(wspace =0.3, hspace =0.3)
    
    In [18]:
    # for i in dt2.columns[:]:
    #     dt2[i].to_hdf(f'XX券商-XXXX研报-{i}.h5', 'fac', mode='w')
    
    In [ ]:
     
    
    In [ ]:
     
    
    In [ ]:
     
    
    In [ ]:
     
    
    In [ ]: