复制链接
克隆策略

    {"description":"实验创建于2022/8/24","graph":{"edges":[{"to_node_id":"-483:instruments","from_node_id":"-383:data"},{"to_node_id":"-483:features","from_node_id":"-399:data"},{"to_node_id":"-105:features","from_node_id":"-399:data"},{"to_node_id":"-105:input_data","from_node_id":"-483:data"},{"to_node_id":"-114:input_ds","from_node_id":"-105:data"}],"nodes":[{"node_id":"-383","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2022-08-09","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2022-08-25","type":"Literal","bound_global_parameter":null},{"name":"market","value":"CN_STOCK_A","type":"Literal","bound_global_parameter":null},{"name":"instrument_list","value":"002472.SZA\n002176.SZA\n002838.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":"-383"}],"output_ports":[{"name":"data","node_id":"-383"}],"cacheable":true,"seq_num":1,"comment":"","comment_collapsed":true},{"node_id":"-399","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\ndate\ninstrument\nopen_0\nclose_0\nlow_0\nhigh_0\nadjust_factor_0\nopen_actual=open_0/adjust_factor_0\nhigh_actual=high_0/adjust_factor_0\nlow_actual=low_0/adjust_factor_0\nclose_actual=close_0/adjust_factor_0\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-399"}],"output_ports":[{"name":"data","node_id":"-399"}],"cacheable":true,"seq_num":3,"comment":"","comment_collapsed":true},{"node_id":"-483","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":"10","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-483"},{"name":"features","node_id":"-483"}],"output_ports":[{"name":"data","node_id":"-483"}],"cacheable":true,"seq_num":4,"comment":"","comment_collapsed":true},{"node_id":"-105","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":"-105"},{"name":"features","node_id":"-105"}],"output_ports":[{"name":"data","node_id":"-105"}],"cacheable":true,"seq_num":2,"comment":"","comment_collapsed":true},{"node_id":"-114","module_id":"BigQuantSpace.sort.sort-v5","parameters":[{"name":"sort_by","value":"date","type":"Literal","bound_global_parameter":null},{"name":"group_by","value":"instrument","type":"Literal","bound_global_parameter":null},{"name":"keep_columns","value":"--","type":"Literal","bound_global_parameter":null},{"name":"ascending","value":"True","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_ds","node_id":"-114"},{"name":"sort_by_ds","node_id":"-114"}],"output_ports":[{"name":"sorted_data","node_id":"-114"}],"cacheable":true,"seq_num":5,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-383' Position='73,-137,200,200'/><node_position Node='-399' Position='392,-131,200,200'/><node_position Node='-483' Position='292,-4,200,200'/><node_position Node='-105' Position='294,115,200,200'/><node_position Node='-114' Position='292,216,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
    In [4]:
    # 本代码由可视化策略环境自动生成 2022年8月27日 13:30
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    m1 = M.instruments.v2(
        start_date='2022-08-09',
        end_date='2022-08-25',
        market='CN_STOCK_A',
        instrument_list="""002472.SZA
    002176.SZA
    002838.SZA""",
        max_count=0
    )
    
    m3 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    date
    instrument
    open_0
    close_0
    low_0
    high_0
    adjust_factor_0
    open_actual=open_0/adjust_factor_0
    high_actual=high_0/adjust_factor_0
    low_actual=low_0/adjust_factor_0
    close_actual=close_0/adjust_factor_0
    """
    )
    
    m4 = M.general_feature_extractor.v7(
        instruments=m1.data,
        features=m3.data,
        start_date='',
        end_date='',
        before_start_days=10
    )
    
    m2 = 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={}
    )
    
    m5 = M.sort.v5(
        input_ds=m2.data,
        sort_by='date',
        group_by='instrument',
        keep_columns='--',
        ascending=True
    )
    
    In [8]:
    m5.data.read()
    
    ---------------------------------------------------------------------------
    AttributeError                            Traceback (most recent call last)
    <ipython-input-8-651a175db7e3> in <module>
    ----> 1 m5.data.read()
    
    AttributeError: 'Outputs' object has no attribute 'data'