复制链接
克隆策略

    {"description":"实验创建于2021/12/10","graph":{"edges":[{"to_node_id":"-82:input_data","from_node_id":"-71:data"},{"to_node_id":"-82:features","from_node_id":"-77:data"}],"nodes":[{"node_id":"-71","module_id":"BigQuantSpace.use_datasource.use_datasource-v1","parameters":[{"name":"datasource_id","value":"bar1d_CN_STOCK_A","type":"Literal","bound_global_parameter":null},{"name":"start_date","value":"2021-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2021-11-01","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-71"},{"name":"features","node_id":"-71"}],"output_ports":[{"name":"data","node_id":"-71"}],"cacheable":true,"seq_num":4,"comment":"","comment_collapsed":true},{"node_id":"-77","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nclose/open\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-77"}],"output_ports":[{"name":"data","node_id":"-77"}],"cacheable":true,"seq_num":1,"comment":"","comment_collapsed":true},{"node_id":"-82","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":"-82"},{"name":"features","node_id":"-82"}],"output_ports":[{"name":"data","node_id":"-82"}],"cacheable":true,"seq_num":2,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-71' Position='448,224.1999969482422,200,200'/><node_position Node='-77' Position='571,101.59999084472656,200,200'/><node_position Node='-82' Position='531,318.20001220703125,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
    In [6]:
    # 本代码由可视化策略环境自动生成 2021年12月10日 13:58
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    m4 = M.use_datasource.v1(
        datasource_id='bar1d_CN_STOCK_A',
        start_date='2021-01-01',
        end_date='2021-11-01'
    )
    
    m1 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    close/open
    """
    )
    
    m2 = M.derived_feature_extractor.v3(
        input_data=m4.data,
        features=m1.data,
        date_col='date',
        instrument_col='instrument',
        drop_na=False,
        remove_extra_columns=False,
        user_functions={}
    )
    
    In [9]:
    m4.data.read()
    
    Out[9]:
    turn adjust_factor instrument date open volume low deal_number close high amount
    0 2.686891 3.915415 000722.SZA 2021-01-04 26.898901 12471426.0 26.663977 6892.0 27.760292 27.916908 87663674.0
    1 7.961392 4.937361 002046.SZA 2021-01-04 49.373611 32538155.0 49.126743 26896.0 50.361084 52.286652 332695734.0
    2 2.193586 1.540059 002850.SZA 2021-01-04 153.235870 2851932.0 150.740982 6866.0 159.226700 159.226700 293263360.0
    3 2.888424 7.744529 000026.SZA 2021-01-04 87.745514 10303482.0 87.358284 19442.0 91.617775 94.250916 120609775.0
    4 5.151482 1.021275 603195.SHA 2021-01-04 210.382645 3090889.0 205.286484 14026.0 222.852417 224.680496 654219280.0
    ... ... ... ... ... ... ... ... ... ... ... ...
    861623 1.435891 4.257441 002600.SZA 2021-11-01 28.439707 100558033.0 28.269409 55714.0 29.248619 29.504066 681486413.0
    861624 0.407315 1.092889 002958.SZA 2021-11-01 4.185765 11020323.0 4.163907 6035.0 4.196694 4.207623 42271131.0
    861625 0.825210 6.443048 000606.SZA 2021-11-01 12.241791 5835900.0 12.112930 1269.0 12.241791 12.306222 11065411.0
    861626 12.235419 1.000000 688211.SHA 2021-11-01 74.449997 3745026.0 70.330002 8488.0 71.910004 74.449997 269078122.0
    861627 0.393674 1.425570 603268.SHA 2021-11-01 21.825478 488820.0 21.383551 938.0 21.925266 22.281658 7497255.0

    861628 rows × 11 columns

    In [ ]: