复制链接
克隆策略

    {"description":"实验创建于2017/8/26","graph":{"edges":[{"to_node_id":"-95:features","from_node_id":"-114:data"}],"nodes":[{"node_id":"-95","module_id":"BigQuantSpace.factorlens_futures.factorlens_futures-v1","parameters":[{"name":"start_date","value":"2021-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2021-12-31","type":"Literal","bound_global_parameter":null},{"name":"instrument_list","value":"","type":"Literal","bound_global_parameter":null},{"name":"category","value":"主力连续","type":"Literal","bound_global_parameter":null},{"name":"product_filter","value":"['FB']","type":"Literal","bound_global_parameter":null},{"name":"exchange_filter","value":"%7B%22enumItems%22%3A%5B%7B%22value%22%3A%22%E6%89%80%E6%9C%89%22%2C%22displayValue%22%3A%22%E6%89%80%E6%9C%89%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E4%B8%AD%E9%87%91%E6%89%80%22%2C%22displayValue%22%3A%22%E4%B8%AD%E9%87%91%E6%89%80%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%B8%8A%E6%9C%9F%E6%89%80%22%2C%22displayValue%22%3A%22%E4%B8%8A%E6%9C%9F%E6%89%80%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%A4%A7%E5%95%86%E6%89%80%22%2C%22displayValue%22%3A%22%E5%A4%A7%E5%95%86%E6%89%80%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%83%91%E5%95%86%E6%89%80%22%2C%22displayValue%22%3A%22%E9%83%91%E5%95%86%E6%89%80%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%B8%8A%E6%9C%9F%E8%83%BD%E6%BA%90%22%2C%22displayValue%22%3A%22%E4%B8%8A%E6%9C%9F%E8%83%BD%E6%BA%90%22%2C%22selected%22%3Afalse%7D%5D%7D","type":"Literal","bound_global_parameter":null},{"name":"rebalance_period","value":"22","type":"Literal","bound_global_parameter":null},{"name":"quantile_type","value":"按层数(展示所有层)","type":"Literal","bound_global_parameter":null},{"name":"quantile_num","value":"5","type":"Literal","bound_global_parameter":null},{"name":"buy_commission_rate","value":0.0005,"type":"Literal","bound_global_parameter":null},{"name":"sell_commission_rate","value":0.0005,"type":"Literal","bound_global_parameter":null},{"name":"ic_method","value":"Rank_IC","type":"Literal","bound_global_parameter":null},{"name":"per_contract_cash","value":2000000,"type":"Literal","bound_global_parameter":null},{"name":"contract_commission_rate","value":"True","type":"Literal","bound_global_parameter":null},{"name":"is_winsorize","value":"True","type":"Literal","bound_global_parameter":null},{"name":"is_standardlize","value":"True","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features","node_id":"-95"},{"name":"factor_data","node_id":"-95"}],"output_ports":[{"name":"data_1","node_id":"-95"},{"name":"data_2","node_id":"-95"},{"name":"data_3","node_id":"-95"}],"cacheable":true,"seq_num":2,"comment":"","comment_collapsed":true},{"node_id":"-114","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nclose_0","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-114"}],"output_ports":[{"name":"data","node_id":"-114"}],"cacheable":true,"seq_num":3,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-95' Position='385.38580322265625,638.7864379882812,200,200'/><node_position Node='-114' Position='383.6282958984375,484.8269958496094,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
    In [12]:
    # 本代码由可视化策略环境自动生成 2023年4月11日 15:20
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    m3 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    close_0"""
    )
    
    m2 = M.factorlens_futures.v1(
        features=m3.data,
        start_date='2021-01-01',
        end_date='2021-12-31',
        instrument_list='',
        category='主力连续',
        product_filter=['FB'],
        exchange_filter=['所有'],
        rebalance_period=22,
        quantile_type='按层数(展示所有层)',
        quantile_num='5',
        buy_commission_rate=0.0005,
        sell_commission_rate=0.0005,
        ic_method='Rank_IC',
        per_contract_cash=2000000,
        contract_commission_rate=True,
        is_winsorize=True,
        is_standardlize=True
    )
    
    ---------------------------------------------------------------------------
    KeyError                                  Traceback (most recent call last)
    <ipython-input-12-6ebdb7800abc> in <module>
         10 )
         11 
    ---> 12 m2 = M.factorlens_futures.v1(
         13     features=m3.data,
         14     start_date='2021-01-01',
    
    KeyError: "['close_0'] not in index"