{"description":"实验创建于2022/7/29","graph":{"edges":[{"to_node_id":"-124:instruments","from_node_id":"-111:data"},{"to_node_id":"-124:features","from_node_id":"-119:data"},{"to_node_id":"-3256:features","from_node_id":"-119:data"},{"to_node_id":"-3256:input_data","from_node_id":"-124:data"},{"to_node_id":"-6195:input_1","from_node_id":"-3256:data"}],"nodes":[{"node_id":"-111","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2019-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2020-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":"-111"}],"output_ports":[{"name":"data","node_id":"-111"}],"cacheable":true,"seq_num":1,"comment":"","comment_collapsed":true},{"node_id":"-119","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nmax_shift_date = ts_argmax(volume_20, 30)\nmax_vol = ts_max(volume_20, 30)\n\nvolume_0\nclose_0\nclose_1","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-119"}],"output_ports":[{"name":"data","node_id":"-119"}],"cacheable":true,"seq_num":2,"comment":"","comment_collapsed":true},{"node_id":"-124","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":"-124"},{"name":"features","node_id":"-124"}],"output_ports":[{"name":"data","node_id":"-124"}],"cacheable":true,"seq_num":3,"comment":"","comment_collapsed":true},{"node_id":"-3256","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":"-3256"},{"name":"features","node_id":"-3256"}],"output_ports":[{"name":"data","node_id":"-3256"}],"cacheable":true,"seq_num":5,"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 - 20 - (30 - x.max_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[\"max_close_0\"] = x.iloc[x.index2.values,:][\"close_0\"].values\n x[\"max_close_1\"] = x.iloc[x.index2.values,:][\"close_1\"].values\n x = x.iloc[50:,]\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":4,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-111' Position='115,153,200,200'/><node_position Node='-119' Position='516,153,200,200'/><node_position Node='-124' Position='310,282,200,200'/><node_position Node='-3256' Position='417,385,200,200'/><node_position Node='-6195' Position='331.0874328613281,503.5379638671875,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
[2022-07-30 13:15:28.382097] INFO: moduleinvoker: instruments.v2 开始运行..
[2022-07-30 13:15:28.394188] INFO: moduleinvoker: 命中缓存
[2022-07-30 13:15:28.395991] INFO: moduleinvoker: instruments.v2 运行完成[0.013911s].
[2022-07-30 13:15:28.400153] INFO: moduleinvoker: input_features.v1 开始运行..
[2022-07-30 13:15:28.407877] INFO: moduleinvoker: 命中缓存
[2022-07-30 13:15:28.409352] INFO: moduleinvoker: input_features.v1 运行完成[0.009193s].
[2022-07-30 13:15:28.422274] INFO: moduleinvoker: general_feature_extractor.v7 开始运行..
[2022-07-30 13:15:28.427935] INFO: moduleinvoker: 命中缓存
[2022-07-30 13:15:28.429596] INFO: moduleinvoker: general_feature_extractor.v7 运行完成[0.007322s].
[2022-07-30 13:15:28.436726] INFO: moduleinvoker: derived_feature_extractor.v3 开始运行..
[2022-07-30 13:15:28.443227] INFO: moduleinvoker: 命中缓存
[2022-07-30 13:15:28.444561] INFO: moduleinvoker: derived_feature_extractor.v3 运行完成[0.007837s].
[2022-07-30 13:15:28.455809] INFO: moduleinvoker: cached.v3 开始运行..
[2022-07-30 13:16:07.725196] INFO: moduleinvoker: cached.v3 运行完成[39.269359s].