复制链接
克隆策略

    {"description":"实验创建于2020/2/14","graph":{"edges":[{"to_node_id":"-3626:features","from_node_id":"-70:data"},{"to_node_id":"-3619:factors_info","from_node_id":"-3626:save_data"}],"nodes":[{"node_id":"-70","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nalpha00001= np.gradient(ta_ma(close_0,2)) \n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-70"}],"output_ports":[{"name":"data","node_id":"-70"}],"cacheable":false,"seq_num":1,"comment":"","comment_collapsed":true},{"node_id":"-3619","module_id":"BigQuantSpace.factorlens_preservation.factorlens_preservation-v2","parameters":[{"name":"factor_fields","value":"# 定义因子名称\n# {\n# \"列名\": {'name': \"因子名\", 'desc': \"因子描述\"},\n# \"列名\": {'name': \"因子名\", 'desc': \"因子描述\"},\n# ... \n# }\n{}\n","type":"Literal","bound_global_parameter":null},{"name":"table","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"factors_info","node_id":"-3619"}],"output_ports":[{"name":"data","node_id":"-3619"}],"cacheable":false,"seq_num":3,"comment":"","comment_collapsed":true},{"node_id":"-3626","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":"2023-04-21","type":"Literal","bound_global_parameter":null},{"name":"rebalance_period","value":"1","type":"Literal","bound_global_parameter":null},{"name":"delay_rebalance_days","value":"1","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":"250","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":"cutoutliers","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.0001","type":"Literal","bound_global_parameter":null},{"name":"user_data_merge","value":"left","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features","node_id":"-3626"},{"name":"user_factor_data","node_id":"-3626"}],"output_ports":[{"name":"data","node_id":"-3626"},{"name":"save_data","node_id":"-3626"}],"cacheable":true,"seq_num":4,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-70' Position='441,313,200,200'/><node_position Node='-3619' Position='423,650,200,200'/><node_position Node='-3626' Position='431,439,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
    In [5]:
    # 本代码由可视化策略环境自动生成 2023年4月28日 02:21
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    m1 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    alpha00001= np.gradient(ta_ma(close_0,2)) 
    """,
        m_cached=False
    )
    
    m4 = M.factorlens.v2(
        features=m1.data,
        title='因子分析: {factor_name}',
        start_date='2019-01-01',
        end_date='2023-04-21',
        rebalance_period=1,
        delay_rebalance_days=1,
        rebalance_price='close_0',
        stock_pool='全市场',
        quantile_count=5,
        commission_rate=0.0016,
        returns_calculation_method='累乘',
        benchmark='无',
        drop_new_stocks=250,
        drop_price_limit_stocks=True,
        drop_st_stocks=True,
        drop_suspended_stocks=True,
        cutoutliers=True,
        normalization=True,
        neutralization=['行业', '市值'],
        metrics=['因子表现概览', '因子分布', '因子行业分布', '因子市值分布', 'IC分析', '买入信号重合分析', '因子估值分析', '因子拥挤度分析', '因子值最大/最小股票', '表达式因子值', '多因子相关性分析'],
        factor_coverage=0.0001,
        user_data_merge='left'
    )
    
    m3 = M.factorlens_preservation.v2(
        factors_info=m4.save_data,
        factor_fields=# 定义因子名称
    # {
    #     "列名": {'name': "因子名", 'desc': "因子描述"},
    #     "列名": {'name': "因子名", 'desc': "因子描述"},
    #     ... 
    # }
    {}
    ,
        table=''
    )
    

    因子分析: alpha00001

    { "type": "factor-track", "data": { "exprs": ["np.gradient(ta_ma(close_0,2))"], "options": {"BacktestInterval": ["2019-01-01", "2023-04-21"], "Benchmark": "none", "StockPool": "all", "UserDataMerge": "left", "DropSTStocks": 1, "DropPriceLimitStocks": 1, "DropNewStocks": 250, "DropSuspendedStocks": 1, "QuantileCount": 5, "CommissionRates": 0.0016, "Cutoutliers": 1, "Normalization": 1, "Neutralization": "industry,size", "DelayRebalanceDays": 0, "RebalancePeriod": 1, "RebalancePeriodsReturns": 0, "RebalancePrice": "close_0", "ReturnsCalculationMethod": "cumsum", "FactorCoverage": 0.0001, "_HASH": "b3dd63dd66820b35fba90fddca5d73fc"} } }

    因子表现概览

      累计收益 近1年收益 近3月收益 近1月收益 近1周收益 昨日收益 最大回撤 盈亏比 胜率 夏普比率 收益波动率
    最小分位 -1058.76% 100.00% 0.58 0.22 -10.71 24.19%
    最大分位 756.02% 26.01% 6.26% 2.32% 0.45% 0.13% 10.59% 1.42 0.77 9.50 18.84%
    多空组合 -907.39% 99.99% 0.25 0.00 -40.85 5.45%

    基本特征分析

    IC分析

    0.25

    0.09

    2.96

    99.43%

    买入信号重合分析

    因子估值分析

    因子拥挤度分析

    因子值最小的20只股票 (2023-04-20)

    股票名称 股票代码 因子值
    申华控股 600653.SHA -251.3916
    天宸股份 600620.SHA -114.5132
    贵州茅台 600519.SHA -94.9634
    万华化学 600309.SHA -73.9999
    泸州老窖 000568.SZA -63.5120
    华鑫股份 600621.SHA -51.1613
    爱尔眼科 300015.SZA -50.5817
    禾迈股份 688032.SHA -46.2857
    五粮液 000858.SZA -40.9893
    恒瑞医药 600276.SHA -39.7844
    亿纬锂能 300014.SZA -35.4809
    金枫酒业 600616.SHA -32.2911
    汇川技术 300124.SZA -30.9625
    海康威视 002415.SZA -29.3664
    万科A 000002.SZA -28.0839
    圣邦股份 300661.SZA -26.8706
    泰格医药 300347.SZA -26.4882
    德方纳米 300769.SZA -22.4144
    恒生电子 600570.SHA -21.1914
    先导智能 300450.SZA -20.5763

    因子值最大的20只股票 (2023-04-20)

    股票名称 股票代码 因子值
    华海清科 688120.SHA 8.8750
    菲菱科思 301191.SZA 9.4600
    兴森科技 002436.SZA 9.5876
    神州泰岳 300002.SZA 9.9354
    英杰电气 300820.SZA 10.2295
    中际旭创 300308.SZA 10.6674
    启明星辰 002439.SZA 10.7662
    精测电子 300567.SZA 10.8903
    金山办公 688111.SHA 10.9284
    科大讯飞 002230.SZA 12.6007
    安集科技 688019.SHA 14.3933
    中兴通讯 000063.SZA 14.9557
    吉比特 603444.SHA 15.5472
    鼎龙股份 300054.SZA 16.8415
    大华股份 002236.SZA 18.9742
    老凤祥 600612.SHA 28.3066
    同花顺 300033.SZA 30.6226
    北方华创 002371.SZA 46.5378
    格力电器 000651.SZA 107.9849
    飞乐音响 600651.SHA 282.6758