克隆策略

    {"description":"实验创建于2021/10/23","graph":{"edges":[{"to_node_id":"-306:instruments","from_node_id":"-293:data"},{"to_node_id":"-270:instruments","from_node_id":"-293:data"},{"to_node_id":"-306:features","from_node_id":"-301:data"},{"to_node_id":"-313:features","from_node_id":"-301:data"},{"to_node_id":"-313:input_data","from_node_id":"-306:data"},{"to_node_id":"-270:feature_datas","from_node_id":"-313:data"}],"nodes":[{"node_id":"-270","module_id":"BigQuantSpace.genetic_algorithm.genetic_algorithm-v1","parameters":[{"name":"all_start_date","value":"","type":"Literal","bound_global_parameter":null},{"name":"all_end_date","value":"","type":"Literal","bound_global_parameter":null},{"name":"short_date_range_ratio","value":"0.7","type":"Literal","bound_global_parameter":null},{"name":"return_field","value":"wap_3_vwap_buy","type":"Literal","bound_global_parameter":null},{"name":"rebalance_period","value":1,"type":"Literal","bound_global_parameter":null},{"name":"train_test_ratio","value":0.75,"type":"Literal","bound_global_parameter":null},{"name":"train_validate_ratio","value":0.75,"type":"Literal","bound_global_parameter":null},{"name":"mtime","value":"2","type":"Literal","bound_global_parameter":null},{"name":"init_ind_num","value":"10","type":"Literal","bound_global_parameter":null},{"name":"ngen","value":"3","type":"Literal","bound_global_parameter":null},{"name":"fitness_func","value":"long_return","type":"Literal","bound_global_parameter":null},{"name":"train_fitness","value":"2","type":"Literal","bound_global_parameter":null},{"name":"test_fitness","value":"1.6","type":"Literal","bound_global_parameter":null},{"name":"ir_type","value":"ir","type":"Literal","bound_global_parameter":null},{"name":"cxpb","value":0.5,"type":"Literal","bound_global_parameter":null},{"name":"mutpb","value":0.3,"type":"Literal","bound_global_parameter":null},{"name":"mutspb","value":0.3,"type":"Literal","bound_global_parameter":null},{"name":"mutnrpb","value":0.3,"type":"Literal","bound_global_parameter":null},{"name":"constant","value":"1,11","type":"Literal","bound_global_parameter":null},{"name":"pool_processes_limit","value":"5","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-270"},{"name":"feature_datas","node_id":"-270"},{"name":"base_features","node_id":"-270"}],"output_ports":[{"name":"factors","node_id":"-270"}],"cacheable":false,"seq_num":1,"comment":"","comment_collapsed":true},{"node_id":"-293","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2018-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2021-10-20","type":"Literal","bound_global_parameter":null},{"name":"market","value":"CN_STOCK_A","type":"Literal","bound_global_parameter":null},{"name":"instrument_list","value":"","type":"Literal","bound_global_parameter":null},{"name":"max_count","value":0,"type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"rolling_conf","node_id":"-293"}],"output_ports":[{"name":"data","node_id":"-293"}],"cacheable":true,"seq_num":2,"comment":"","comment_collapsed":true},{"node_id":"-301","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"close_0\nopen_0\nhigh_0\nlow_0 \namount_0\nturn_0 \nreturn_0","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-301"}],"output_ports":[{"name":"data","node_id":"-301"}],"cacheable":true,"seq_num":3,"comment":"","comment_collapsed":true},{"node_id":"-306","module_id":"BigQuantSpace.general_feature_extractor.general_feature_extractor-v7","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":90,"type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-306"},{"name":"features","node_id":"-306"}],"output_ports":[{"name":"data","node_id":"-306"}],"cacheable":true,"seq_num":4,"comment":"","comment_collapsed":true},{"node_id":"-313","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":"{}","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_data","node_id":"-313"},{"name":"features","node_id":"-313"}],"output_ports":[{"name":"data","node_id":"-313"}],"cacheable":true,"seq_num":5,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-270' Position='-128.10812377929688,166.5946044921875,200,200'/><node_position Node='-293' Position='-132,-133.2432403564453,200,200'/><node_position Node='-301' Position='163,-95,200,200'/><node_position Node='-306' Position='62.081085205078125,-4.027027130126953,200,200'/><node_position Node='-313' Position='47.75675964355469,77.10810852050781,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
    In [5]:
    # 本代码由可视化策略环境自动生成 2021年10月30日 12:51
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    m2 = M.instruments.v2(
        start_date='2018-01-01',
        end_date='2021-10-20',
        market='CN_STOCK_A',
        instrument_list='',
        max_count=0
    )
    
    m3 = M.input_features.v1(
        features="""close_0
    open_0
    high_0
    low_0 
    amount_0
    turn_0 
    return_0"""
    )
    
    m4 = M.general_feature_extractor.v7(
        instruments=m2.data,
        features=m3.data,
        start_date='',
        end_date='',
        before_start_days=90
    )
    
    m5 = M.derived_feature_extractor.v3(
        input_data=m4.data,
        features=m3.data,
        date_col='date',
        instrument_col='instrument',
        drop_na=False,
        remove_extra_columns=False,
        user_functions={}
    )
    
    m1 = M.genetic_algorithm.v1(
        instruments=m2.data,
        feature_datas=m5.data,
        all_start_date='',
        all_end_date='',
        short_date_range_ratio=0.7,
        return_field='wap_3_vwap_buy',
        rebalance_period=1,
        train_test_ratio=0.75,
        train_validate_ratio=0.75,
        mtime=2,
        init_ind_num=10,
        ngen=3,
        fitness_func='long_return',
        train_fitness=2,
        test_fitness=1.6,
        ir_type='ir',
        cxpb=0.5,
        mutpb=0.3,
        mutspb=0.3,
        mutnrpb=0.3,
        constant='1,11',
        pool_processes_limit=5,
        m_cached=False
    )
    
    -- 开始第「1」次循环第「1」代挖掘 --
    
    去重前的个体数10
    去重后的个体数10
    
    每代的平均适应度:[0.014992363024151838]
    因子sma(high_0, 1)在训练集适应度值为0.8605557181242324
    因子mean3(prod(open_0, 7), stddev(return_0, 10), argmin(return_0, 7))在训练集适应度值为0.8191720860629771
    因子sma(standardation(return_0), constant(3))在训练集适应度值为3.3591763456667794
    因子abs(sma(low_0, 6))在训练集适应度值为0.8338682778508668
    因子sma(wap_3_vwap_buy, 3)在训练集适应度值为0.828682250393938
    因子cov(amount_0, high_0, 6)在训练集适应度值为0.6680434976056022
    因子prod(open_0, 9)在训练集适应度值为0.869169461817944
    因子standardation(ts_max(wap_3_vwap_buy, 3))在训练集适应度值为0.8383507505397471
    因子vsub(ts_rank(close_0, 8), min(turn_0, wap_3_vwap_buy))在训练集适应度值为0.5737397502018435
    因子power(high_0, high_0)在训练集适应度值为0.7922422900875445
    
    因子sma(standardation(return_0), constant(3))在测试集适应度值为1.8014644530165738
    
    pass:1, record:10, population: 1
    
    下一代挖掘的个体数:10
    
    -- 开始第「1」次循环第「2」代挖掘 --
    
    去重前的个体数10
    去重后的个体数8
    
    每代的平均适应度:[0.014992363024151838, -0.19277371635515714]
    因子sma(standardation(return_0), 3)在训练集适应度值为0.608536374526242
    因子sma(high_0, constant(3))在训练集适应度值为0.8271665269337954
    因子sma(standardation(return_0), constant(3))在训练集适应度值为0.608536374526242
    因子sma(close_0, constant(3))在训练集适应度值为0.8306588530067993
    因子sma(rank(return_0), constant(4))在训练集适应度值为0.1473770140143686
    因子clear_by_cond(return_0, high_0, wap_3_vwap_buy)在训练集适应度值为-0.40450131974237
    因子sma(standardation(standardation(return_0)), constant(3))在训练集适应度值为0.608536374526242
    因子sma(return_0, 3)在训练集适应度值为0.09948989298774549
    
    pass:0, record:8, population: 8
    
    下一代挖掘的个体数:10
    
    -- 开始第「1」次循环第「3」代挖掘 --
    
    去重前的个体数10
    去重后的个体数9
    
    每代的平均适应度:[0.014992363024151838, -0.19277371635515714, -0.07490728778450059]
    因子sma(return_0, constant(4))在训练集适应度值为0.608177547724697
    因子sma(standardation(standardation(close_0)), constant(3))在训练集适应度值为0.8304277912617549
    因子sma(mean2(open_0, amount_0), constant(2))在训练集适应度值为0.5153648897672801
    因子sma(high_0, 3)在训练集适应度值为0.8271665269337954
    因子sma(close_0, 3)在训练集适应度值为0.8306588530067993
    因子sma(standardation(standardation(return_0)), constant(3))在训练集适应度值为0.608536374526242
    因子sma(high_0, constant(3))在训练集适应度值为0.8271665269337954
    因子sma(high_0, 4)在训练集适应度值为0.8202732148700856
    因子sma(close_0, 2)在训练集适应度值为0.8456432736126808
    
    pass:0, record:9, population: 9
    
    下一代挖掘的个体数:10
    
    -- 开始第「2」次循环第「1」代挖掘 --
    
    去重前的个体数10
    去重后的个体数10
    
    每代的平均适应度:[-0.018779241638940965]
    因子min(min(wap_3_vwap_buy, close_0), cov(wap_3_vwap_buy, return_0, 10))在训练集适应度值为1.792060973612757
    因子ts_min(return_0, 10)在训练集适应度值为0.6429795824874913
    因子standardation(amount_0)在训练集适应度值为0.8324821918315465
    因子vdiv(wap_3_vwap_buy, open_0)在训练集适应度值为1.7068164083094257
    因子argmax(vneg(return_0), constant(9))在训练集适应度值为0.797080746385853
    因子mean2(close_0, wap_3_vwap_buy)在训练集适应度值为0.8379155001549915
    因子min(open_0, open_0)在训练集适应度值为0.8167695479833765
    因子if_then_else(open_0, open_0, turn_0, wap_3_vwap_buy)在训练集适应度值为0.8407540998317315
    因子sma(high_0, 5)在训练集适应度值为0.8147897062604205
    因子sign(low_0)在训练集适应度值为nan
    
    pass:0, record:10, population: 10
    
    下一代挖掘的个体数:10
    
    -- 开始第「2」次循环第「2」代挖掘 --
    
    去重前的个体数10
    去重后的个体数8
    
    每代的平均适应度:[-0.018779241638940965, 0.03550155009401186]
    因子vdiv(close_0, turn_0)在训练集适应度值为0.6798557562281556
    因子min(min(wap_3_vwap_buy, wap_3_vwap_buy), return_0)在训练集适应度值为1.9748884537233056
    因子standardation(mean3(delta(close_0, 9), delay(open_0, 6), sign(return_0)))在训练集适应度值为0.9096297377293028
    因子min(return_0, open_0)在训练集适应度值为2.1307065969560974
    因子sma(turn_0, 5)在训练集适应度值为0.5644559519131452
    因子mean2(turn_0, wap_3_vwap_buy)在训练集适应度值为0.8908015199936777
    因子min(ts_max(low_0, 1), cov(wap_3_vwap_buy, return_0, 10))在训练集适应度值为1.7828513339325067
    因子min(open_0, open_0)在训练集适应度值为0.8167695479833765
    
    因子min(return_0, open_0)在测试集适应度值为1.1433017597984974
    
    pass:1, record:8, population: 1
    
    下一代挖掘的个体数:10
    
    -- 开始第「2」次循环第「3」代挖掘 --
    
    去重前的个体数10
    去重后的个体数4
    
    每代的平均适应度:[-0.018779241638940965, 0.03550155009401186, 0.09983868776809751]
    因子min(open_0, open_0)在训练集适应度值为0.8167695479833765
    因子min(return_0, return_0)在训练集适应度值为2.1311511112052175
    因子min(return_0, open_0)在训练集适应度值为2.1307065969560974
    因子min(min(min(amount_0, high_0), standardation(turn_0)), open_0)在训练集适应度值为0.7521329267996869
    
    因子min(return_0, return_0)在测试集适应度值为1.1484387405338683
    因子min(return_0, open_0)在测试集适应度值为1.1433017597984974
    
    pass:2, record:4, population: 2
    
    下一代挖掘的个体数:10