克隆策略

    {"description":"实验创建于2020/3/18","graph":{"edges":[{"to_node_id":"-319:input_2","from_node_id":"-305:data"},{"to_node_id":"-319:input_1","from_node_id":"-309:data"},{"to_node_id":"-1893:instruments","from_node_id":"-309:data"},{"to_node_id":"-345:data1","from_node_id":"-319:data_1"},{"to_node_id":"-336:features","from_node_id":"-331:data"},{"to_node_id":"-1893:features","from_node_id":"-331:data"},{"to_node_id":"-345:data2","from_node_id":"-336:data"},{"to_node_id":"-365:input_data","from_node_id":"-345:data"},{"to_node_id":"-365:features","from_node_id":"-360:data"},{"to_node_id":"-2042:input_data","from_node_id":"-365:data"},{"to_node_id":"-336:input_data","from_node_id":"-1893:data"},{"to_node_id":"-2014:features","from_node_id":"-2037:data"},{"to_node_id":"-2014:user_factor_data","from_node_id":"-2042:data"}],"nodes":[{"node_id":"-305","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nbm_ret=close/shift(close,1)-1","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-305"}],"output_ports":[{"name":"data","node_id":"-305"}],"cacheable":true,"seq_num":2,"comment":"","comment_collapsed":true},{"node_id":"-309","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2019-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2019-03-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":"-309"}],"output_ports":[{"name":"data","node_id":"-309"}],"cacheable":true,"seq_num":3,"comment":"","comment_collapsed":true},{"node_id":"-319","module_id":"BigQuantSpace.index_feature_extract.index_feature_extract-v3","parameters":[{"name":"before_days","value":100,"type":"Literal","bound_global_parameter":null},{"name":"index","value":"000001.HIX","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_1","node_id":"-319"},{"name":"input_2","node_id":"-319"}],"output_ports":[{"name":"data_1","node_id":"-319"},{"name":"data_2","node_id":"-319"}],"cacheable":true,"seq_num":4,"comment":"","comment_collapsed":true},{"node_id":"-331","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nret=return_0 -1","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-331"}],"output_ports":[{"name":"data","node_id":"-331"}],"cacheable":true,"seq_num":5,"comment":"","comment_collapsed":true},{"node_id":"-336","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":"False","type":"Literal","bound_global_parameter":null},{"name":"user_functions","value":"{}","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_data","node_id":"-336"},{"name":"features","node_id":"-336"}],"output_ports":[{"name":"data","node_id":"-336"}],"cacheable":true,"seq_num":6,"comment":"","comment_collapsed":true},{"node_id":"-345","module_id":"BigQuantSpace.join.join-v3","parameters":[{"name":"on","value":"date","type":"Literal","bound_global_parameter":null},{"name":"how","value":"inner","type":"Literal","bound_global_parameter":null},{"name":"sort","value":"False","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"data1","node_id":"-345"},{"name":"data2","node_id":"-345"}],"output_ports":[{"name":"data","node_id":"-345"}],"cacheable":true,"seq_num":7,"comment":"","comment_collapsed":true},{"node_id":"-360","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nrelative_ret=ret-bm_ret","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-360"}],"output_ports":[{"name":"data","node_id":"-360"}],"cacheable":true,"seq_num":9,"comment":"","comment_collapsed":true},{"node_id":"-365","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":"False","type":"Literal","bound_global_parameter":null},{"name":"user_functions","value":"{}","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_data","node_id":"-365"},{"name":"features","node_id":"-365"}],"output_ports":[{"name":"data","node_id":"-365"}],"cacheable":true,"seq_num":8,"comment":"","comment_collapsed":true},{"node_id":"-1893","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":"-1893"},{"name":"features","node_id":"-1893"}],"output_ports":[{"name":"data","node_id":"-1893"}],"cacheable":true,"seq_num":1,"comment":"","comment_collapsed":true},{"node_id":"-2014","module_id":"BigQuantSpace.factorlens.factorlens-v1","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":"2019-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":"-2014"},{"name":"user_factor_data","node_id":"-2014"}],"output_ports":[{"name":"data","node_id":"-2014"}],"cacheable":true,"seq_num":10,"comment":"","comment_collapsed":true},{"node_id":"-2037","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nrelative_ret","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-2037"}],"output_ports":[{"name":"data","node_id":"-2037"}],"cacheable":true,"seq_num":11,"comment":"","comment_collapsed":true},{"node_id":"-2042","module_id":"BigQuantSpace.filter.filter-v3","parameters":[{"name":"expr","value":"[\"date\",\"instrument\",\"relative_ret\"]","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":"-2042"}],"output_ports":[{"name":"data","node_id":"-2042"},{"name":"left_data","node_id":"-2042"}],"cacheable":true,"seq_num":12,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-305' Position='-218,186,200,200'/><node_position Node='-309' Position='108,187,200,200'/><node_position Node='-319' Position='-115,319,200,200'/><node_position Node='-331' Position='452,195,200,200'/><node_position Node='-336' Position='271,364,200,200'/><node_position Node='-345' Position='15,454,200,200'/><node_position Node='-360' Position='369,461,200,200'/><node_position Node='-365' Position='196,533,200,200'/><node_position Node='-1893' Position='230,281,200,200'/><node_position Node='-2014' Position='-42,698,200,200'/><node_position Node='-2037' Position='-304,565,200,200'/><node_position Node='-2042' Position='198,601,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
    In [9]:
    # 本代码由可视化策略环境自动生成 2021年8月19日 09:18
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    m2 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    bm_ret=close/shift(close,1)-1"""
    )
    
    m3 = M.instruments.v2(
        start_date='2019-01-01',
        end_date='2019-03-01',
        market='CN_STOCK_A',
        instrument_list='',
        max_count=0
    )
    
    m4 = M.index_feature_extract.v3(
        input_1=m3.data,
        input_2=m2.data,
        before_days=100,
        index='000001.HIX'
    )
    
    m5 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    ret=return_0 -1"""
    )
    
    m1 = M.general_feature_extractor.v7(
        instruments=m3.data,
        features=m5.data,
        start_date='',
        end_date='',
        before_start_days=90
    )
    
    m6 = M.derived_feature_extractor.v3(
        input_data=m1.data,
        features=m5.data,
        date_col='date',
        instrument_col='instrument',
        drop_na=True,
        remove_extra_columns=False,
        user_functions={}
    )
    
    m7 = M.join.v3(
        data1=m4.data_1,
        data2=m6.data,
        on='date',
        how='inner',
        sort=False
    )
    
    m9 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    relative_ret=ret-bm_ret"""
    )
    
    m8 = M.derived_feature_extractor.v3(
        input_data=m7.data,
        features=m9.data,
        date_col='date',
        instrument_col='instrument',
        drop_na=False,
        remove_extra_columns=False,
        user_functions={}
    )
    
    m12 = M.filter.v3(
        input_data=m8.data,
        expr='["date","instrument","relative_ret"]',
        output_left_data=False
    )
    
    m11 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    relative_ret"""
    )
    
    m10 = M.factorlens.v1(
        features=m11.data,
        user_factor_data=m12.data,
        title='因子分析: {factor_name}',
        start_date='2019-01-01',
        end_date='2019-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'
    )
    

    因子分析: relative_ret

    { "type": "factor-track", "data": { "exprs": ["relative_ret"], "options": {"BacktestInterval": ["2019-01-01", "2019-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": "70e7235df0a2ac81f825c6484f2f9b5d"} } }

    因子表现概览

      累计收益 近1年收益 近3月收益 近1月收益 近1周收益 昨日收益 最大回撤 盈亏比 胜率 夏普比率 收益波动率
    最小分位 7.72% 7.72% 7.72% 7.69% 4.03% 0.42% 10.29% 0.99 0.61 2.10 23.06%
    最大分位 11.06% 11.06% 11.06% 11.14% 3.67% 0.20% 7.53% 1.49 0.55 3.09 22.18%
    多空组合 -1.51% -1.51% -1.51% -1.55% 0.16% 0.11% 2.02% 0.69 0.45 -4.24 3.20%

    基本特征分析

    IC分析

    0.04

    0.08

    0.42

    75.00%

    买入信号重合分析

    因子估值分析

    因子拥挤度分析

    因子值最小的20只股票 (2019-03-01)

    股票名称 股票代码 因子值
    特发信息 000070.SZA -0.1112
    富瀚微 300613.SZA -0.1020
    英飞特 300582.SZA -0.0975
    天和防务 300397.SZA -0.0883
    嘉泽新能 601619.SHA -0.0733
    华控赛格 000068.SZA -0.0693
    鲁信创投 600783.SHA -0.0680
    环旭电子 601231.SHA -0.0671
    闽东电力 000993.SZA -0.0647
    南京化纤 600889.SHA -0.0646
    山河药辅 300452.SZA -0.0630
    国农科技 000004.SZA -0.0612
    民丰特纸 600235.SHA -0.0611
    银河电子 002519.SZA -0.0608
    天成自控 603085.SHA -0.0606
    梦网集团 002123.SZA -0.0605
    弘业股份 600128.SHA -0.0594
    华正新材 603186.SHA -0.0574
    *ST集成 002190.SZA -0.0573
    英科医疗 300677.SZA -0.0572

    因子值最大的20只股票 (2019-03-01)

    股票名称 股票代码 因子值
    易世达 300125.SZA 0.0559
    太平洋 601099.SHA 0.0561
    中通客车 000957.SZA 0.0563
    中国银河 601881.SHA 0.0581
    捷昌驱动 603583.SHA 0.0587
    泰永长征 002927.SZA 0.0593
    量子生物 300149.SZA 0.0618
    美锦能源 000723.SZA 0.0622
    兴业银行 601166.SHA 0.0626
    商赢环球 600146.SHA 0.0635
    北京君正 300223.SZA 0.0647
    麦格米特 002851.SZA 0.0666
    亚星客车 600213.SHA 0.0672
    振华重工 600320.SHA 0.0681
    亿纬锂能 300014.SZA 0.0713
    引力传媒 603598.SHA 0.0750
    新国都 300130.SZA 0.0751
    熊猫金控 600599.SHA 0.0756
    江铃汽车 000550.SZA 0.0762
    中国人寿 601628.SHA 0.0778
    In [10]:
    m8.data.read()
    
    Out[10]:
    date instrument return_0 ret bm_ret relative_ret
    0 2018-10-08 000001.SZA 0.945701 -0.054299 -0.037159 -0.017139
    1 2018-10-08 000002.SZA 0.907407 -0.092593 -0.037159 -0.055433
    2 2018-10-08 000005.SZA 0.969388 -0.030612 -0.037159 0.006547
    3 2018-10-08 000006.SZA 0.915790 -0.084210 -0.037159 -0.047051
    4 2018-10-08 000007.SZA 0.900383 -0.099617 -0.037159 -0.062457
    ... ... ... ... ... ... ...
    345935 2019-03-01 603993.SHA 1.006302 0.006302 0.018039 -0.011736
    345936 2019-03-01 603996.SHA 1.056295 0.056295 0.018039 0.038256
    345937 2019-03-01 603997.SHA 1.003572 0.003572 0.018039 -0.014467
    345938 2019-03-01 603998.SHA 0.991722 -0.008278 0.018039 -0.026317
    345939 2019-03-01 603999.SHA 1.006861 0.006861 0.018039 -0.011178

    345940 rows × 6 columns

    In [ ]: