复制链接
克隆策略

    {"description":"实验创建于2020/2/14","graph":{"edges":[{"to_node_id":"-1283:features","from_node_id":"-117:data"},{"to_node_id":"-1283:factor_data","from_node_id":"-125:data"}],"nodes":[{"node_id":"-117","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2019-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2019-12-31","type":"Literal","bound_global_parameter":null},{"name":"market","value":"CN_STOCK_A","type":"Literal","bound_global_parameter":null},{"name":"instrument_list","value":"000725.SZA\n000100.SZA\n000063.SZA\n002465.SZA\n600031.SHA\n601766.SHA\n002456.SZA\n600703.SHA\n002023.SZA\n601989.SHA\n600522.SHA\n002463.SZA\n002236.SZA\n002384.SZA\n002129.SZA\n000977.SZA\n300274.SZA\n002475.SZA\n000425.SZA\n600104.SHA\n000338.SZA\n600435.SHA\n600487.SHA\n600499.SHA\n002415.SZA\n002202.SZA\n002340.SZA\n600118.SHA\n300014.SZA\n000157.SZA\n000625.SZA\n601012.SHA\n600879.SHA\n300433.SZA\n600438.SHA\n002185.SZA\n600183.SHA\n002008.SZA\n300266.SZA\n000988.SZA\n600406.SHA\n603185.SHA\n300123.SZA\n600089.SHA\n300408.SZA\n600316.SHA\n601138.SHA\n601058.SHA\n603712.SHA\n002531.SZA\n002600.SZA\n000066.SZA\n002544.SZA\n600884.SHA\n300316.SZA\n300171.SZA\n000547.SZA\n000050.SZA\n002594.SZA\n002179.SZA\n000768.SZA\n000901.SZA\n600584.SHA\n600875.SHA\n601877.SHA\n002025.SZA\n603019.SHA\n300390.SZA\n002414.SZA\n002241.SZA\n601633.SHA\n002056.SZA\n600660.SHA\n600460.SHA\n002074.SZA\n600741.SHA\n600150.SHA\n601100.SHA\n600482.SHA\n600418.SHA\n300008.SZA\n000519.SZA\n601727.SHA\n002353.SZA\n300382.SZA\n300124.SZA\n300450.SZA\n300207.SZA\n601179.SHA\n600372.SHA\n002850.SZA\n002625.SZA\n000887.SZA\n002938.SZA\n002152.SZA\n300114.SZA\n601231.SHA\n300001.SZA\n300073.SZA\n000818.SZA\n603678.SHA\n600893.SHA\n002138.SZA\n002935.SZA\n002049.SZA\n600765.SHA\n600760.SHA\n000800.SZA\n300750.SZA\n002371.SZA\n603986.SHA\n600745.SHA\n002444.SZA\n300024.SZA\n002430.SZA\n600862.SHA\n002459.SZA\n300593.SZA\n603596.SHA\n600038.SHA\n002156.SZA\n000738.SZA\n300726.SZA\n002268.SZA\n300308.SZA\n300034.SZA\n300376.SZA\n000733.SZA\n300373.SZA\n300724.SZA\n300118.SZA\n002916.SZA\n002028.SZA\n600732.SHA\n600456.SHA\n300568.SZA\n600562.SHA\n300037.SZA\n600885.SHA\n603026.SHA\n002487.SZA\n002389.SZA\n600517.SHA\n002189.SZA\n300395.SZA\n002747.SZA\n002097.SZA\n601238.SHA\n300455.SZA\n002709.SZA\n600699.SHA\n000682.SZA\n000821.SZA\n603160.SHA\n300065.SZA\n300358.SZA\n300438.SZA\n603501.SHA\n002920.SZA\n600563.SHA\n601966.SHA\n600184.SHA\n002829.SZA\n002698.SZA\n300423.SZA\n300223.SZA\n002851.SZA\n002180.SZA\n300699.SZA\n603659.SHA\n601799.SHA\n603338.SHA\n300628.SZA\n300397.SZA\n300581.SZA\n600764.SHA\n300604.SZA\n300751.SZA\n300276.SZA\n603806.SHA\n002812.SZA\n002906.SZA\n601689.SHA\n600990.SHA\n300474.SZA\n002841.SZA\n300696.SZA\n603218.SHA\n300661.SZA\n300516.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":"-117"}],"output_ports":[{"name":"data","node_id":"-117"}],"cacheable":true,"seq_num":4,"comment":"","comment_collapsed":true},{"node_id":"-125","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nmarket_cap_0\nreturn_6\nfs_roe_0\npe_ttm_0","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-125"}],"output_ports":[{"name":"data","node_id":"-125"}],"cacheable":true,"seq_num":5,"comment":"","comment_collapsed":true},{"node_id":"-1283","module_id":"BigQuantSpace.factorlens_custom.factorlens_custom-v3","parameters":[{"name":"start_date","value":"2019-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2019-12-31","type":"Literal","bound_global_parameter":null},{"name":"instrument_list","value":"000725.SZA\n000100.SZA\n000063.SZA\n002465.SZA\n600031.SHA\n601766.SHA\n002456.SZA\n600703.SHA\n002023.SZA\n601989.SHA\n600522.SHA\n002463.SZA\n002236.SZA\n002384.SZA\n002129.SZA\n000977.SZA\n300274.SZA\n002475.SZA\n000425.SZA\n600104.SHA\n000338.SZA\n600435.SHA\n600487.SHA\n600499.SHA\n002415.SZA\n002202.SZA\n002340.SZA\n600118.SHA\n300014.SZA\n000157.SZA\n000625.SZA\n601012.SHA\n600879.SHA\n300433.SZA\n600438.SHA\n002185.SZA\n600183.SHA\n002008.SZA\n300266.SZA\n000988.SZA\n600406.SHA\n603185.SHA\n300123.SZA\n600089.SHA\n300408.SZA\n600316.SHA\n601138.SHA\n601058.SHA\n603712.SHA\n002531.SZA\n002600.SZA\n000066.SZA\n002544.SZA\n600884.SHA\n300316.SZA\n300171.SZA\n000547.SZA\n000050.SZA\n002594.SZA\n002179.SZA\n000768.SZA\n000901.SZA\n600584.SHA\n600875.SHA\n601877.SHA\n002025.SZA\n603019.SHA\n300390.SZA\n002414.SZA\n002241.SZA\n601633.SHA\n002056.SZA\n600660.SHA\n600460.SHA\n002074.SZA\n600741.SHA\n600150.SHA\n601100.SHA\n600482.SHA\n600418.SHA\n300008.SZA\n000519.SZA\n601727.SHA\n002353.SZA\n300382.SZA\n300124.SZA\n300450.SZA\n300207.SZA\n601179.SHA\n600372.SHA\n002850.SZA\n002625.SZA\n000887.SZA\n002938.SZA\n002152.SZA\n300114.SZA\n601231.SHA\n300001.SZA\n300073.SZA\n000818.SZA\n603678.SHA\n600893.SHA\n002138.SZA\n002935.SZA\n002049.SZA\n600765.SHA\n600760.SHA\n000800.SZA\n300750.SZA\n002371.SZA\n603986.SHA\n600745.SHA\n002444.SZA\n300024.SZA\n002430.SZA\n600862.SHA\n002459.SZA\n300593.SZA\n603596.SHA\n600038.SHA\n002156.SZA\n000738.SZA\n300726.SZA\n002268.SZA\n300308.SZA\n300034.SZA\n300376.SZA\n000733.SZA\n300373.SZA\n300724.SZA\n300118.SZA\n002916.SZA\n002028.SZA\n600732.SHA\n600456.SHA\n300568.SZA\n600562.SHA\n300037.SZA\n600885.SHA\n603026.SHA\n002487.SZA\n002389.SZA\n600517.SHA\n002189.SZA\n300395.SZA\n002747.SZA\n002097.SZA\n601238.SHA\n300455.SZA\n002709.SZA\n600699.SHA\n000682.SZA\n000821.SZA\n603160.SHA\n300065.SZA\n300358.SZA\n300438.SZA\n603501.SHA\n002920.SZA\n600563.SHA\n601966.SHA\n600184.SHA\n002829.SZA\n002698.SZA\n300423.SZA\n300223.SZA\n002851.SZA\n002180.SZA\n300699.SZA\n603659.SHA\n601799.SHA\n603338.SHA\n300628.SZA\n300397.SZA\n300581.SZA\n600764.SHA\n300604.SZA\n300751.SZA\n300276.SZA\n603806.SHA\n002812.SZA\n002906.SZA\n601689.SHA\n600990.SHA\n300474.SZA\n002841.SZA\n300696.SZA\n603218.SHA\n300661.SZA\n300516.SZA","type":"Literal","bound_global_parameter":null},{"name":"market","value":"股票","type":"Literal","bound_global_parameter":null},{"name":"product_filter","value":"","type":"Literal","bound_global_parameter":null},{"name":"expr","value":"","type":"Literal","bound_global_parameter":null},{"name":"rebalance_period","value":22,"type":"Literal","bound_global_parameter":null},{"name":"quantile_num","value":5,"type":"Literal","bound_global_parameter":null},{"name":"buy_commission_rate","value":0.0005,"type":"Literal","bound_global_parameter":null},{"name":"sell_commission_rate","value":0.0005,"type":"Literal","bound_global_parameter":null},{"name":"ic_method","value":"Rank_IC","type":"Literal","bound_global_parameter":null},{"name":"is_winsorize","value":"True","type":"Literal","bound_global_parameter":null},{"name":"is_standardlize","value":"True","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features","node_id":"-1283"},{"name":"factor_data","node_id":"-1283"}],"output_ports":[{"name":"data_1","node_id":"-1283"},{"name":"data_2","node_id":"-1283"},{"name":"data_3","node_id":"-1283"}],"cacheable":true,"seq_num":2,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-117' Position='18,29,200,200'/><node_position Node='-125' Position='338,26,200,200'/><node_position Node='-1283' Position='189,212,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
    In [22]:
    # 本代码由可视化策略环境自动生成 2023年4月11日 15:27
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    m4 = M.instruments.v2(
        start_date='2019-01-01',
        end_date='2019-12-31',
        market='CN_STOCK_A',
        instrument_list="""000725.SZA
    000100.SZA
    000063.SZA
    002465.SZA
    600031.SHA
    601766.SHA
    002456.SZA
    600703.SHA
    002023.SZA
    601989.SHA
    600522.SHA
    002463.SZA
    002236.SZA
    002384.SZA
    002129.SZA
    000977.SZA
    300274.SZA
    002475.SZA
    000425.SZA
    600104.SHA
    000338.SZA
    600435.SHA
    600487.SHA
    600499.SHA
    002415.SZA
    002202.SZA
    002340.SZA
    600118.SHA
    300014.SZA
    000157.SZA
    000625.SZA
    601012.SHA
    600879.SHA
    300433.SZA
    600438.SHA
    002185.SZA
    600183.SHA
    002008.SZA
    300266.SZA
    000988.SZA
    600406.SHA
    603185.SHA
    300123.SZA
    600089.SHA
    300408.SZA
    600316.SHA
    601138.SHA
    601058.SHA
    603712.SHA
    002531.SZA
    002600.SZA
    000066.SZA
    002544.SZA
    600884.SHA
    300316.SZA
    300171.SZA
    000547.SZA
    000050.SZA
    002594.SZA
    002179.SZA
    000768.SZA
    000901.SZA
    600584.SHA
    600875.SHA
    601877.SHA
    002025.SZA
    603019.SHA
    300390.SZA
    002414.SZA
    002241.SZA
    601633.SHA
    002056.SZA
    600660.SHA
    600460.SHA
    002074.SZA
    600741.SHA
    600150.SHA
    601100.SHA
    600482.SHA
    600418.SHA
    300008.SZA
    000519.SZA
    601727.SHA
    002353.SZA
    300382.SZA
    300124.SZA
    300450.SZA
    300207.SZA
    601179.SHA
    600372.SHA
    002850.SZA
    002625.SZA
    000887.SZA
    002938.SZA
    002152.SZA
    300114.SZA
    601231.SHA
    300001.SZA
    300073.SZA
    000818.SZA
    603678.SHA
    600893.SHA
    002138.SZA
    002935.SZA
    002049.SZA
    600765.SHA
    600760.SHA
    000800.SZA
    300750.SZA
    002371.SZA
    603986.SHA
    600745.SHA
    002444.SZA
    300024.SZA
    002430.SZA
    600862.SHA
    002459.SZA
    300593.SZA
    603596.SHA
    600038.SHA
    002156.SZA
    000738.SZA
    300726.SZA
    002268.SZA
    300308.SZA
    300034.SZA
    300376.SZA
    000733.SZA
    300373.SZA
    300724.SZA
    300118.SZA
    002916.SZA
    002028.SZA
    600732.SHA
    600456.SHA
    300568.SZA
    600562.SHA
    300037.SZA
    600885.SHA
    603026.SHA
    002487.SZA
    002389.SZA
    600517.SHA
    002189.SZA
    300395.SZA
    002747.SZA
    002097.SZA
    601238.SHA
    300455.SZA
    002709.SZA
    600699.SHA
    000682.SZA
    000821.SZA
    603160.SHA
    300065.SZA
    300358.SZA
    300438.SZA
    603501.SHA
    002920.SZA
    600563.SHA
    601966.SHA
    600184.SHA
    002829.SZA
    002698.SZA
    300423.SZA
    300223.SZA
    002851.SZA
    002180.SZA
    300699.SZA
    603659.SHA
    601799.SHA
    603338.SHA
    300628.SZA
    300397.SZA
    300581.SZA
    600764.SHA
    300604.SZA
    300751.SZA
    300276.SZA
    603806.SHA
    002812.SZA
    002906.SZA
    601689.SHA
    600990.SHA
    300474.SZA
    002841.SZA
    300696.SZA
    603218.SHA
    300661.SZA
    300516.SZA""",
        max_count=0
    )
    
    m5 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    market_cap_0
    return_6
    fs_roe_0
    pe_ttm_0"""
    )
    
    m2 = M.factorlens_custom.v3(
        features=m4.data,
        factor_data=m5.data,
        start_date='2019-01-01',
        end_date='2019-12-31',
        instrument_list="""000725.SZA
    000100.SZA
    000063.SZA
    002465.SZA
    600031.SHA
    601766.SHA
    002456.SZA
    600703.SHA
    002023.SZA
    601989.SHA
    600522.SHA
    002463.SZA
    002236.SZA
    002384.SZA
    002129.SZA
    000977.SZA
    300274.SZA
    002475.SZA
    000425.SZA
    600104.SHA
    000338.SZA
    600435.SHA
    600487.SHA
    600499.SHA
    002415.SZA
    002202.SZA
    002340.SZA
    600118.SHA
    300014.SZA
    000157.SZA
    000625.SZA
    601012.SHA
    600879.SHA
    300433.SZA
    600438.SHA
    002185.SZA
    600183.SHA
    002008.SZA
    300266.SZA
    000988.SZA
    600406.SHA
    603185.SHA
    300123.SZA
    600089.SHA
    300408.SZA
    600316.SHA
    601138.SHA
    601058.SHA
    603712.SHA
    002531.SZA
    002600.SZA
    000066.SZA
    002544.SZA
    600884.SHA
    300316.SZA
    300171.SZA
    000547.SZA
    000050.SZA
    002594.SZA
    002179.SZA
    000768.SZA
    000901.SZA
    600584.SHA
    600875.SHA
    601877.SHA
    002025.SZA
    603019.SHA
    300390.SZA
    002414.SZA
    002241.SZA
    601633.SHA
    002056.SZA
    600660.SHA
    600460.SHA
    002074.SZA
    600741.SHA
    600150.SHA
    601100.SHA
    600482.SHA
    600418.SHA
    300008.SZA
    000519.SZA
    601727.SHA
    002353.SZA
    300382.SZA
    300124.SZA
    300450.SZA
    300207.SZA
    601179.SHA
    600372.SHA
    002850.SZA
    002625.SZA
    000887.SZA
    002938.SZA
    002152.SZA
    300114.SZA
    601231.SHA
    300001.SZA
    300073.SZA
    000818.SZA
    603678.SHA
    600893.SHA
    002138.SZA
    002935.SZA
    002049.SZA
    600765.SHA
    600760.SHA
    000800.SZA
    300750.SZA
    002371.SZA
    603986.SHA
    600745.SHA
    002444.SZA
    300024.SZA
    002430.SZA
    600862.SHA
    002459.SZA
    300593.SZA
    603596.SHA
    600038.SHA
    002156.SZA
    000738.SZA
    300726.SZA
    002268.SZA
    300308.SZA
    300034.SZA
    300376.SZA
    000733.SZA
    300373.SZA
    300724.SZA
    300118.SZA
    002916.SZA
    002028.SZA
    600732.SHA
    600456.SHA
    300568.SZA
    600562.SHA
    300037.SZA
    600885.SHA
    603026.SHA
    002487.SZA
    002389.SZA
    600517.SHA
    002189.SZA
    300395.SZA
    002747.SZA
    002097.SZA
    601238.SHA
    300455.SZA
    002709.SZA
    600699.SHA
    000682.SZA
    000821.SZA
    603160.SHA
    300065.SZA
    300358.SZA
    300438.SZA
    603501.SHA
    002920.SZA
    600563.SHA
    601966.SHA
    600184.SHA
    002829.SZA
    002698.SZA
    300423.SZA
    300223.SZA
    002851.SZA
    002180.SZA
    300699.SZA
    603659.SHA
    601799.SHA
    603338.SHA
    300628.SZA
    300397.SZA
    300581.SZA
    600764.SHA
    300604.SZA
    300751.SZA
    300276.SZA
    603806.SHA
    002812.SZA
    002906.SZA
    601689.SHA
    600990.SHA
    300474.SZA
    002841.SZA
    300696.SZA
    603218.SHA
    300661.SZA
    300516.SZA""",
        market='股票',
        product_filter='',
        expr='',
        rebalance_period=22,
        quantile_num=5,
        buy_commission_rate=0.0005,
        sell_commission_rate=0.0005,
        ic_method='Rank_IC',
        is_winsorize=True,
        is_standardlize=True
    )
    
    ---------------------------------------------------------------------------
    KeyError                                  Traceback (most recent call last)
    <ipython-input-22-78e867e26dda> in <module>
        210 )
        211 
    --> 212 m2 = M.factorlens_custom.v3(
        213     features=m4.data,
        214     factor_data=m5.data,
    
    KeyError: 0