复制链接
克隆策略

    {"description":"实验创建于2021/12/20","graph":{"edges":[{"to_node_id":"-1404:features","from_node_id":"-1391:data"},{"to_node_id":"-1404:instruments","from_node_id":"-1395:data"},{"to_node_id":"-1357:input_1","from_node_id":"-1404:data"}],"nodes":[{"node_id":"-1357","module_id":"BigQuantSpace.betaindex_build.betaindex_build-v1","parameters":[{"name":"factor_name","value":"return_5","type":"Literal","bound_global_parameter":null},{"name":"factor_direction","value":1,"type":"Literal","bound_global_parameter":null},{"name":"rebalance_days","value":1,"type":"Literal","bound_global_parameter":null},{"name":"cost","value":0.0008,"type":"Literal","bound_global_parameter":null},{"name":"stock_num","value":"1","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_1","node_id":"-1357"}],"output_ports":[{"name":"data_1","node_id":"-1357"},{"name":"data_2","node_id":"-1357"},{"name":"data_3","node_id":"-1357"}],"cacheable":true,"seq_num":1,"comment":"","comment_collapsed":true},{"node_id":"-1391","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nreturn_5\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-1391"}],"output_ports":[{"name":"data","node_id":"-1391"}],"cacheable":true,"seq_num":2,"comment":"","comment_collapsed":true},{"node_id":"-1395","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2021-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2021-10-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":"-1395"}],"output_ports":[{"name":"data","node_id":"-1395"}],"cacheable":true,"seq_num":3,"comment":"","comment_collapsed":true},{"node_id":"-1404","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":"-1404"},{"name":"features","node_id":"-1404"}],"output_ports":[{"name":"data","node_id":"-1404"}],"cacheable":true,"seq_num":4,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-1357' Position='395,420,200,200'/><node_position Node='-1391' Position='516,119,200,200'/><node_position Node='-1395' Position='89,130,200,200'/><node_position Node='-1404' Position='331,263,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
    In [18]:
    # 本代码由可视化策略环境自动生成 2021年12月20日 18:41
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    m2 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    return_5
    """
    )
    
    m3 = M.instruments.v2(
        start_date='2021-01-01',
        end_date='2021-10-01',
        market='CN_STOCK_A',
        instrument_list='',
        max_count=0
    )
    
    m4 = M.general_feature_extractor.v7(
        instruments=m3.data,
        features=m2.data,
        start_date='',
        end_date='',
        before_start_days=90
    )
    
    m1 = M.betaindex_build.v1(
        input_1=m4.data,
        factor_name='return_5',
        factor_direction=1,
        rebalance_days=1,
        cost=0.0008,
        stock_num=1
    )
    
    In [19]:
    m1.data_1.read()
    
    Out[19]:
    date ret
    0 2020-10-12 0.018274
    1 2020-10-13 0.048924
    2 2020-10-14 0.099323
    3 2020-10-15 0.099144
    4 2020-10-16 0.099200
    ... ... ...
    236 2021-09-24 0.099002
    237 2021-09-27 -0.100560
    238 2021-09-28 -0.043345
    239 2021-09-29 -0.100651
    240 2021-09-30 -0.024610

    241 rows × 2 columns

    In [20]:
    m1.data_2.read()
    
    Out[20]:
    'return_5'