复制链接
克隆策略

    {"description":"实验创建于2023/5/3","graph":{"edges":[{"to_node_id":"-44:instruments","from_node_id":"-31:data"},{"to_node_id":"-44:features","from_node_id":"-39:data"},{"to_node_id":"-51:features","from_node_id":"-39:data"},{"to_node_id":"-51:input_data","from_node_id":"-44:data"}],"nodes":[{"node_id":"-31","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2023-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2023-05-01","type":"Literal","bound_global_parameter":null},{"name":"market","value":"CN_STOCK_A","type":"Literal","bound_global_parameter":null},{"name":"instrument_list","value":"300896.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":"-31"}],"output_ports":[{"name":"data","node_id":"-31"}],"cacheable":true,"seq_num":5,"comment":"","comment_collapsed":true},{"node_id":"-39","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"# 低估值\n#ts_rank(pe_ttm_0, 1000)\n# 低负债\n#fs_total_liability_0/market_cap_0\n# 高增长 连续3年净利润 30% 以上. 暂时不加吧,会过滤掉很多涨的好的股\n# 毕竟股票涨跌 靠 预期差 和 估值\n#fs_eps_yoy_0\nfs_quarter_index_0\nwest_eps_ftm_0\nfs_net_profit_yoy_0","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-39"}],"output_ports":[{"name":"data","node_id":"-39"}],"cacheable":true,"seq_num":6,"comment":"","comment_collapsed":true},{"node_id":"-44","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":"15","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-44"},{"name":"features","node_id":"-44"}],"output_ports":[{"name":"data","node_id":"-44"}],"cacheable":true,"seq_num":7,"comment":"","comment_collapsed":true},{"node_id":"-51","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":"True","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":"-51"},{"name":"features","node_id":"-51"}],"output_ports":[{"name":"data","node_id":"-51"}],"cacheable":true,"seq_num":8,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-31' Position='538,131,200,200'/><node_position Node='-39' Position='874,126,200,200'/><node_position Node='-44' Position='698,249,200,200'/><node_position Node='-51' Position='713,364,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
    In [7]:
    # 本代码由可视化策略环境自动生成 2023年5月7日 18:31
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    m5 = M.instruments.v2(
        start_date='2023-01-01',
        end_date='2023-05-01',
        market='CN_STOCK_A',
        instrument_list='300896.SZA',
        max_count=0
    )
    
    m6 = M.input_features.v1(
        features="""# 低估值
    #ts_rank(pe_ttm_0, 1000)
    # 低负债
    #fs_total_liability_0/market_cap_0
    # 高增长 连续3年净利润 30% 以上. 暂时不加吧,会过滤掉很多涨的好的股
    # 毕竟股票涨跌 靠 预期差 和 估值
    #fs_eps_yoy_0
    fs_quarter_index_0
    west_eps_ftm_0
    fs_net_profit_yoy_0"""
    )
    
    m7 = M.general_feature_extractor.v7(
        instruments=m5.data,
        features=m6.data,
        start_date='',
        end_date='',
        before_start_days=15
    )
    
    m8 = M.derived_feature_extractor.v3(
        input_data=m7.data,
        features=m6.data,
        date_col='date',
        instrument_col='instrument',
        drop_na=True,
        remove_extra_columns=True,
        user_functions={}
    )
    
    In [8]:
    #m4.data.read_df().isnull().sum()
    pd.set_option('display.max_rows', None)
    m8.data.read_df()
    
    Out[8]:
    date instrument fs_quarter_index_0 west_eps_ftm_0 fs_net_profit_yoy_0