复制链接
克隆策略

    {"description":"实验创建于2018/6/27","graph":{"edges":[{"to_node_id":"-353:instruments","from_node_id":"-51:data"},{"to_node_id":"-353:features","from_node_id":"-59:data"},{"to_node_id":"-360:features","from_node_id":"-59:data"},{"to_node_id":"-1372:input_1","from_node_id":"-353:data"},{"to_node_id":"-1771:input_data","from_node_id":"-360:data"},{"to_node_id":"-443:input_data","from_node_id":"-220:data"},{"to_node_id":"-220:instruments","from_node_id":"-226:data"},{"to_node_id":"-220:features","from_node_id":"-234:data"},{"to_node_id":"-443:features","from_node_id":"-234:data"},{"to_node_id":"-2883:input_1","from_node_id":"-443:data"},{"to_node_id":"-360:input_data","from_node_id":"-1372:data"},{"to_node_id":"-2883:input_2","from_node_id":"-2864:data"},{"to_node_id":"-2864:instruments","from_node_id":"-2870:data"},{"to_node_id":"-2864:features","from_node_id":"-2878:data"},{"to_node_id":"-1372:input_2","from_node_id":"-2883:data"}],"nodes":[{"node_id":"-51","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2021-12-21","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2022-01-04","type":"Literal","bound_global_parameter":"交易日期"},{"name":"market","value":"CN_STOCK_A","type":"Literal","bound_global_parameter":null},{"name":"instrument_list","value":"000001.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":"-51"}],"output_ports":[{"name":"data","node_id":"-51"}],"cacheable":true,"seq_num":1,"comment":"","comment_collapsed":true},{"node_id":"-59","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"close_0\nclose_min=ts_min(close_0,10)","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-59"}],"output_ports":[{"name":"data","node_id":"-59"}],"cacheable":true,"seq_num":2,"comment":"","comment_collapsed":true},{"node_id":"-353","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":"0","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-353"},{"name":"features","node_id":"-353"}],"output_ports":[{"name":"data","node_id":"-353"}],"cacheable":false,"seq_num":5,"comment":"","comment_collapsed":true},{"node_id":"-360","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":"True","type":"Literal","bound_global_parameter":null},{"name":"user_functions","value":"{}","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_data","node_id":"-360"},{"name":"features","node_id":"-360"}],"output_ports":[{"name":"data","node_id":"-360"}],"cacheable":true,"seq_num":7,"comment":"","comment_collapsed":true},{"node_id":"-220","module_id":"BigQuantSpace.use_datasource.use_datasource-v1","parameters":[{"name":"datasource_id","value":"bar1d_index_CN_STOCK_A","type":"Literal","bound_global_parameter":null},{"name":"start_date","value":"","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-220"},{"name":"features","node_id":"-220"}],"output_ports":[{"name":"data","node_id":"-220"}],"cacheable":true,"seq_num":4,"comment":"","comment_collapsed":true},{"node_id":"-226","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2010-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2050-12-30","type":"Literal","bound_global_parameter":null},{"name":"market","value":"CN_STOCK_A","type":"Literal","bound_global_parameter":null},{"name":"instrument_list","value":"000002.HIX","type":"Literal","bound_global_parameter":null},{"name":"max_count","value":0,"type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"rolling_conf","node_id":"-226"}],"output_ports":[{"name":"data","node_id":"-226"}],"cacheable":true,"seq_num":10,"comment":"","comment_collapsed":true},{"node_id":"-234","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nzs_zhangf=(close-open)/open\nzs_huiluo=(high-close)/close\nzs_huishen=(close-low)/low\nzs_zhenf=(high-low)/shift(close,1)\nzs_volume_zf=volume/shift(volume,1)\nzs_return_0=close/shift(close,1)\nzs_return_1=shift(zs_return_0,1)\nzs_return_2=shift(zs_return_0,2)\nzs_max10=ts_max(close,10)\nzs_max10d=ts_argmax(close,10)\nzs_max30=ts_max(close,30)\n#zs_max30d=ts_argmax(close,30)\nzs_min10=ts_min(close,10)\n#zs_min10d=ts_argmin(close,10)\nzs_min30=ts_min(close,30)\n#zs_min30d=ts_argmin(close,30)\nzs_priceHighBl10=close/zs_max10\nzs_priceLowBl10=close/zs_min10\nzs_priceHighBl30=close/zs_max30\nzs_priceLowBl30=close/zs_min30","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-234"}],"output_ports":[{"name":"data","node_id":"-234"}],"cacheable":true,"seq_num":12,"comment":"","comment_collapsed":true},{"node_id":"-443","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":"True","type":"Literal","bound_global_parameter":null},{"name":"user_functions","value":"{}","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_data","node_id":"-443"},{"name":"features","node_id":"-443"}],"output_ports":[{"name":"data","node_id":"-443"}],"cacheable":true,"seq_num":13,"comment":"","comment_collapsed":true},{"node_id":"-1372","module_id":"BigQuantSpace.data_join.data_join-v3","parameters":[{"name":"on","value":"date","type":"Literal","bound_global_parameter":null},{"name":"how","value":"left","type":"Literal","bound_global_parameter":null},{"name":"sort","value":"False","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_1","node_id":"-1372"},{"name":"input_2","node_id":"-1372"}],"output_ports":[{"name":"data","node_id":"-1372"}],"cacheable":true,"seq_num":14,"comment":"","comment_collapsed":true},{"node_id":"-2864","module_id":"BigQuantSpace.use_datasource.use_datasource-v1","parameters":[{"name":"datasource_id","value":"bar1d_index_CN_STOCK_A","type":"Literal","bound_global_parameter":null},{"name":"start_date","value":"","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-2864"},{"name":"features","node_id":"-2864"}],"output_ports":[{"name":"data","node_id":"-2864"}],"cacheable":true,"seq_num":17,"comment":"","comment_collapsed":true},{"node_id":"-2870","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2020-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2050-12-30","type":"Literal","bound_global_parameter":null},{"name":"market","value":"CN_STOCK_A","type":"Literal","bound_global_parameter":null},{"name":"instrument_list","value":"000002.HIX","type":"Literal","bound_global_parameter":null},{"name":"max_count","value":0,"type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"rolling_conf","node_id":"-2870"}],"output_ports":[{"name":"data","node_id":"-2870"}],"cacheable":true,"seq_num":18,"comment":"","comment_collapsed":true},{"node_id":"-2878","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nclose\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-2878"}],"output_ports":[{"name":"data","node_id":"-2878"}],"cacheable":true,"seq_num":19,"comment":"","comment_collapsed":true},{"node_id":"-2883","module_id":"BigQuantSpace.data_join.data_join-v3","parameters":[{"name":"on","value":"date","type":"Literal","bound_global_parameter":null},{"name":"how","value":"left","type":"Literal","bound_global_parameter":null},{"name":"sort","value":"False","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_1","node_id":"-2883"},{"name":"input_2","node_id":"-2883"}],"output_ports":[{"name":"data","node_id":"-2883"}],"cacheable":true,"seq_num":20,"comment":"","comment_collapsed":true},{"node_id":"-1771","module_id":"BigQuantSpace.filter.filter-v3","parameters":[{"name":"expr","value":"close_min>0","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":"-1771"}],"output_ports":[{"name":"data","node_id":"-1771"},{"name":"left_data","node_id":"-1771"}],"cacheable":true,"seq_num":23,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-51' Position='67,18,200,200'/><node_position Node='-59' Position='398,106,200,200'/><node_position Node='-353' Position='79,201,200,200'/><node_position Node='-360' Position='405.5657958984375,487,200,200'/><node_position Node='-220' Position='801,-38,200,200'/><node_position Node='-226' Position='661,-179,200,200'/><node_position Node='-234' Position='1073,-162,200,200'/><node_position Node='-443' Position='1043,144,200,200'/><node_position Node='-1372' Position='639,326,200,200'/><node_position Node='-2864' Position='1340,90,200,200'/><node_position Node='-2870' Position='1137,-23,200,200'/><node_position Node='-2878' Position='1525,-22,200,200'/><node_position Node='-2883' Position='1092,261,200,200'/><node_position Node='-1771' Position='506,669,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
    In [22]:
    # 本代码由可视化策略环境自动生成 2022年1月5日 00:42
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    m1 = M.instruments.v2(
        start_date='2021-12-21',
        end_date=T.live_run_param('trading_date', '2022-01-04'),
        market='CN_STOCK_A',
        instrument_list='000001.SZA',
        max_count=0
    )
    
    m2 = M.input_features.v1(
        features="""close_0
    close_min=ts_min(close_0,10)"""
    )
    
    m5 = M.general_feature_extractor.v7(
        instruments=m1.data,
        features=m2.data,
        start_date='',
        end_date='',
        before_start_days=0,
        m_cached=False
    )
    
    m10 = M.instruments.v2(
        start_date='2010-01-01',
        end_date='2050-12-30',
        market='CN_STOCK_A',
        instrument_list='000002.HIX',
        max_count=0
    )
    
    m12 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    zs_zhangf=(close-open)/open
    zs_huiluo=(high-close)/close
    zs_huishen=(close-low)/low
    zs_zhenf=(high-low)/shift(close,1)
    zs_volume_zf=volume/shift(volume,1)
    zs_return_0=close/shift(close,1)
    zs_return_1=shift(zs_return_0,1)
    zs_return_2=shift(zs_return_0,2)
    zs_max10=ts_max(close,10)
    zs_max10d=ts_argmax(close,10)
    zs_max30=ts_max(close,30)
    #zs_max30d=ts_argmax(close,30)
    zs_min10=ts_min(close,10)
    #zs_min10d=ts_argmin(close,10)
    zs_min30=ts_min(close,30)
    #zs_min30d=ts_argmin(close,30)
    zs_priceHighBl10=close/zs_max10
    zs_priceLowBl10=close/zs_min10
    zs_priceHighBl30=close/zs_max30
    zs_priceLowBl30=close/zs_min30"""
    )
    
    m4 = M.use_datasource.v1(
        instruments=m10.data,
        features=m12.data,
        datasource_id='bar1d_index_CN_STOCK_A',
        start_date='',
        end_date=''
    )
    
    m13 = M.derived_feature_extractor.v3(
        input_data=m4.data,
        features=m12.data,
        date_col='date',
        instrument_col='instrument',
        drop_na=False,
        remove_extra_columns=True,
        user_functions={}
    )
    
    m18 = M.instruments.v2(
        start_date='2020-01-01',
        end_date='2050-12-30',
        market='CN_STOCK_A',
        instrument_list='000002.HIX',
        max_count=0
    )
    
    m19 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    close
    """
    )
    
    m17 = M.use_datasource.v1(
        instruments=m18.data,
        features=m19.data,
        datasource_id='bar1d_index_CN_STOCK_A',
        start_date='',
        end_date=''
    )
    
    m20 = M.data_join.v3(
        input_1=m13.data,
        input_2=m17.data,
        on='date',
        how='left',
        sort=False
    )
    
    m14 = M.data_join.v3(
        input_1=m5.data,
        input_2=m20.data,
        on='date',
        how='left',
        sort=False
    )
    
    m7 = M.derived_feature_extractor.v3(
        input_data=m14.data,
        features=m2.data,
        date_col='date',
        instrument_col='instrument',
        drop_na=False,
        remove_extra_columns=True,
        user_functions={}
    )
    
    m23 = M.filter.v3(
        input_data=m7.data,
        expr='close_min>0',
        output_left_data=False
    )