克隆策略

    {"Description":"实验创建于2020/2/14","Summary":"","Graph":{"EdgesInternal":[{"DestinationInputPortId":"-115:features","SourceOutputPortId":"-70:data"}],"ModuleNodes":[{"Id":"-70","ModuleId":"BigQuantSpace.input_features.input_features-v1","ModuleParameters":[{"Name":"features","Value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\npb_lf_0","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features_ds","NodeId":"-70"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-70","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":1,"IsPartOfPartialRun":null,"Comment":"","CommentCollapsed":true},{"Id":"-115","ModuleId":"BigQuantSpace.factorlens.factorlens-v1","ModuleParameters":[{"Name":"title","Value":"因子分析: {factor_name}","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"start_date","Value":"2019-01-01","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"end_date","Value":"2019-12-31","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"rebalance_period","Value":22,"ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"delay_rebalance_days","Value":0,"ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"rebalance_price","Value":"close_0","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"stock_pool","Value":"全市场","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"quantile_count","Value":5,"ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"commission_rate","Value":0.0016,"ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"returns_calculation_method","Value":"累乘","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"benchmark","Value":"无","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"drop_price_limit_stocks","Value":"True","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"drop_st_stocks","Value":"True","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"drop_new_stocks","Value":"True","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"normalization","Value":"True","ValueType":"Literal","LinkedGlobalParameter":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","ValueType":"Literal","LinkedGlobalParameter":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%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","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"factor_coverage","Value":0.5,"ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features","NodeId":"-115"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"user_factor_data","NodeId":"-115"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-115","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":2,"IsPartOfPartialRun":null,"Comment":"","CommentCollapsed":true}],"SerializedClientData":"<?xml version='1.0' encoding='utf-16'?><DataV1 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><Meta /><NodePositions><NodePosition Node='-70' Position='282,197,200,200'/><NodePosition Node='-115' Position='326.7689514160156,370.34906005859375,200,200'/></NodePositions><NodeGroups /></DataV1>"},"IsDraft":true,"ParentExperimentId":null,"WebService":{"IsWebServiceExperiment":false,"Inputs":[],"Outputs":[],"Parameters":[{"Name":"交易日期","Value":"","ParameterDefinition":{"Name":"交易日期","FriendlyName":"交易日期","DefaultValue":"","ParameterType":"String","HasDefaultValue":true,"IsOptional":true,"ParameterRules":[],"HasRules":false,"MarkupType":0,"CredentialDescriptor":null}}],"WebServiceGroupId":null,"SerializedClientData":"<?xml version='1.0' encoding='utf-16'?><DataV1 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><Meta /><NodePositions></NodePositions><NodeGroups /></DataV1>"},"DisableNodesUpdate":false,"Category":"user","Tags":[],"IsPartialRun":true}
    In [1]:
    # 本代码由可视化策略环境自动生成 2021年6月23日15:13
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    m1 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    pb_lf_0"""
    )
    
    m2 = M.factorlens.v1(
        features=m1.data,
        title='因子分析: {factor_name}',
        start_date='2019-01-01',
        end_date='2019-12-31',
        rebalance_period=22,
        delay_rebalance_days=0,
        rebalance_price='close_0',
        stock_pool='全市场',
        quantile_count=5,
        commission_rate=0.0016,
        returns_calculation_method='累乘',
        benchmark='无',
        drop_price_limit_stocks=True,
        drop_st_stocks=True,
        drop_new_stocks=True,
        normalization=True,
        neutralization=['行业', '市值'],
        metrics=['因子表现概览', '因子分布', '因子行业分布', '因子市值分布', 'IC分析', '买入信号重合分析', '因子估值分析', '因子拥挤度分析', '因子值最大/最小股票', '多因子相关性分析'],
        factor_coverage=0.5
    )
    

    因子分析: pb_lf_0

    { "type": "factor-track", "data": { "exprs": ["pb_lf_0"], "options": {"BacktestInterval": ["2019-01-01", "2019-12-31"], "Benchmark": "none", "StockPool": "all", "DropSTStocks": 1, "DropPriceLimitStocks": 1, "DropNewStocks": 1, "QuantileCount": 5, "CommissionRates": 0.0016, "Normalization": 1, "Neutralization": "industry,size", "RebalancePrice": "close_0", "DelayRebalanceDays": 0, "RebalancePeriod": 22, "ReturnsCalculationMethod": "cumprod", "FactorCoverage": 0.5, "_HASH": "165b61f901995e3e9ec1828ac13a5dc7"} } }

    因子表现概览

      累计收益 近1年收益 近3月收益 近1月收益 近1周收益 昨日收益 最大回撤 盈亏比 胜率 夏普比率 收益波动率
    最小分位 3.79% 3.79% -4.64% 5.56% 1.19% 0.50% 27.35% 0.78 0.57 0.13 23.28%
    最大分位 -0.13% -0.13% -5.98% 5.44% 0.42% 0.44% 26.78% 0.77 0.57 -0.05 22.11%
    多空组合 2.05% 2.05% 0.68% 0.06% 0.38% 0.03% 2.70% 1.07 0.52 -0.53 2.61%

    基本特征分析

    IC分析

    -0.01

    0.08

    -0.13

    50.00%

    买入信号重合分析

    因子估值分析

    因子拥挤度分析

    因子值最小的20只股票 (2019-12-31)

    股票名称 股票代码 因子值
    向日葵 300111.SZA -107.6334
    长城动漫 000835.SZA -83.6225
    大唐电信 600198.SHA -26.7117
    商业城 600306.SHA -18.0544
    国美通讯 600898.SHA -14.8750
    飞乐音响 600651.SHA -6.7900
    盛运环保 300090.SZA -4.5020
    株冶集团 600961.SHA -3.0331
    暴风集团 300431.SZA -1.8988
    天翔环境 300362.SZA -1.4556
    神城A退 000018.SZA -0.3534
    退市华业 600240.SHA -0.1034
    众泰汽车 000980.SZA 0.3534
    东旭蓝天 000040.SZA 0.4299
    供销大集 000564.SZA 0.4617
    宜华生活 600978.SHA 0.5168
    宏图高科 600122.SHA 0.5284
    福星股份 000926.SZA 0.5582
    海航基础 600515.SHA 0.5621
    信达地产 600657.SHA 0.5642

    因子值最大的20只股票 (2019-12-31)

    股票名称 股票代码 因子值
    国农科技 000004.SZA 19.1051
    海天味业 603288.SHA 19.2723
    紫光学大 000526.SZA 20.6918
    济民制药 603222.SHA 20.8565
    华东数控 002248.SZA 21.4398
    诚迈科技 300598.SZA 21.6354
    康泰生物 300601.SZA 23.1385
    天目药业 600671.SHA 25.0442
    圣邦股份 300661.SZA 25.9309
    华谊嘉信 300071.SZA 26.6423
    卓胜微 300782.SZA 26.8357
    天津磁卡 600800.SHA 27.4980
    大东海A 000613.SZA 28.3226
    园城黄金 600766.SHA 32.2546
    祥龙电业 600769.SHA 36.9902
    中公教育 002607.SZA 43.5018
    华塑控股 000509.SZA 45.9427
    金宇车城 000803.SZA 76.6159
    深中华A 000017.SZA 171.3072
    博信股份 600083.SHA 240.4389
    In [23]:
    # 查看分组收益率
    m2.data.read()['data']['factors'][0]['results'][0]['data']['QuantileReturns'] # 分组收益
    
    Out[23]:
    l_0 l_1 l_2 l_3 l_4 l_top_bottom daily_returns_top_bottom
    date
    2019-01-02 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000
    2019-01-03 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000
    2019-01-04 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000
    2019-01-07 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000
    2019-01-08 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000
    ... ... ... ... ... ... ... ...
    2019-12-25 1.027878 1.047337 1.038327 0.998198 0.999202 1.015248 0.998703
    2019-12-26 1.034850 1.057029 1.047303 1.005564 1.004591 1.015954 1.000695
    2019-12-27 1.026329 1.048890 1.039625 0.996177 0.993680 1.017288 1.001313
    2019-12-30 1.032743 1.058811 1.046630 0.999778 0.994306 1.020147 1.002810
    2019-12-31 1.037872 1.064298 1.051320 1.004187 0.998653 1.020450 1.000297

    244 rows × 7 columns