克隆策略

    {"description":"实验创建于2021/10/29","graph":{"edges":[{"to_node_id":"-202:features","from_node_id":"-225:data"},{"to_node_id":"-202:user_factor_data","from_node_id":"-586:data_1"}],"nodes":[{"node_id":"-202","module_id":"BigQuantSpace.factorlens.factorlens-v2","parameters":[{"name":"title","value":"因子分析: {factor_name}","type":"Literal","bound_global_parameter":null},{"name":"start_date","value":"2019-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2020-12-31","type":"Literal","bound_global_parameter":null},{"name":"rebalance_period","value":"5","type":"Literal","bound_global_parameter":null},{"name":"delay_rebalance_days","value":0,"type":"Literal","bound_global_parameter":null},{"name":"rebalance_price","value":"close_0","type":"Literal","bound_global_parameter":null},{"name":"stock_pool","value":"全市场","type":"Literal","bound_global_parameter":null},{"name":"quantile_count","value":5,"type":"Literal","bound_global_parameter":null},{"name":"commission_rate","value":0.0016,"type":"Literal","bound_global_parameter":null},{"name":"returns_calculation_method","value":"累乘","type":"Literal","bound_global_parameter":null},{"name":"benchmark","value":"无","type":"Literal","bound_global_parameter":null},{"name":"drop_new_stocks","value":60,"type":"Literal","bound_global_parameter":null},{"name":"drop_price_limit_stocks","value":"True","type":"Literal","bound_global_parameter":null},{"name":"drop_st_stocks","value":"True","type":"Literal","bound_global_parameter":null},{"name":"drop_suspended_stocks","value":"True","type":"Literal","bound_global_parameter":null},{"name":"normalization","value":"True","type":"Literal","bound_global_parameter":null},{"name":"neutralization","value":"%7B%22enumItems%22%3A%5B%7B%22value%22%3A%22%E8%A1%8C%E4%B8%9A%22%2C%22displayValue%22%3A%22%E8%A1%8C%E4%B8%9A%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E5%B8%82%E5%80%BC%22%2C%22displayValue%22%3A%22%E5%B8%82%E5%80%BC%22%2C%22selected%22%3Atrue%7D%5D%7D","type":"Literal","bound_global_parameter":null},{"name":"metrics","value":"%7B%22enumItems%22%3A%5B%7B%22value%22%3A%22%E5%9B%A0%E5%AD%90%E8%A1%A8%E7%8E%B0%E6%A6%82%E8%A7%88%22%2C%22displayValue%22%3A%22%E5%9B%A0%E5%AD%90%E8%A1%A8%E7%8E%B0%E6%A6%82%E8%A7%88%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E5%9B%A0%E5%AD%90%E5%88%86%E5%B8%83%22%2C%22displayValue%22%3A%22%E5%9B%A0%E5%AD%90%E5%88%86%E5%B8%83%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E5%9B%A0%E5%AD%90%E8%A1%8C%E4%B8%9A%E5%88%86%E5%B8%83%22%2C%22displayValue%22%3A%22%E5%9B%A0%E5%AD%90%E8%A1%8C%E4%B8%9A%E5%88%86%E5%B8%83%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E5%9B%A0%E5%AD%90%E5%B8%82%E5%80%BC%E5%88%86%E5%B8%83%22%2C%22displayValue%22%3A%22%E5%9B%A0%E5%AD%90%E5%B8%82%E5%80%BC%E5%88%86%E5%B8%83%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22IC%E5%88%86%E6%9E%90%22%2C%22displayValue%22%3A%22IC%E5%88%86%E6%9E%90%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E4%B9%B0%E5%85%A5%E4%BF%A1%E5%8F%B7%E9%87%8D%E5%90%88%E5%88%86%E6%9E%90%22%2C%22displayValue%22%3A%22%E4%B9%B0%E5%85%A5%E4%BF%A1%E5%8F%B7%E9%87%8D%E5%90%88%E5%88%86%E6%9E%90%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E5%9B%A0%E5%AD%90%E4%BC%B0%E5%80%BC%E5%88%86%E6%9E%90%22%2C%22displayValue%22%3A%22%E5%9B%A0%E5%AD%90%E4%BC%B0%E5%80%BC%E5%88%86%E6%9E%90%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E5%9B%A0%E5%AD%90%E6%8B%A5%E6%8C%A4%E5%BA%A6%E5%88%86%E6%9E%90%22%2C%22displayValue%22%3A%22%E5%9B%A0%E5%AD%90%E6%8B%A5%E6%8C%A4%E5%BA%A6%E5%88%86%E6%9E%90%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E5%9B%A0%E5%AD%90%E5%80%BC%E6%9C%80%E5%A4%A7%2F%E6%9C%80%E5%B0%8F%E8%82%A1%E7%A5%A8%22%2C%22displayValue%22%3A%22%E5%9B%A0%E5%AD%90%E5%80%BC%E6%9C%80%E5%A4%A7%2F%E6%9C%80%E5%B0%8F%E8%82%A1%E7%A5%A8%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E8%A1%A8%E8%BE%BE%E5%BC%8F%E5%9B%A0%E5%AD%90%E5%80%BC%22%2C%22displayValue%22%3A%22%E8%A1%A8%E8%BE%BE%E5%BC%8F%E5%9B%A0%E5%AD%90%E5%80%BC%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E5%A4%9A%E5%9B%A0%E5%AD%90%E7%9B%B8%E5%85%B3%E6%80%A7%E5%88%86%E6%9E%90%22%2C%22displayValue%22%3A%22%E5%A4%9A%E5%9B%A0%E5%AD%90%E7%9B%B8%E5%85%B3%E6%80%A7%E5%88%86%E6%9E%90%22%2C%22selected%22%3Atrue%7D%5D%7D","type":"Literal","bound_global_parameter":null},{"name":"factor_coverage","value":0.5,"type":"Literal","bound_global_parameter":null},{"name":"user_data_merge","value":"left","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features","node_id":"-202"},{"name":"user_factor_data","node_id":"-202"}],"output_ports":[{"name":"data","node_id":"-202"},{"name":"save_data","node_id":"-202"}],"cacheable":true,"seq_num":1,"comment":"","comment_collapsed":true},{"node_id":"-225","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"correlation(volume_0, close_0, 5)","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-225"}],"output_ports":[{"name":"data","node_id":"-225"}],"cacheable":true,"seq_num":2,"comment":"","comment_collapsed":true},{"node_id":"-586","module_id":"BigQuantSpace.cached.cached-v3","parameters":[{"name":"run","value":"# Python 代码入口函数,input_1/2/3 对应三个输入端,data_1/2/3 对应三个输出端\ndef bigquant_run(input_1, input_2, input_3):\n # 示例代码如下。在这里编写您的代码\n df = pd.DataFrame({'data': [1, 2, 3]})\n data_1 = DataSource.write_df(df)\n data_2 = DataSource.write_pickle(df)\n return Outputs(data_1=data_1, data_2=data_2, data_3=None)\n","type":"Literal","bound_global_parameter":null},{"name":"post_run","value":"# 后处理函数,可选。输入是主函数的输出,可以在这里对数据做处理,或者返回更友好的outputs数据格式。此函数输出不会被缓存。\ndef bigquant_run(outputs):\n return outputs\n","type":"Literal","bound_global_parameter":null},{"name":"input_ports","value":"","type":"Literal","bound_global_parameter":null},{"name":"params","value":"{}","type":"Literal","bound_global_parameter":null},{"name":"output_ports","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_1","node_id":"-586"},{"name":"input_2","node_id":"-586"},{"name":"input_3","node_id":"-586"}],"output_ports":[{"name":"data_1","node_id":"-586"},{"name":"data_2","node_id":"-586"},{"name":"data_3","node_id":"-586"}],"cacheable":true,"seq_num":3,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-202' Position='550,472,200,200'/><node_position Node='-225' Position='414.8639831542969,322.9278259277344,200,200'/><node_position Node='-586' Position='717.6090698242188,321.51953125,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
    In [2]:
    # 本代码由可视化策略环境自动生成 2021年10月29日 17:27
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    # Python 代码入口函数,input_1/2/3 对应三个输入端,data_1/2/3 对应三个输出端
    def m3_run_bigquant_run(input_1, input_2, input_3):
        # 示例代码如下。在这里编写您的代码
        df = pd.DataFrame({'data': [1, 2, 3]})
        data_1 = DataSource.write_df(df)
        data_2 = DataSource.write_pickle(df)
        return Outputs(data_1=data_1, data_2=data_2, data_3=None)
    
    # 后处理函数,可选。输入是主函数的输出,可以在这里对数据做处理,或者返回更友好的outputs数据格式。此函数输出不会被缓存。
    def m3_post_run_bigquant_run(outputs):
        return outputs
    
    
    m2 = M.input_features.v1(
        features='correlation(volume_0, close_0, 5)'
    )
    
    m3 = M.cached.v3(
        run=m3_run_bigquant_run,
        post_run=m3_post_run_bigquant_run,
        input_ports='',
        params='{}',
        output_ports=''
    )
    
    m1 = M.factorlens.v2(
        features=m2.data,
        user_factor_data=m3.data_1,
        title='因子分析: {factor_name}',
        start_date='2019-01-01',
        end_date='2020-12-31',
        rebalance_period=5,
        delay_rebalance_days=0,
        rebalance_price='close_0',
        stock_pool='全市场',
        quantile_count=5,
        commission_rate=0.0016,
        returns_calculation_method='累乘',
        benchmark='无',
        drop_new_stocks=60,
        drop_price_limit_stocks=True,
        drop_st_stocks=True,
        drop_suspended_stocks=True,
        normalization=True,
        neutralization=['行业', '市值'],
        metrics=['因子表现概览', '因子分布', '因子行业分布', '因子市值分布', 'IC分析', '买入信号重合分析', '因子估值分析', '因子拥挤度分析', '因子值最大/最小股票', '表达式因子值', '多因子相关性分析'],
        factor_coverage=0.5,
        user_data_merge='left'
    )
    

    因子分析: correlation(volume_0, close_0, 5)

    { "type": "factor-track", "data": { "exprs": ["correlation(volume_0, close_0, 5)"], "options": {"BacktestInterval": ["2019-01-01", "2020-12-31"], "Benchmark": "none", "StockPool": "all", "UserDataMerge": "left", "DropSTStocks": 1, "DropPriceLimitStocks": 1, "DropNewStocks": 60, "DropSuspendedStocks": 1, "QuantileCount": 5, "CommissionRates": 0.0016, "Normalization": 1, "Neutralization": "industry,size", "DelayRebalanceDays": 0, "RebalancePeriod": 5, "RebalancePeriodsReturns": 0, "RebalancePrice": "close_0", "ReturnsCalculationMethod": "cumprod", "FactorCoverage": 0.5, "_HASH": "c11d5f93c4d93913804df857355b3f15"} } }

    因子表现概览

      累计收益 近1年收益 近3月收益 近1月收益 近1周收益 昨日收益 最大回撤 盈亏比 胜率 夏普比率 收益波动率
    最小分位 1.44% -2.34% -11.14% -6.10% -2.31% 0.19% 23.23% 0.91 0.53 -0.00 22.99%
    最大分位 -42.35% -25.52% -16.53% -9.02% -3.19% 0.25% 51.33% 0.88 0.48 -1.25 23.44%
    多空组合 32.39% 14.39% 3.14% 1.59% 0.45% -0.03% 2.18% 1.37 0.67 4.35 2.55%

    基本特征分析

    IC分析

    -0.04

    0.05

    -0.80

    78.12%

    买入信号重合分析

    因子估值分析

    因子拥挤度分析

    因子值最小的20只股票 (2020-12-30)

    股票名称 股票代码 因子值
    深桑达A 000032.SZA -0.9906
    海翔药业 002099.SZA -0.9900
    爱仕达 002403.SZA -0.9880
    多喜爱 002761.SZA -0.9874
    渝三峡A 000565.SZA -0.9817
    天康生物 002100.SZA -0.9788
    神奇制药 600613.SHA -0.9743
    科创新源 300731.SZA -0.9690
    睿创微纳 688002.SHA -0.9667
    普莱柯 603566.SHA -0.9590
    中公教育 002607.SZA -0.9526
    西藏天路 600326.SHA -0.9456
    祥鑫科技 002965.SZA -0.9409
    振东制药 300158.SZA -0.9388
    新宙邦 300037.SZA -0.9374
    读者传媒 603999.SHA -0.9371
    九州通 600998.SHA -0.9363
    天津磁卡 600800.SHA -0.9350
    康惠制药 603139.SHA -0.9341
    欧菲光 002456.SZA -0.9275

    因子值最大的20只股票 (2020-12-30)

    股票名称 股票代码 因子值
    厦门港务 000905.SZA 0.9829
    九洲药业 603456.SHA 0.9835
    四方精创 300468.SZA 0.9844
    南宁糖业 000911.SZA 0.9848
    佳电股份 000922.SZA 0.9853
    金龙汽车 600686.SHA 0.9855
    香梨股份 600506.SHA 0.9855
    三诺生物 300298.SZA 0.9856
    星湖科技 600866.SHA 0.9863
    鼎汉技术 300011.SZA 0.9880
    宝德股份 300023.SZA 0.9894
    东莞控股 000828.SZA 0.9901
    中泰股份 300435.SZA 0.9923
    国海证券 000750.SZA 0.9925
    山河药辅 300452.SZA 0.9931
    石英股份 603688.SHA 0.9935
    郑州银行 002936.SZA 0.9940
    华鑫股份 600621.SHA 0.9956
    锦龙股份 000712.SZA 0.9959
    东兴证券 601198.SHA 0.9960