复制链接
克隆策略

    {"description":"实验创建于2017/8/26","graph":{"edges":[],"nodes":[{"node_id":"-8322","module_id":"BigQuantSpace.strategy_asset_allocation.strategy_asset_allocation-v1","parameters":[{"name":"stra_dict","value":"{\n 'stockrank':\"stockrank.csv\",\n '多条件选股':\"多条件选股.csv\",\n '多头排列回踩':\"多头排列回踩.csv\"\n}","type":"Literal","bound_global_parameter":null},{"name":"start_date","value":"2021-01-04","type":"Literal","bound_global_parameter":null},{"name":"upper_weight","value":1,"type":"Literal","bound_global_parameter":null},{"name":"lower_weight","value":0,"type":"Literal","bound_global_parameter":null},{"name":"target","value":"Black-Litterman","type":"Literal","bound_global_parameter":null},{"name":"self_para","value":"{\n \"P\":[[1,0,-1],[0,1,-1],[1,0,0]],\n \"Q\":[0.1,0.08,0.2],\n \"TAU\":0.3,\n \"WEIGHT\":[1/3,1/3,1/3],\n \"TARGET\":'最小化风险'\n}","type":"Literal","bound_global_parameter":null},{"name":"balance_period","value":"1个月","type":"Literal","bound_global_parameter":null},{"name":"cal_period","value":"全部历史","type":"Literal","bound_global_parameter":null},{"name":"cal_days","value":30,"type":"Literal","bound_global_parameter":null}],"input_ports":[],"output_ports":[{"name":"rebalance_data","node_id":"-8322"},{"name":"pnl_data","node_id":"-8322"}],"cacheable":false,"seq_num":1,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-8322' Position='484,91,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
    In [1]:
    # 本代码由可视化策略环境自动生成 2023年1月12日 11:34
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    m1 = M.strategy_asset_allocation.v1(
        stra_dict={
        'stockrank':"stockrank.csv",
        '多条件选股':"多条件选股.csv",
        '多头排列回踩':"多头排列回踩.csv"
    },
        start_date='2021-01-04',
        upper_weight=1,
        lower_weight=0,
        target='Black-Litterman',
        self_para={
        "P":[[1,0,-1],[0,1,-1],[1,0,0]],
        "Q":[0.1,0.08,0.2],
        "TAU":0.3,
        "WEIGHT":[1/3,1/3,1/3],
        "TARGET":'最小化风险'
    },
        balance_period='1个月',
        cal_period='全部历史',
        cal_days=30
    )
    
    再平衡日期和各策略对应权重:
    2021-01-04 {'stockrank': 0.33, '多条件选股': 0.33, '多头排列回踩': 0.33}
    2021-02-03 {'stockrank': 0.38, '多条件选股': 0.62, '多头排列回踩': 0.0}
    2021-03-05 {'stockrank': 0.53, '多条件选股': 0.21, '多头排列回踩': 0.26}
    2021-04-04 {'stockrank': 0.53, '多条件选股': 0.23, '多头排列回踩': 0.24}
    2021-05-04 {'stockrank': 0.5, '多条件选股': 0.23, '多头排列回踩': 0.27}
    2021-06-03 {'stockrank': 0.53, '多条件选股': 0.2, '多头排列回踩': 0.27}
    2021-07-03 {'stockrank': 0.54, '多条件选股': 0.18, '多头排列回踩': 0.28}
    2021-08-02 {'stockrank': 0.56, '多条件选股': 0.17, '多头排列回踩': 0.27}
    2021-09-01 {'stockrank': 0.55, '多条件选股': 0.17, '多头排列回踩': 0.27}
    2021-10-01 {'stockrank': 0.59, '多条件选股': 0.23, '多头排列回踩': 0.18}
    2021-10-31 {'stockrank': 0.58, '多条件选股': 0.25, '多头排列回踩': 0.17}
    2021-11-30 {'stockrank': 0.61, '多条件选股': 0.22, '多头排列回踩': 0.17}
    2021-12-30 {'stockrank': 0.61, '多条件选股': 0.23, '多头排列回踩': 0.17}
    

    策略绩效指标

    策略名称 收益率 年化收益率 夏普比率 年化波动率 最大回撤 收益回撤比
    stockrank 67.67% 70.91% 1.97 27.29% -15.12% 4.69
    多条件选股 37.14% 38.75% 1.27 25.56% -15.43% 2.51
    多头排列回踩 35.57% 37.11% 1.10 29.59% -22.19% 1.67
    组合收益 62.02% 64.94% 2.20 22.29% -11.35% 5.72