复制链接
克隆策略

    {"description":"实验创建于2022/3/7","graph":{"edges":[{"to_node_id":"-155:data1","from_node_id":"-142:data"},{"to_node_id":"-330:instruments","from_node_id":"-142:data"},{"to_node_id":"-330:features","from_node_id":"-150:data"},{"to_node_id":"-2032:features","from_node_id":"-150:data"},{"to_node_id":"-162:input_data","from_node_id":"-155:data"},{"to_node_id":"-2032:input_data","from_node_id":"-330:data"},{"to_node_id":"-150:features_ds","from_node_id":"-513:data"},{"to_node_id":"-155:data2","from_node_id":"-2032:data"}],"nodes":[{"node_id":"-142","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2020-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2021-01-01","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":"-142"}],"output_ports":[{"name":"data","node_id":"-142"}],"cacheable":true,"seq_num":1,"comment":"","comment_collapsed":true},{"node_id":"-150","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\ncond1 = ((price_limit_status_1 ==3) & (price_limit_status_2 < 3) & (price_limit_status_3 < 3) & (price_limit_status_4 < 3))","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-150"}],"output_ports":[{"name":"data","node_id":"-150"}],"cacheable":true,"seq_num":2,"comment":"","comment_collapsed":true},{"node_id":"-155","module_id":"BigQuantSpace.join.join-v3","parameters":[{"name":"on","value":"date,instrument","type":"Literal","bound_global_parameter":null},{"name":"how","value":"inner","type":"Literal","bound_global_parameter":null},{"name":"sort","value":"False","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"data1","node_id":"-155"},{"name":"data2","node_id":"-155"}],"output_ports":[{"name":"data","node_id":"-155"}],"cacheable":true,"seq_num":3,"comment":"","comment_collapsed":true},{"node_id":"-162","module_id":"BigQuantSpace.filter.filter-v3","parameters":[{"name":"expr","value":"cond1","type":"Literal","bound_global_parameter":null},{"name":"output_left_data","value":"False","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_data","node_id":"-162"}],"output_ports":[{"name":"data","node_id":"-162"},{"name":"left_data","node_id":"-162"}],"cacheable":true,"seq_num":4,"comment":"","comment_collapsed":true},{"node_id":"-330","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":"-330"},{"name":"features","node_id":"-330"}],"output_ports":[{"name":"data","node_id":"-330"}],"cacheable":true,"seq_num":5,"comment":"","comment_collapsed":true},{"node_id":"-513","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nhigh_1\nclose_0","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-513"}],"output_ports":[{"name":"data","node_id":"-513"}],"cacheable":true,"seq_num":7,"comment":"","comment_collapsed":true},{"node_id":"-2032","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":"-2032"},{"name":"features","node_id":"-2032"}],"output_ports":[{"name":"data","node_id":"-2032"}],"cacheable":true,"seq_num":6,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-142' Position='169,19,200,200'/><node_position Node='-150' Position='572.2533569335938,6.986488342285156,200,200'/><node_position Node='-155' Position='245.82205200195312,353.58221435546875,200,200'/><node_position Node='-162' Position='201,465,200,200'/><node_position Node='-330' Position='392,117,200,200'/><node_position Node='-513' Position='586.2089233398438,-110.71565246582031,200,200'/><node_position Node='-2032' Position='385.21337890625,236.69601440429688,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
    In [16]:
    # 本代码由可视化策略环境自动生成 2022年3月7日 10:50
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    m1 = M.instruments.v2(
        start_date='2020-01-01',
        end_date='2021-01-01',
        market='CN_STOCK_A',
        instrument_list='',
        max_count=0
    )
    
    m7 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    high_1
    close_0"""
    )
    
    m2 = M.input_features.v1(
        features_ds=m7.data,
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    cond1 = ((price_limit_status_1 ==3) & (price_limit_status_2 < 3) & (price_limit_status_3 < 3) & (price_limit_status_4 < 3))"""
    )
    
    m5 = M.general_feature_extractor.v7(
        instruments=m1.data,
        features=m2.data,
        start_date='',
        end_date='',
        before_start_days=90
    )
    
    m6 = M.derived_feature_extractor.v3(
        input_data=m5.data,
        features=m2.data,
        date_col='date',
        instrument_col='instrument',
        drop_na=False,
        remove_extra_columns=False,
        user_functions={}
    )
    
    m3 = M.join.v3(
        data1=m1.data,
        data2=m6.data,
        on='date,instrument',
        how='inner',
        sort=False
    )
    
    m4 = M.filter.v3(
        input_data=m3.data,
        expr='cond1',
        output_left_data=False
    )
    
    ---------------------------------------------------------------------------
    HDF5ExtError                              Traceback (most recent call last)
    <ipython-input-16-176fa92bcf50> in <module>
         35 )
         36 
    ---> 37 m3 = M.join.v3(
         38     data1=m1.data,
         39     data2=m5.data,
    
    HDF5ExtError: HDF5 error back trace
    
      File "H5F.c", line 509, in H5Fopen
        unable to open file
      File "H5Fint.c", line 1400, in H5F__open
        unable to open file
      File "H5Fint.c", line 1700, in H5F_open
        unable to read superblock
      File "H5Fsuper.c", line 411, in H5F__super_read
        file signature not found
    
    End of HDF5 error back trace
    
    Unable to open/create file '/var/app/data/bigquant/datasource/user/v3/d/c9/dc9a2ed5219348abb443895e4a487335T'