克隆策略

    {"description":"实验创建于2017/8/26","graph":{"edges":[{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-15:instruments","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-8:data"},{"to_node_id":"-215:instruments","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-8:data"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-53:data1","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-15:data"},{"to_node_id":"-215:features","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-222:features","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-231:features","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-238:features","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-240:features","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-142:input_data","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-53:data"},{"to_node_id":"-231:instruments","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-62:data"},{"to_node_id":"-409:instruments","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-62:data"},{"to_node_id":"-197:instruments","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-62:data"},{"to_node_id":"-161:input_1","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-84:data"},{"to_node_id":"-164:input_1","from_node_id":"-86:data"},{"to_node_id":"-222:input_data","from_node_id":"-215:data"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-53:data2","from_node_id":"-222:data"},{"to_node_id":"-238:input_data","from_node_id":"-231:data"},{"to_node_id":"-152:input_data","from_node_id":"-238:data"},{"to_node_id":"-409:features","from_node_id":"-404:data"},{"to_node_id":"-416:data2","from_node_id":"-409:data"},{"to_node_id":"-423:input_ds","from_node_id":"-416:data"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-84:input_data","from_node_id":"-142:data"},{"to_node_id":"-86:input_data","from_node_id":"-152:data"},{"to_node_id":"-240:training_ds","from_node_id":"-161:data_1"},{"to_node_id":"-240:test_ds","from_node_id":"-161:data_1"},{"to_node_id":"-255:data","from_node_id":"-164:data_1"},{"to_node_id":"-255:model","from_node_id":"-240:model"},{"to_node_id":"-416:data1","from_node_id":"-255:predictions"},{"to_node_id":"-197:initialize_functions","from_node_id":"-259:functions"},{"to_node_id":"-271:input_functions","from_node_id":"-266:functions"},{"to_node_id":"-279:input_functions","from_node_id":"-271:functions"},{"to_node_id":"-197:handle_bar_functions","from_node_id":"-279:functions"},{"to_node_id":"-197:options_data","from_node_id":"-423:sorted_data"}],"nodes":[{"node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-8","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2015-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2019-01-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":"287d2cb0-f53c-4101-bdf8-104b137c8601-8"}],"output_ports":[{"name":"data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-8"}],"cacheable":true,"seq_num":1,"comment":"","comment_collapsed":true},{"node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-15","module_id":"BigQuantSpace.advanced_auto_labeler.advanced_auto_labeler-v2","parameters":[{"name":"label_expr","value":"# #号开始的表示注释\n# 0. 每行一个,顺序执行,从第二个开始,可以使用label字段\n# 1. 可用数据字段见 https://bigquant.com/docs/develop/datasource/deprecated/history_data.html\n# 添加benchmark_前缀,可使用对应的benchmark数据\n# 2. 可用操作符和函数见 `表达式引擎 <https://bigquant.com/docs/develop/bigexpr/usage.html>`_\n\n# 计算收益:5日收盘价(作为卖出价格)除以明日开盘价(作为买入价格)\nshift(close, -5) / shift(open, -1)\n\n# 极值处理:用1%和99%分位的值做clip\nclip(label, all_quantile(label, 0.01), all_quantile(label, 0.99))\n\n# 将分数映射到分类,这里使用20个分类\nall_wbins(label, 20)\n\n# 过滤掉一字涨停的情况 (设置label为NaN,在后续处理和训练中会忽略NaN的label)\nwhere(shift(high, -1) == shift(low, -1), NaN, label)\n","type":"Literal","bound_global_parameter":null},{"name":"start_date","value":"","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"","type":"Literal","bound_global_parameter":null},{"name":"benchmark","value":"000300.SHA","type":"Literal","bound_global_parameter":null},{"name":"drop_na_label","value":"True","type":"Literal","bound_global_parameter":null},{"name":"cast_label_int","value":"True","type":"Literal","bound_global_parameter":null},{"name":"user_functions","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-15"}],"output_ports":[{"name":"data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-15"}],"cacheable":true,"seq_num":2,"comment":"","comment_collapsed":true},{"node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"# #号开始的表示注释\n# 多个特征,每行一个,可以包含基础特征和衍生特征\nreturn_5\nreturn_10\nreturn_20\navg_amount_0/avg_amount_5\navg_amount_5/avg_amount_20\nrank_avg_amount_0/rank_avg_amount_5\nrank_avg_amount_5/rank_avg_amount_10\nrank_return_0\nrank_return_5\nrank_return_10\nrank_return_0/rank_return_5\nrank_return_5/rank_return_10\npe_ttm_0\navg_amount_60\nmf_net_amount_l_0#大单净流入净额\nmf_net_amount_m_0#中单净流入净额\nmf_net_amount_main_0#主力净流入净额\nmf_net_amount_xl_0#超大单净流入净额\nmf_net_pct_l_0#大单净流入占比\nmf_net_pct_m_0#中单净流入占比\nmf_net_pct_main_0#主力净流入占比\nmf_net_pct_xl_0#超大单净流入占比\nvolume_5#第前 5个交易日的交易量\nvolume_10#第前 10个交易日的交易量\nta_macd_macd_12_26_9_0#MACD\nta_stoch_slowd_5_3_0_3_0_0#指标D值\nta_stoch_slowk_5_3_0_3_0_0#指标K值\nsome_alias=ta_rsi_14_0#RSI指标,timeperiod=14\nsome_alias=ta_rsi_28_0#RSI指标,timeperiod=28\nvolume_5#第5前个交易日的交易量\nvolume_10#第10前个交易日的交易量\nreturn_1\n\n\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24"}],"output_ports":[{"name":"data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24"}],"cacheable":true,"seq_num":3,"comment":"","comment_collapsed":true},{"node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-53","module_id":"BigQuantSpace.join.join-v3","parameters":[{"name":"on","value":"date,instrument","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":"287d2cb0-f53c-4101-bdf8-104b137c8601-53"},{"name":"data2","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-53"}],"output_ports":[{"name":"data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-53"}],"cacheable":true,"seq_num":7,"comment":"","comment_collapsed":true},{"node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-62","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2019-01-01","type":"Literal","bound_global_parameter":"交易日期"},{"name":"end_date","value":"2021-10-1","type":"Literal","bound_global_parameter":"交易日期"},{"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":"287d2cb0-f53c-4101-bdf8-104b137c8601-62"}],"output_ports":[{"name":"data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-62"}],"cacheable":true,"seq_num":9,"comment":"预测数据,用于回测和模拟","comment_collapsed":false},{"node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-84","module_id":"BigQuantSpace.dropnan.dropnan-v1","parameters":[],"input_ports":[{"name":"input_data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-84"}],"output_ports":[{"name":"data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-84"}],"cacheable":true,"seq_num":13,"comment":"","comment_collapsed":true},{"node_id":"-86","module_id":"BigQuantSpace.dropnan.dropnan-v1","parameters":[],"input_ports":[{"name":"input_data","node_id":"-86"}],"output_ports":[{"name":"data","node_id":"-86"}],"cacheable":true,"seq_num":14,"comment":"","comment_collapsed":true},{"node_id":"-215","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":"-215"},{"name":"features","node_id":"-215"}],"output_ports":[{"name":"data","node_id":"-215"}],"cacheable":true,"seq_num":15,"comment":"","comment_collapsed":true},{"node_id":"-222","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":"-222"},{"name":"features","node_id":"-222"}],"output_ports":[{"name":"data","node_id":"-222"}],"cacheable":true,"seq_num":16,"comment":"","comment_collapsed":true},{"node_id":"-231","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":"-231"},{"name":"features","node_id":"-231"}],"output_ports":[{"name":"data","node_id":"-231"}],"cacheable":true,"seq_num":17,"comment":"","comment_collapsed":true},{"node_id":"-238","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":"-238"},{"name":"features","node_id":"-238"}],"output_ports":[{"name":"data","node_id":"-238"}],"cacheable":true,"seq_num":18,"comment":"","comment_collapsed":true},{"node_id":"-404","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nname","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-404"}],"output_ports":[{"name":"data","node_id":"-404"}],"cacheable":true,"seq_num":10,"comment":"","comment_collapsed":true},{"node_id":"-409","module_id":"BigQuantSpace.use_datasource.use_datasource-v1","parameters":[{"name":"datasource_id","value":"instruments_CN_STOCK_A","type":"Literal","bound_global_parameter":null},{"name":"start_date","value":"","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-409"},{"name":"features","node_id":"-409"}],"output_ports":[{"name":"data","node_id":"-409"}],"cacheable":true,"seq_num":11,"comment":"","comment_collapsed":true},{"node_id":"-416","module_id":"BigQuantSpace.join.join-v3","parameters":[{"name":"on","value":"date,instrument","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":"-416"},{"name":"data2","node_id":"-416"}],"output_ports":[{"name":"data","node_id":"-416"}],"cacheable":true,"seq_num":12,"comment":"","comment_collapsed":true},{"node_id":"-142","module_id":"BigQuantSpace.chinaa_stock_filter.chinaa_stock_filter-v1","parameters":[{"name":"index_constituent_cond","value":"%7B%22enumItems%22%3A%5B%7B%22value%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22displayValue%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E4%B8%8A%E8%AF%8150%22%2C%22displayValue%22%3A%22%E4%B8%8A%E8%AF%8150%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%B2%AA%E6%B7%B1300%22%2C%22displayValue%22%3A%22%E6%B2%AA%E6%B7%B1300%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%B8%AD%E8%AF%81500%22%2C%22displayValue%22%3A%22%E4%B8%AD%E8%AF%81500%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%B8%AD%E8%AF%81800%22%2C%22displayValue%22%3A%22%E4%B8%AD%E8%AF%81800%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%B8%8A%E8%AF%81180%22%2C%22displayValue%22%3A%22%E4%B8%8A%E8%AF%81180%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%B8%AD%E8%AF%81100%22%2C%22displayValue%22%3A%22%E4%B8%AD%E8%AF%81100%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%B7%B1%E8%AF%81100%22%2C%22displayValue%22%3A%22%E6%B7%B1%E8%AF%81100%22%2C%22selected%22%3Afalse%7D%5D%7D","type":"Literal","bound_global_parameter":null},{"name":"board_cond","value":"%7B%22enumItems%22%3A%5B%7B%22value%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22displayValue%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%B8%8A%E8%AF%81%E4%B8%BB%E6%9D%BF%22%2C%22displayValue%22%3A%22%E4%B8%8A%E8%AF%81%E4%B8%BB%E6%9D%BF%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E6%B7%B1%E8%AF%81%E4%B8%BB%E6%9D%BF%22%2C%22displayValue%22%3A%22%E6%B7%B1%E8%AF%81%E4%B8%BB%E6%9D%BF%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E5%88%9B%E4%B8%9A%E6%9D%BF%22%2C%22displayValue%22%3A%22%E5%88%9B%E4%B8%9A%E6%9D%BF%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E7%A7%91%E5%88%9B%E6%9D%BF%22%2C%22displayValue%22%3A%22%E7%A7%91%E5%88%9B%E6%9D%BF%22%2C%22selected%22%3Afalse%7D%5D%7D","type":"Literal","bound_global_parameter":null},{"name":"industry_cond","value":"%7B%22enumItems%22%3A%5B%7B%22value%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22displayValue%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E4%BA%A4%E9%80%9A%E8%BF%90%E8%BE%93%22%2C%22displayValue%22%3A%22%E4%BA%A4%E9%80%9A%E8%BF%90%E8%BE%93%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%BC%91%E9%97%B2%E6%9C%8D%E5%8A%A1%22%2C%22displayValue%22%3A%22%E4%BC%91%E9%97%B2%E6%9C%8D%E5%8A%A1%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%BC%A0%E5%AA%92%2F%E4%BF%A1%E6%81%AF%E6%9C%8D%E5%8A%A1%22%2C%22displayValue%22%3A%22%E4%BC%A0%E5%AA%92%2F%E4%BF%A1%E6%81%AF%E6%9C%8D%E5%8A%A1%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%85%AC%E7%94%A8%E4%BA%8B%E4%B8%9A%22%2C%22displayValue%22%3A%22%E5%85%AC%E7%94%A8%E4%BA%8B%E4%B8%9A%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%86%9C%E6%9E%97%E7%89%A7%E6%B8%94%22%2C%22displayValue%22%3A%22%E5%86%9C%E6%9E%97%E7%89%A7%E6%B8%94%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%8C%96%E5%B7%A5%22%2C%22displayValue%22%3A%22%E5%8C%96%E5%B7%A5%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%8C%BB%E8%8D%AF%E7%94%9F%E7%89%A9%22%2C%22displayValue%22%3A%22%E5%8C%BB%E8%8D%AF%E7%94%9F%E7%89%A9%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%95%86%E4%B8%9A%E8%B4%B8%E6%98%93%22%2C%22displayValue%22%3A%22%E5%95%86%E4%B8%9A%E8%B4%B8%E6%98%93%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%9B%BD%E9%98%B2%E5%86%9B%E5%B7%A5%22%2C%22displayValue%22%3A%22%E5%9B%BD%E9%98%B2%E5%86%9B%E5%B7%A5%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%AE%B6%E7%94%A8%E7%94%B5%E5%99%A8%22%2C%22displayValue%22%3A%22%E5%AE%B6%E7%94%A8%E7%94%B5%E5%99%A8%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%BB%BA%E7%AD%91%E6%9D%90%E6%96%99%2F%E5%BB%BA%E7%AD%91%E5%BB%BA%E6%9D%90%22%2C%22displayValue%22%3A%22%E5%BB%BA%E7%AD%91%E6%9D%90%E6%96%99%2F%E5%BB%BA%E7%AD%91%E5%BB%BA%E6%9D%90%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%BB%BA%E7%AD%91%E8%A3%85%E9%A5%B0%22%2C%22displayValue%22%3A%22%E5%BB%BA%E7%AD%91%E8%A3%85%E9%A5%B0%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%88%BF%E5%9C%B0%E4%BA%A7%22%2C%22displayValue%22%3A%22%E6%88%BF%E5%9C%B0%E4%BA%A7%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%9C%89%E8%89%B2%E9%87%91%E5%B1%9E%22%2C%22displayValue%22%3A%22%E6%9C%89%E8%89%B2%E9%87%91%E5%B1%9E%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%9C%BA%E6%A2%B0%E8%AE%BE%E5%A4%87%22%2C%22displayValue%22%3A%22%E6%9C%BA%E6%A2%B0%E8%AE%BE%E5%A4%87%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%B1%BD%E8%BD%A6%2F%E4%BA%A4%E8%BF%90%E8%AE%BE%E5%A4%87%22%2C%22displayValue%22%3A%22%E6%B1%BD%E8%BD%A6%2F%E4%BA%A4%E8%BF%90%E8%AE%BE%E5%A4%87%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E7%94%B5%E5%AD%90%22%2C%22displayValue%22%3A%22%E7%94%B5%E5%AD%90%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E7%94%B5%E6%B0%94%E8%AE%BE%E5%A4%87%22%2C%22displayValue%22%3A%22%E7%94%B5%E6%B0%94%E8%AE%BE%E5%A4%87%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E7%BA%BA%E7%BB%87%E6%9C%8D%E8%A3%85%22%2C%22displayValue%22%3A%22%E7%BA%BA%E7%BB%87%E6%9C%8D%E8%A3%85%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E7%BB%BC%E5%90%88%22%2C%22displayValue%22%3A%22%E7%BB%BC%E5%90%88%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E8%AE%A1%E7%AE%97%E6%9C%BA%22%2C%22displayValue%22%3A%22%E8%AE%A1%E7%AE%97%E6%9C%BA%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E8%BD%BB%E5%B7%A5%E5%88%B6%E9%80%A0%22%2C%22displayValue%22%3A%22%E8%BD%BB%E5%B7%A5%E5%88%B6%E9%80%A0%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%80%9A%E4%BF%A1%22%2C%22displayValue%22%3A%22%E9%80%9A%E4%BF%A1%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%87%87%E6%8E%98%22%2C%22displayValue%22%3A%22%E9%87%87%E6%8E%98%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%92%A2%E9%93%81%22%2C%22displayValue%22%3A%22%E9%92%A2%E9%93%81%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%93%B6%E8%A1%8C%22%2C%22displayValue%22%3A%22%E9%93%B6%E8%A1%8C%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%9D%9E%E9%93%B6%E9%87%91%E8%9E%8D%22%2C%22displayValue%22%3A%22%E9%9D%9E%E9%93%B6%E9%87%91%E8%9E%8D%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%A3%9F%E5%93%81%E9%A5%AE%E6%96%99%22%2C%22displayValue%22%3A%22%E9%A3%9F%E5%93%81%E9%A5%AE%E6%96%99%22%2C%22selected%22%3Afalse%7D%5D%7D","type":"Literal","bound_global_parameter":null},{"name":"st_cond","value":"%7B%22enumItems%22%3A%5B%7B%22value%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22displayValue%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%AD%A3%E5%B8%B8%22%2C%22displayValue%22%3A%22%E6%AD%A3%E5%B8%B8%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22ST%22%2C%22displayValue%22%3A%22ST%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22*ST%22%2C%22displayValue%22%3A%22*ST%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%9A%82%E5%81%9C%E4%B8%8A%E5%B8%82%22%2C%22displayValue%22%3A%22%E6%9A%82%E5%81%9C%E4%B8%8A%E5%B8%82%22%2C%22selected%22%3Afalse%7D%5D%7D","type":"Literal","bound_global_parameter":null},{"name":"delist_cond","value":"%7B%22enumItems%22%3A%5B%7B%22value%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22displayValue%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%80%80%E5%B8%82%22%2C%22displayValue%22%3A%22%E9%80%80%E5%B8%82%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%9D%9E%E9%80%80%E5%B8%82%22%2C%22displayValue%22%3A%22%E9%9D%9E%E9%80%80%E5%B8%82%22%2C%22selected%22%3Atrue%7D%5D%7D","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":"-142"}],"output_ports":[{"name":"data","node_id":"-142"},{"name":"left_data","node_id":"-142"}],"cacheable":true,"seq_num":4,"comment":"","comment_collapsed":true},{"node_id":"-152","module_id":"BigQuantSpace.chinaa_stock_filter.chinaa_stock_filter-v1","parameters":[{"name":"index_constituent_cond","value":"%7B%22enumItems%22%3A%5B%7B%22value%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22displayValue%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E4%B8%8A%E8%AF%8150%22%2C%22displayValue%22%3A%22%E4%B8%8A%E8%AF%8150%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%B2%AA%E6%B7%B1300%22%2C%22displayValue%22%3A%22%E6%B2%AA%E6%B7%B1300%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%B8%AD%E8%AF%81500%22%2C%22displayValue%22%3A%22%E4%B8%AD%E8%AF%81500%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%B8%AD%E8%AF%81800%22%2C%22displayValue%22%3A%22%E4%B8%AD%E8%AF%81800%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%B8%8A%E8%AF%81180%22%2C%22displayValue%22%3A%22%E4%B8%8A%E8%AF%81180%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%B8%AD%E8%AF%81100%22%2C%22displayValue%22%3A%22%E4%B8%AD%E8%AF%81100%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%B7%B1%E8%AF%81100%22%2C%22displayValue%22%3A%22%E6%B7%B1%E8%AF%81100%22%2C%22selected%22%3Afalse%7D%5D%7D","type":"Literal","bound_global_parameter":null},{"name":"board_cond","value":"%7B%22enumItems%22%3A%5B%7B%22value%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22displayValue%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%B8%8A%E8%AF%81%E4%B8%BB%E6%9D%BF%22%2C%22displayValue%22%3A%22%E4%B8%8A%E8%AF%81%E4%B8%BB%E6%9D%BF%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E6%B7%B1%E8%AF%81%E4%B8%BB%E6%9D%BF%22%2C%22displayValue%22%3A%22%E6%B7%B1%E8%AF%81%E4%B8%BB%E6%9D%BF%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E5%88%9B%E4%B8%9A%E6%9D%BF%22%2C%22displayValue%22%3A%22%E5%88%9B%E4%B8%9A%E6%9D%BF%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E7%A7%91%E5%88%9B%E6%9D%BF%22%2C%22displayValue%22%3A%22%E7%A7%91%E5%88%9B%E6%9D%BF%22%2C%22selected%22%3Afalse%7D%5D%7D","type":"Literal","bound_global_parameter":null},{"name":"industry_cond","value":"%7B%22enumItems%22%3A%5B%7B%22value%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22displayValue%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E4%BA%A4%E9%80%9A%E8%BF%90%E8%BE%93%22%2C%22displayValue%22%3A%22%E4%BA%A4%E9%80%9A%E8%BF%90%E8%BE%93%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%BC%91%E9%97%B2%E6%9C%8D%E5%8A%A1%22%2C%22displayValue%22%3A%22%E4%BC%91%E9%97%B2%E6%9C%8D%E5%8A%A1%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%BC%A0%E5%AA%92%2F%E4%BF%A1%E6%81%AF%E6%9C%8D%E5%8A%A1%22%2C%22displayValue%22%3A%22%E4%BC%A0%E5%AA%92%2F%E4%BF%A1%E6%81%AF%E6%9C%8D%E5%8A%A1%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%85%AC%E7%94%A8%E4%BA%8B%E4%B8%9A%22%2C%22displayValue%22%3A%22%E5%85%AC%E7%94%A8%E4%BA%8B%E4%B8%9A%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%86%9C%E6%9E%97%E7%89%A7%E6%B8%94%22%2C%22displayValue%22%3A%22%E5%86%9C%E6%9E%97%E7%89%A7%E6%B8%94%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%8C%96%E5%B7%A5%22%2C%22displayValue%22%3A%22%E5%8C%96%E5%B7%A5%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%8C%BB%E8%8D%AF%E7%94%9F%E7%89%A9%22%2C%22displayValue%22%3A%22%E5%8C%BB%E8%8D%AF%E7%94%9F%E7%89%A9%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%95%86%E4%B8%9A%E8%B4%B8%E6%98%93%22%2C%22displayValue%22%3A%22%E5%95%86%E4%B8%9A%E8%B4%B8%E6%98%93%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%9B%BD%E9%98%B2%E5%86%9B%E5%B7%A5%22%2C%22displayValue%22%3A%22%E5%9B%BD%E9%98%B2%E5%86%9B%E5%B7%A5%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%AE%B6%E7%94%A8%E7%94%B5%E5%99%A8%22%2C%22displayValue%22%3A%22%E5%AE%B6%E7%94%A8%E7%94%B5%E5%99%A8%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%BB%BA%E7%AD%91%E6%9D%90%E6%96%99%2F%E5%BB%BA%E7%AD%91%E5%BB%BA%E6%9D%90%22%2C%22displayValue%22%3A%22%E5%BB%BA%E7%AD%91%E6%9D%90%E6%96%99%2F%E5%BB%BA%E7%AD%91%E5%BB%BA%E6%9D%90%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%BB%BA%E7%AD%91%E8%A3%85%E9%A5%B0%22%2C%22displayValue%22%3A%22%E5%BB%BA%E7%AD%91%E8%A3%85%E9%A5%B0%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%88%BF%E5%9C%B0%E4%BA%A7%22%2C%22displayValue%22%3A%22%E6%88%BF%E5%9C%B0%E4%BA%A7%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%9C%89%E8%89%B2%E9%87%91%E5%B1%9E%22%2C%22displayValue%22%3A%22%E6%9C%89%E8%89%B2%E9%87%91%E5%B1%9E%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%9C%BA%E6%A2%B0%E8%AE%BE%E5%A4%87%22%2C%22displayValue%22%3A%22%E6%9C%BA%E6%A2%B0%E8%AE%BE%E5%A4%87%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%B1%BD%E8%BD%A6%2F%E4%BA%A4%E8%BF%90%E8%AE%BE%E5%A4%87%22%2C%22displayValue%22%3A%22%E6%B1%BD%E8%BD%A6%2F%E4%BA%A4%E8%BF%90%E8%AE%BE%E5%A4%87%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E7%94%B5%E5%AD%90%22%2C%22displayValue%22%3A%22%E7%94%B5%E5%AD%90%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E7%94%B5%E6%B0%94%E8%AE%BE%E5%A4%87%22%2C%22displayValue%22%3A%22%E7%94%B5%E6%B0%94%E8%AE%BE%E5%A4%87%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E7%BA%BA%E7%BB%87%E6%9C%8D%E8%A3%85%22%2C%22displayValue%22%3A%22%E7%BA%BA%E7%BB%87%E6%9C%8D%E8%A3%85%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E7%BB%BC%E5%90%88%22%2C%22displayValue%22%3A%22%E7%BB%BC%E5%90%88%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E8%AE%A1%E7%AE%97%E6%9C%BA%22%2C%22displayValue%22%3A%22%E8%AE%A1%E7%AE%97%E6%9C%BA%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E8%BD%BB%E5%B7%A5%E5%88%B6%E9%80%A0%22%2C%22displayValue%22%3A%22%E8%BD%BB%E5%B7%A5%E5%88%B6%E9%80%A0%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%80%9A%E4%BF%A1%22%2C%22displayValue%22%3A%22%E9%80%9A%E4%BF%A1%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%87%87%E6%8E%98%22%2C%22displayValue%22%3A%22%E9%87%87%E6%8E%98%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%92%A2%E9%93%81%22%2C%22displayValue%22%3A%22%E9%92%A2%E9%93%81%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%93%B6%E8%A1%8C%22%2C%22displayValue%22%3A%22%E9%93%B6%E8%A1%8C%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%9D%9E%E9%93%B6%E9%87%91%E8%9E%8D%22%2C%22displayValue%22%3A%22%E9%9D%9E%E9%93%B6%E9%87%91%E8%9E%8D%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%A3%9F%E5%93%81%E9%A5%AE%E6%96%99%22%2C%22displayValue%22%3A%22%E9%A3%9F%E5%93%81%E9%A5%AE%E6%96%99%22%2C%22selected%22%3Afalse%7D%5D%7D","type":"Literal","bound_global_parameter":null},{"name":"st_cond","value":"%7B%22enumItems%22%3A%5B%7B%22value%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22displayValue%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%AD%A3%E5%B8%B8%22%2C%22displayValue%22%3A%22%E6%AD%A3%E5%B8%B8%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22ST%22%2C%22displayValue%22%3A%22ST%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22*ST%22%2C%22displayValue%22%3A%22*ST%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%9A%82%E5%81%9C%E4%B8%8A%E5%B8%82%22%2C%22displayValue%22%3A%22%E6%9A%82%E5%81%9C%E4%B8%8A%E5%B8%82%22%2C%22selected%22%3Afalse%7D%5D%7D","type":"Literal","bound_global_parameter":null},{"name":"delist_cond","value":"%7B%22enumItems%22%3A%5B%7B%22value%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22displayValue%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%80%80%E5%B8%82%22%2C%22displayValue%22%3A%22%E9%80%80%E5%B8%82%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%9D%9E%E9%80%80%E5%B8%82%22%2C%22displayValue%22%3A%22%E9%9D%9E%E9%80%80%E5%B8%82%22%2C%22selected%22%3Atrue%7D%5D%7D","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":"-152"}],"output_ports":[{"name":"data","node_id":"-152"},{"name":"left_data","node_id":"-152"}],"cacheable":true,"seq_num":5,"comment":"","comment_collapsed":true},{"node_id":"-161","module_id":"BigQuantSpace.replace_inf_dropna.replace_inf_dropna-v1","parameters":[],"input_ports":[{"name":"input_1","node_id":"-161"}],"output_ports":[{"name":"data_1","node_id":"-161"}],"cacheable":true,"seq_num":21,"comment":"","comment_collapsed":true},{"node_id":"-164","module_id":"BigQuantSpace.replace_inf_dropna.replace_inf_dropna-v1","parameters":[],"input_ports":[{"name":"input_1","node_id":"-164"}],"output_ports":[{"name":"data_1","node_id":"-164"}],"cacheable":true,"seq_num":22,"comment":"","comment_collapsed":true},{"node_id":"-197","module_id":"BigQuantSpace.tradex.tradex-v1","parameters":[{"name":"start_date","value":"","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"","type":"Literal","bound_global_parameter":null},{"name":"handle_data","value":"# 回测引擎:每日数据处理函数,每天执行一次\ndef bigquant_run(context, data):\n # curr_data:用于当前handle_bar,各处理函数可以用 curr_data 传递数据\n context.curr_data = {}\n if 'handle_bar_functions' in context.options:\n for func in context.options['handle_bar_functions']:\n if not func(context, data):\n # 如果有处理函数返回False,则表示跳过后续执行\n return\n","type":"Literal","bound_global_parameter":null},{"name":"prepare","value":"# 回测引擎:准备数据,只执行一次\ndef bigquant_run(context):\n pass\n","type":"Literal","bound_global_parameter":null},{"name":"initialize","value":"# 回测引擎:初始化函数,只执行一次\ndef bigquant_run(context):\n if 'initialize_functions' in context.options:\n for func in context.options['initialize_functions']:\n if not func(context):\n # 如果有处理函数返回False,则表示跳过后续执行\n return\n","type":"Literal","bound_global_parameter":null},{"name":"before_trading_start","value":"# 回测引擎:每个单位时间开始前调用一次,即每日开盘前调用一次。\ndef bigquant_run(context, data):\n pass\n","type":"Literal","bound_global_parameter":null},{"name":"volume_limit","value":0.025,"type":"Literal","bound_global_parameter":null},{"name":"order_price_field_buy","value":"open","type":"Literal","bound_global_parameter":null},{"name":"order_price_field_sell","value":"close","type":"Literal","bound_global_parameter":null},{"name":"capital_base","value":"100000","type":"Literal","bound_global_parameter":null},{"name":"auto_cancel_non_tradable_orders","value":"True","type":"Literal","bound_global_parameter":null},{"name":"data_frequency","value":"daily","type":"Literal","bound_global_parameter":null},{"name":"price_type","value":"真实价格","type":"Literal","bound_global_parameter":null},{"name":"product_type","value":"股票","type":"Literal","bound_global_parameter":null},{"name":"plot_charts","value":"True","type":"Literal","bound_global_parameter":null},{"name":"backtest_only","value":"False","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-197"},{"name":"history_ds","node_id":"-197"},{"name":"benchmark","node_id":"-197"},{"name":"trading_calendar","node_id":"-197"},{"name":"initialize_functions","node_id":"-197"},{"name":"handle_bar_functions","node_id":"-197"},{"name":"options_data","node_id":"-197"}],"output_ports":[{"name":"raw_perf","node_id":"-197"}],"cacheable":false,"seq_num":6,"comment":"","comment_collapsed":true},{"node_id":"-240","module_id":"BigQuantSpace.stock_ranker_train.stock_ranker_train-v6","parameters":[{"name":"learning_algorithm","value":"排序","type":"Literal","bound_global_parameter":null},{"name":"number_of_leaves","value":"800","type":"Literal","bound_global_parameter":null},{"name":"minimum_docs_per_leaf","value":"100000","type":"Literal","bound_global_parameter":null},{"name":"number_of_trees","value":"400","type":"Literal","bound_global_parameter":null},{"name":"learning_rate","value":"0.5","type":"Literal","bound_global_parameter":null},{"name":"max_bins","value":"1023","type":"Literal","bound_global_parameter":null},{"name":"feature_fraction","value":"1","type":"Literal","bound_global_parameter":null},{"name":"data_row_fraction","value":"0.999","type":"Literal","bound_global_parameter":null},{"name":"ndcg_discount_base","value":1,"type":"Literal","bound_global_parameter":null},{"name":"m_lazy_run","value":"False","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"training_ds","node_id":"-240"},{"name":"features","node_id":"-240"},{"name":"test_ds","node_id":"-240"},{"name":"base_model","node_id":"-240"}],"output_ports":[{"name":"model","node_id":"-240"},{"name":"feature_gains","node_id":"-240"},{"name":"m_lazy_run","node_id":"-240"}],"cacheable":true,"seq_num":19,"comment":"","comment_collapsed":true},{"node_id":"-255","module_id":"BigQuantSpace.stock_ranker_predict.stock_ranker_predict-v5","parameters":[{"name":"m_lazy_run","value":"False","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"model","node_id":"-255"},{"name":"data","node_id":"-255"}],"output_ports":[{"name":"predictions","node_id":"-255"},{"name":"m_lazy_run","node_id":"-255"}],"cacheable":true,"seq_num":23,"comment":"","comment_collapsed":true},{"node_id":"-259","module_id":"BigQuantSpace.trade_func_set_commission.trade_func_set_commission-v1","parameters":[{"name":"mode","value":"订单/PerOrder","type":"Literal","bound_global_parameter":null},{"name":"buy_cost","value":0.0003,"type":"Literal","bound_global_parameter":null},{"name":"sell_cost","value":0.0013,"type":"Literal","bound_global_parameter":null},{"name":"min_cost","value":"3","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_functions","node_id":"-259"}],"output_ports":[{"name":"functions","node_id":"-259"}],"cacheable":false,"seq_num":24,"comment":"","comment_collapsed":true},{"node_id":"-266","module_id":"BigQuantSpace.trade_func_rebalance_manage.trade_func_rebalance_manage-v1","parameters":[{"name":"mode","value":"滚动","type":"Literal","bound_global_parameter":null},{"name":"period","value":5,"type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_functions","node_id":"-266"}],"output_ports":[{"name":"functions","node_id":"-266"}],"cacheable":false,"seq_num":25,"comment":"","comment_collapsed":true},{"node_id":"-271","module_id":"BigQuantSpace.trade_func_buy_by_rank.trade_func_buy_by_rank-v1","parameters":[{"name":"mode","value":"对数权重","type":"Literal","bound_global_parameter":null},{"name":"bias","value":2,"type":"Literal","bound_global_parameter":null},{"name":"stock_count","value":"10","type":"Literal","bound_global_parameter":null},{"name":"unit","value":0,"type":"Literal","bound_global_parameter":null},{"name":"max_position_per_instrument","value":"1","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_functions","node_id":"-271"}],"output_ports":[{"name":"functions","node_id":"-271"}],"cacheable":false,"seq_num":26,"comment":"","comment_collapsed":true},{"node_id":"-279","module_id":"BigQuantSpace.trade_func_sell_by_rank.trade_func_sell_by_rank-v1","parameters":[],"input_ports":[{"name":"input_functions","node_id":"-279"}],"output_ports":[{"name":"functions","node_id":"-279"}],"cacheable":false,"seq_num":27,"comment":"","comment_collapsed":true},{"node_id":"-423","module_id":"BigQuantSpace.sort.sort-v4","parameters":[{"name":"sort_by","value":"position","type":"Literal","bound_global_parameter":null},{"name":"group_by","value":"date","type":"Literal","bound_global_parameter":null},{"name":"keep_columns","value":"--","type":"Literal","bound_global_parameter":null},{"name":"ascending","value":"True","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_ds","node_id":"-423"},{"name":"sort_by_ds","node_id":"-423"}],"output_ports":[{"name":"sorted_data","node_id":"-423"}],"cacheable":true,"seq_num":20,"comment":"","comment_collapsed":true},{"node_id":"-727","module_id":"BigQuantSpace.hyper_parameter_search.hyper_parameter_search-v1","parameters":[{"name":"param_grid_builder","value":"def bigquant_run():\n param_grid = {}\n\n # 在这里设置需要调优的参数备选\n param_grid['m3.features'] = ['close_1/close_0', 'close_2/close_0', 'close_3/close_0']\n param_grid['m19.number_of_trees'] = [5, 10, 20]\n\n return param_grid\n","type":"Literal","bound_global_parameter":null},{"name":"scoring","value":"def bigquant_run(result):\n score = result.get('m6').read_raw_perf()['sharpe'].tail(1)[0]\n\n return {'score': score}\n","type":"Literal","bound_global_parameter":null},{"name":"search_algorithm","value":"随机搜索","type":"Literal","bound_global_parameter":null},{"name":"search_iterations","value":10,"type":"Literal","bound_global_parameter":null},{"name":"random_state","value":"","type":"Literal","bound_global_parameter":null},{"name":"workers","value":1,"type":"Literal","bound_global_parameter":null},{"name":"worker_distributed_run","value":"True","type":"Literal","bound_global_parameter":null},{"name":"worker_silent","value":"True","type":"Literal","bound_global_parameter":null},{"name":"run_now","value":"True","type":"Literal","bound_global_parameter":null},{"name":"bq_graph","value":"True","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"bq_graph_port","node_id":"-727"},{"name":"input_1","node_id":"-727"},{"name":"input_2","node_id":"-727"},{"name":"input_3","node_id":"-727"}],"output_ports":[{"name":"result","node_id":"-727"}],"cacheable":false,"seq_num":8,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-8' Position='211,64,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-15' Position='70,183,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-24' Position='699,83,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-53' Position='249,375,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-62' Position='1087,119,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-84' Position='347,519,200,200'/><node_position Node='-86' Position='1061,488,200,200'/><node_position Node='-215' Position='381,189,200,200'/><node_position Node='-222' Position='385,280,200,200'/><node_position Node='-231' Position='1078,236,200,200'/><node_position Node='-238' Position='1081,327,200,200'/><node_position Node='-404' Position='1467,367,200,200'/><node_position Node='-409' Position='1316,532,200,200'/><node_position Node='-416' Position='1159,787,200,200'/><node_position Node='-142' Position='296,452,200,200'/><node_position Node='-152' Position='1082,408,200,200'/><node_position Node='-161' Position='364,590,200,200'/><node_position Node='-164' Position='1042,562,200,200'/><node_position Node='-197' Position='1039,969,200,200'/><node_position Node='-240' Position='589,668,200,200'/><node_position Node='-255' Position='819,735,200,200'/><node_position Node='-259' Position='1247,1035,200,200'/><node_position Node='-266' Position='1521,711,200,200'/><node_position Node='-271' Position='1518,785,200,200'/><node_position Node='-279' Position='1520,865,200,200'/><node_position Node='-423' Position='1224,863,200,200'/><node_position Node='-727' Position='659.4889526367188,315.3172302246094,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
    In [4]:
    # 本代码由可视化策略环境自动生成 2021年10月16日 14:59
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    # 回测引擎:每日数据处理函数,每天执行一次
    def m6_handle_data_bigquant_run(context, data):
        # curr_data:用于当前handle_bar,各处理函数可以用 curr_data 传递数据
        context.curr_data = {}
        if 'handle_bar_functions' in context.options:
            for func in context.options['handle_bar_functions']:
                if not func(context, data):
                    # 如果有处理函数返回False,则表示跳过后续执行
                    return
    
    # 回测引擎:准备数据,只执行一次
    def m6_prepare_bigquant_run(context):
        pass
    
    # 回测引擎:初始化函数,只执行一次
    def m6_initialize_bigquant_run(context):
        if 'initialize_functions' in context.options:
            for func in context.options['initialize_functions']:
                if not func(context):
                    # 如果有处理函数返回False,则表示跳过后续执行
                    return
    
    # 回测引擎:每个单位时间开始前调用一次,即每日开盘前调用一次。
    def m6_before_trading_start_bigquant_run(context, data):
        pass
    
    
    g = T.Graph({
    
        'm1': 'M.instruments.v2',
        'm1.start_date': '2015-01-01',
        'm1.end_date': '2019-01-01',
        'm1.market': 'CN_STOCK_A',
        'm1.instrument_list': '',
        'm1.max_count': 0,
    
        'm2': 'M.advanced_auto_labeler.v2',
        'm2.instruments': T.Graph.OutputPort('m1.data'),
        'm2.label_expr': """# #号开始的表示注释
    # 0. 每行一个,顺序执行,从第二个开始,可以使用label字段
    # 1. 可用数据字段见 https://bigquant.com/docs/develop/datasource/deprecated/history_data.html
    #   添加benchmark_前缀,可使用对应的benchmark数据
    # 2. 可用操作符和函数见 `表达式引擎 <https://bigquant.com/docs/develop/bigexpr/usage.html>`_
    
    # 计算收益:5日收盘价(作为卖出价格)除以明日开盘价(作为买入价格)
    shift(close, -5) / shift(open, -1)
    
    # 极值处理:用1%和99%分位的值做clip
    clip(label, all_quantile(label, 0.01), all_quantile(label, 0.99))
    
    # 将分数映射到分类,这里使用20个分类
    all_wbins(label, 20)
    
    # 过滤掉一字涨停的情况 (设置label为NaN,在后续处理和训练中会忽略NaN的label)
    where(shift(high, -1) == shift(low, -1), NaN, label)
    """,
        'm2.start_date': '',
        'm2.end_date': '',
        'm2.benchmark': '000300.SHA',
        'm2.drop_na_label': True,
        'm2.cast_label_int': True,
    
        'm3': 'M.input_features.v1',
        'm3.features': """# #号开始的表示注释
    # 多个特征,每行一个,可以包含基础特征和衍生特征
    return_5
    return_10
    return_20
    avg_amount_0/avg_amount_5
    avg_amount_5/avg_amount_20
    rank_avg_amount_0/rank_avg_amount_5
    rank_avg_amount_5/rank_avg_amount_10
    rank_return_0
    rank_return_5
    rank_return_10
    rank_return_0/rank_return_5
    rank_return_5/rank_return_10
    pe_ttm_0
    avg_amount_60
    mf_net_amount_l_0#大单净流入净额
    mf_net_amount_m_0#中单净流入净额
    mf_net_amount_main_0#主力净流入净额
    mf_net_amount_xl_0#超大单净流入净额
    mf_net_pct_l_0#大单净流入占比
    mf_net_pct_m_0#中单净流入占比
    mf_net_pct_main_0#主力净流入占比
    mf_net_pct_xl_0#超大单净流入占比
    volume_5#第前 5个交易日的交易量
    volume_10#第前 10个交易日的交易量
    ta_macd_macd_12_26_9_0#MACD
    ta_stoch_slowd_5_3_0_3_0_0#指标D值
    ta_stoch_slowk_5_3_0_3_0_0#指标K值
    some_alias=ta_rsi_14_0#RSI指标,timeperiod=14
    some_alias=ta_rsi_28_0#RSI指标,timeperiod=28
    volume_5#第5前个交易日的交易量
    volume_10#第10前个交易日的交易量
    return_1
    
    
    """,
    
        'm15': 'M.general_feature_extractor.v7',
        'm15.instruments': T.Graph.OutputPort('m1.data'),
        'm15.features': T.Graph.OutputPort('m3.data'),
        'm15.start_date': '',
        'm15.end_date': '',
        'm15.before_start_days': 90,
    
        'm16': 'M.derived_feature_extractor.v3',
        'm16.input_data': T.Graph.OutputPort('m15.data'),
        'm16.features': T.Graph.OutputPort('m3.data'),
        'm16.date_col': 'date',
        'm16.instrument_col': 'instrument',
        'm16.drop_na': False,
        'm16.remove_extra_columns': False,
    
        'm7': 'M.join.v3',
        'm7.data1': T.Graph.OutputPort('m2.data'),
        'm7.data2': T.Graph.OutputPort('m16.data'),
        'm7.on': 'date,instrument',
        'm7.how': 'inner',
        'm7.sort': False,
    
        'm4': 'M.chinaa_stock_filter.v1',
        'm4.input_data': T.Graph.OutputPort('m7.data'),
        'm4.index_constituent_cond': ['全部'],
        'm4.board_cond': ['上证主板', '深证主板'],
        'm4.industry_cond': ['全部'],
        'm4.st_cond': ['正常'],
        'm4.delist_cond': ['非退市'],
        'm4.output_left_data': False,
    
        'm13': 'M.dropnan.v1',
        'm13.input_data': T.Graph.OutputPort('m4.data'),
    
        'm21': 'M.replace_inf_dropna.v1',
        'm21.input_1': T.Graph.OutputPort('m13.data'),
    
        'm19': 'M.stock_ranker_train.v6',
        'm19.training_ds': T.Graph.OutputPort('m21.data_1'),
        'm19.features': T.Graph.OutputPort('m3.data'),
        'm19.test_ds': T.Graph.OutputPort('m21.data_1'),
        'm19.learning_algorithm': '排序',
        'm19.number_of_leaves': 800,
        'm19.minimum_docs_per_leaf': 100000,
        'm19.number_of_trees': 400,
        'm19.learning_rate': 0.5,
        'm19.max_bins': 1023,
        'm19.feature_fraction': 1,
        'm19.data_row_fraction': 0.999,
        'm19.ndcg_discount_base': 1,
        'm19.m_lazy_run': False,
    
        'm9': 'M.instruments.v2',
        'm9.start_date': T.live_run_param('trading_date', '2019-01-01'),
        'm9.end_date': T.live_run_param('trading_date', '2021-10-1'),
        'm9.market': 'CN_STOCK_A',
        'm9.instrument_list': '',
        'm9.max_count': 0,
    
        'm17': 'M.general_feature_extractor.v7',
        'm17.instruments': T.Graph.OutputPort('m9.data'),
        'm17.features': T.Graph.OutputPort('m3.data'),
        'm17.start_date': '',
        'm17.end_date': '',
        'm17.before_start_days': 90,
    
        'm18': 'M.derived_feature_extractor.v3',
        'm18.input_data': T.Graph.OutputPort('m17.data'),
        'm18.features': T.Graph.OutputPort('m3.data'),
        'm18.date_col': 'date',
        'm18.instrument_col': 'instrument',
        'm18.drop_na': False,
        'm18.remove_extra_columns': False,
    
        'm5': 'M.chinaa_stock_filter.v1',
        'm5.input_data': T.Graph.OutputPort('m18.data'),
        'm5.index_constituent_cond': ['全部'],
        'm5.board_cond': ['上证主板', '深证主板'],
        'm5.industry_cond': ['全部'],
        'm5.st_cond': ['正常'],
        'm5.delist_cond': ['非退市'],
        'm5.output_left_data': False,
    
        'm14': 'M.dropnan.v1',
        'm14.input_data': T.Graph.OutputPort('m5.data'),
    
        'm22': 'M.replace_inf_dropna.v1',
        'm22.input_1': T.Graph.OutputPort('m14.data'),
    
        'm23': 'M.stock_ranker_predict.v5',
        'm23.model': T.Graph.OutputPort('m19.model'),
        'm23.data': T.Graph.OutputPort('m22.data_1'),
        'm23.m_lazy_run': False,
    
        'm10': 'M.input_features.v1',
        'm10.features': """
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    name""",
    
        'm11': 'M.use_datasource.v1',
        'm11.instruments': T.Graph.OutputPort('m9.data'),
        'm11.features': T.Graph.OutputPort('m10.data'),
        'm11.datasource_id': 'instruments_CN_STOCK_A',
        'm11.start_date': '',
        'm11.end_date': '',
    
        'm12': 'M.join.v3',
        'm12.data1': T.Graph.OutputPort('m23.predictions'),
        'm12.data2': T.Graph.OutputPort('m11.data'),
        'm12.on': 'date,instrument',
        'm12.how': 'inner',
        'm12.sort': False,
    
        'm20': 'M.sort.v4',
        'm20.input_ds': T.Graph.OutputPort('m12.data'),
        'm20.sort_by': 'position',
        'm20.group_by': 'date',
        'm20.keep_columns': '--',
        'm20.ascending': True,
    
        'm24': 'M.trade_func_set_commission.v1',
        'm24.mode': '订单/PerOrder',
        'm24.buy_cost': 0.0003,
        'm24.sell_cost': 0.0013,
        'm24.min_cost': 3,
    
        'm25': 'M.trade_func_rebalance_manage.v1',
        'm25.mode': '滚动',
        'm25.period': 5,
    
        'm26': 'M.trade_func_buy_by_rank.v1',
        'm26.input_functions': T.Graph.OutputPort('m25.functions'),
        'm26.mode': '对数权重',
        'm26.bias': 2,
        'm26.stock_count': 10,
        'm26.unit': 0,
        'm26.max_position_per_instrument': 1,
    
        'm27': 'M.trade_func_sell_by_rank.v1',
        'm27.input_functions': T.Graph.OutputPort('m26.functions'),
    
        'm6': 'M.tradex.v1',
        'm6.instruments': T.Graph.OutputPort('m9.data'),
        'm6.initialize_functions': T.Graph.OutputPort('m24.functions'),
        'm6.handle_bar_functions': T.Graph.OutputPort('m27.functions'),
        'm6.options_data': T.Graph.OutputPort('m20.sorted_data'),
        'm6.start_date': '',
        'm6.end_date': '',
        'm6.handle_data': m6_handle_data_bigquant_run,
        'm6.prepare': m6_prepare_bigquant_run,
        'm6.initialize': m6_initialize_bigquant_run,
        'm6.before_trading_start': m6_before_trading_start_bigquant_run,
        'm6.volume_limit': 0.025,
        'm6.order_price_field_buy': 'open',
        'm6.order_price_field_sell': 'close',
        'm6.capital_base': 100000,
        'm6.auto_cancel_non_tradable_orders': True,
        'm6.data_frequency': 'daily',
        'm6.price_type': '真实价格',
        'm6.product_type': '股票',
        'm6.plot_charts': True,
        'm6.backtest_only': False,
    })
    
    # g.run({})
    
    
    def m8_param_grid_builder_bigquant_run():
        param_grid = {}
    
        # 在这里设置需要调优的参数备选
        param_grid['m3.features'] = ['close_1/close_0', 'close_2/close_0', 'close_3/close_0']
        param_grid['m19.number_of_trees'] = [5, 10, 20]
    
        return param_grid
    
    def m8_scoring_bigquant_run(result):
        score = result.get('m6').read_raw_perf()['sharpe'].tail(1)[0]
    
        return {'score': score}
    
    
    m8 = M.hyper_parameter_search.v1(
        param_grid_builder=m8_param_grid_builder_bigquant_run,
        scoring=m8_scoring_bigquant_run,
        search_algorithm='随机搜索',
        search_iterations=10,
        workers=1,
        worker_distributed_run=True,
        worker_silent=True,
        run_now=True,
        bq_graph=g
    )
    
    Fitting 1 folds for each of 9 candidates, totalling 9 fits
    [Parallel(n_jobs=1)]: Using backend SequentialBackend with 1 concurrent workers.
    [CV 1/1; 1/9] START m19.number_of_trees=5, m3.features=close_1/close_0..........
    
    [CV 1/1; 1/9] END m19.number_of_trees=5, m3.features=close_1/close_0; total time= 5.2min
    [Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:  5.2min remaining:    0.0s
    [CV 1/1; 2/9] START m19.number_of_trees=5, m3.features=close_2/close_0..........
    
    [CV 1/1; 2/9] END m19.number_of_trees=5, m3.features=close_2/close_0; total time= 7.4min
    [Parallel(n_jobs=1)]: Done   2 out of   2 | elapsed: 12.6min remaining:    0.0s
    [CV 1/1; 3/9] START m19.number_of_trees=5, m3.features=close_3/close_0..........
    
    [CV 1/1; 3/9] END m19.number_of_trees=5, m3.features=close_3/close_0; total time= 5.4min
    [Parallel(n_jobs=1)]: Done   3 out of   3 | elapsed: 17.9min remaining:    0.0s
    [CV 1/1; 4/9] START m19.number_of_trees=10, m3.features=close_1/close_0.........
    
    [CV 1/1; 4/9] END m19.number_of_trees=10, m3.features=close_1/close_0; total time= 4.5min
    [Parallel(n_jobs=1)]: Done   4 out of   4 | elapsed: 22.5min remaining:    0.0s
    [CV 1/1; 5/9] START m19.number_of_trees=10, m3.features=close_2/close_0.........
    
    [CV 1/1; 5/9] END m19.number_of_trees=10, m3.features=close_2/close_0; total time= 4.4min
    [Parallel(n_jobs=1)]: Done   5 out of   5 | elapsed: 26.8min remaining:    0.0s
    [CV 1/1; 6/9] START m19.number_of_trees=10, m3.features=close_3/close_0.........
    
    [CV 1/1; 6/9] END m19.number_of_trees=10, m3.features=close_3/close_0; total time= 6.2min
    [Parallel(n_jobs=1)]: Done   6 out of   6 | elapsed: 33.0min remaining:    0.0s
    [CV 1/1; 7/9] START m19.number_of_trees=20, m3.features=close_1/close_0.........
    
    [CV 1/1; 7/9] END m19.number_of_trees=20, m3.features=close_1/close_0; total time= 7.5min
    [Parallel(n_jobs=1)]: Done   7 out of   7 | elapsed: 40.6min remaining:    0.0s
    [CV 1/1; 8/9] START m19.number_of_trees=20, m3.features=close_2/close_0.........
    
    [CV 1/1; 8/9] END m19.number_of_trees=20, m3.features=close_2/close_0; total time= 6.2min
    [Parallel(n_jobs=1)]: Done   8 out of   8 | elapsed: 46.7min remaining:    0.0s
    [CV 1/1; 9/9] START m19.number_of_trees=20, m3.features=close_3/close_0.........
    
    [CV 1/1; 9/9] END m19.number_of_trees=20, m3.features=close_3/close_0; total time= 6.6min
    [Parallel(n_jobs=1)]: Done   9 out of   9 | elapsed: 53.3min remaining:    0.0s
    [Parallel(n_jobs=1)]: Done   9 out of   9 | elapsed: 53.3min finished
    
    ---------------------------------------------------------------------------
    Exception                                 Traceback (most recent call last)
    <ipython-input-4-814bacea9a38> in <module>
        287 
        288 
    --> 289 m8 = M.hyper_parameter_search.v1(
        290     param_grid_builder=m8_param_grid_builder_bigquant_run,
        291     scoring=m8_scoring_bigquant_run,
    
    Exception: 任务运行失败, 0f540bf02e4d11ec9df9c294a6a4b5c3 Failed