{"description":"实验创建于2022/8/9","graph":{"edges":[{"to_node_id":"-243:instruments","from_node_id":"-214:data"},{"to_node_id":"-243:features","from_node_id":"-222:data"},{"to_node_id":"-374:features","from_node_id":"-222:data"},{"to_node_id":"-374:input_data","from_node_id":"-243:data"},{"to_node_id":"-6195:input_1","from_node_id":"-374:data"}],"nodes":[{"node_id":"-214","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2020-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2022-01-01","type":"Literal","bound_global_parameter":null},{"name":"market","value":"CN_STOCK_A","type":"Literal","bound_global_parameter":null},{"name":"instrument_list","value":"000002.SZA","type":"Literal","bound_global_parameter":null},{"name":"max_count","value":0,"type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"rolling_conf","node_id":"-214"}],"output_ports":[{"name":"data","node_id":"-214"}],"cacheable":true,"seq_num":1,"comment":"","comment_collapsed":true},{"node_id":"-222","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nclose_0\nmax_close_shift_date = ts_argmax(close_0, 30)\nmacd = ta_macd_hist(close_0, fastperiod=12, slowperiod=26, signalperiod=9)\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-222"}],"output_ports":[{"name":"data","node_id":"-222"}],"cacheable":true,"seq_num":2,"comment":"","comment_collapsed":true},{"node_id":"-243","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":"0","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-243"},{"name":"features","node_id":"-243"}],"output_ports":[{"name":"data","node_id":"-243"}],"cacheable":true,"seq_num":3,"comment":"","comment_collapsed":true},{"node_id":"-374","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":"-374"},{"name":"features","node_id":"-374"}],"output_ports":[{"name":"data","node_id":"-374"}],"cacheable":true,"seq_num":4,"comment":"","comment_collapsed":true},{"node_id":"-6195","module_id":"BigQuantSpace.cached.cached-v3","parameters":[{"name":"run","value":"# Python 代码入口函数,input_1/2/3 对应三个输入端,data_1/2/3 对应三个输出端\ndef bigquant_run(input_1, input_2, input_3):\n # 示例代码如下。在这里编写您的代码\n df = input_1.read_df()\n def func(_x):\n x = _x.copy()\n x.sort_values(\"date\", inplace=True)\n x.reset_index(drop=True, inplace=True)\n x[\"index2\"] = x.index - (30 - x.max_close_shift_date) + 1\n def del_neg(x):\n x = np.nan if x < 0 else x\n return x\n x[\"index2\"] = x[\"index2\"].apply(del_neg)\n x.replace(np.nan, 0, inplace=True)\n x[\"max_date\"] = x.iloc[x.index2.values,:][\"date\"].values\n x[\"macd2\"] = x.iloc[x.index2.values,:][\"macd\"].values\n x = x.iloc[30:,]\n return x\n result = df.groupby(\"instrument\").apply(func)\n \n result.reset_index(drop=True, inplace=True)\n data_1 = DataSource.write_df(result)\n return Outputs(data_1=data_1, data_2=None, data_3=None)\n","type":"Literal","bound_global_parameter":null},{"name":"post_run","value":"# 后处理函数,可选。输入是主函数的输出,可以在这里对数据做处理,或者返回更友好的outputs数据格式。此函数输出不会被缓存。\ndef bigquant_run(outputs):\n return outputs\n","type":"Literal","bound_global_parameter":null},{"name":"input_ports","value":"","type":"Literal","bound_global_parameter":null},{"name":"params","value":"{}","type":"Literal","bound_global_parameter":null},{"name":"output_ports","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_1","node_id":"-6195"},{"name":"input_2","node_id":"-6195"},{"name":"input_3","node_id":"-6195"}],"output_ports":[{"name":"data_1","node_id":"-6195"},{"name":"data_2","node_id":"-6195"},{"name":"data_3","node_id":"-6195"}],"cacheable":true,"seq_num":5,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-214' Position='59,215,200,200'/><node_position Node='-222' Position='371,215,200,200'/><node_position Node='-243' Position='199,324,200,200'/><node_position Node='-374' Position='234,420,200,200'/><node_position Node='-6195' Position='199,512,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
[2022-08-09 11:44:46.285336] INFO: moduleinvoker: instruments.v2 开始运行..
[2022-08-09 11:44:46.293374] INFO: moduleinvoker: 命中缓存
[2022-08-09 11:44:46.295797] INFO: moduleinvoker: instruments.v2 运行完成[0.010473s].
[2022-08-09 11:44:46.323259] INFO: moduleinvoker: input_features.v1 开始运行..
[2022-08-09 11:44:46.368024] INFO: moduleinvoker: input_features.v1 运行完成[0.044767s].
[2022-08-09 11:44:46.392543] INFO: moduleinvoker: general_feature_extractor.v7 开始运行..
[2022-08-09 11:44:46.401445] INFO: moduleinvoker: 命中缓存
[2022-08-09 11:44:46.404436] INFO: moduleinvoker: general_feature_extractor.v7 运行完成[0.011927s].
[2022-08-09 11:44:46.424478] INFO: moduleinvoker: derived_feature_extractor.v3 开始运行..
[2022-08-09 11:44:46.514485] INFO: derived_feature_extractor: 提取完成 max_close_shift_date = ts_argmax(close_0, 30), 0.006s
[2022-08-09 11:44:46.523618] INFO: derived_feature_extractor: 提取完成 macd = ta_macd_hist(close_0, fastperiod=12, slowperiod=26, signalperiod=9), 0.007s
[2022-08-09 11:44:46.568379] INFO: derived_feature_extractor: /y_2020, 243
[2022-08-09 11:44:46.635001] INFO: derived_feature_extractor: /y_2021, 243
[2022-08-09 11:44:46.800469] INFO: moduleinvoker: derived_feature_extractor.v3 运行完成[0.375972s].
[2022-08-09 11:44:46.816954] INFO: moduleinvoker: cached.v3 开始运行..
[2022-08-09 11:44:46.992170] INFO: moduleinvoker: cached.v3 运行完成[0.175224s].