{"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":"-106:instruments","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-8:data"},{"to_node_id":"-773:input_1","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-15:data"},{"to_node_id":"-132:features_ds","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-768:input_2","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-778:input_2","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-137:input_data","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-53:data"},{"to_node_id":"-122:instruments","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-62:data"},{"to_node_id":"-172:input_1","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-62:data"},{"to_node_id":"-18601:instruments","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-62:data"},{"to_node_id":"-113:input_data","from_node_id":"-106:data"},{"to_node_id":"-768:input_1","from_node_id":"-113:data"},{"to_node_id":"-129:input_data","from_node_id":"-122:data"},{"to_node_id":"-778:input_1","from_node_id":"-129:data"},{"to_node_id":"-2680:inputs","from_node_id":"-160:data"},{"to_node_id":"-3880:inputs","from_node_id":"-160:data"},{"to_node_id":"-1540:trained_model","from_node_id":"-1098:data"},{"to_node_id":"-2431:input_1","from_node_id":"-1540:data"},{"to_node_id":"-209:data1","from_node_id":"-2431:data_1"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-53:data2","from_node_id":"-768:data"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-53:data1","from_node_id":"-773:data"},{"to_node_id":"-2346:input_data","from_node_id":"-778:data"},{"to_node_id":"-3895:input_1","from_node_id":"-243:data"},{"to_node_id":"-3907:input_1","from_node_id":"-251:data"},{"to_node_id":"-2712:inputs","from_node_id":"-2680:data"},{"to_node_id":"-3840:inputs","from_node_id":"-2712:data"},{"to_node_id":"-3784:inputs","from_node_id":"-3773:data"},{"to_node_id":"-3880:outputs","from_node_id":"-3784:data"},{"to_node_id":"-3872:inputs","from_node_id":"-3840:data"},{"to_node_id":"-3773:inputs","from_node_id":"-3872:data"},{"to_node_id":"-1098:input_model","from_node_id":"-3880:data"},{"to_node_id":"-1098:training_data","from_node_id":"-3895:data_1"},{"to_node_id":"-1540:input_data","from_node_id":"-3907:data_1"},{"to_node_id":"-243:input_data","from_node_id":"-137:data"},{"to_node_id":"-251:input_data","from_node_id":"-2346:data"},{"to_node_id":"-2431:input_2","from_node_id":"-2346:data"},{"to_node_id":"-106:features","from_node_id":"-132:data"},{"to_node_id":"-122:features","from_node_id":"-132:data"},{"to_node_id":"-3895:input_2","from_node_id":"-132:data"},{"to_node_id":"-3907:input_2","from_node_id":"-132:data"},{"to_node_id":"-243:features","from_node_id":"-132:data"},{"to_node_id":"-251:features","from_node_id":"-132:data"},{"to_node_id":"-113:features","from_node_id":"-132:data"},{"to_node_id":"-129:features","from_node_id":"-132:data"},{"to_node_id":"-172:input_2","from_node_id":"-170:data"},{"to_node_id":"-209:data2","from_node_id":"-172:data_1"},{"to_node_id":"-18601:options_data","from_node_id":"-209: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-12-31","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/data_history_data.html\n# 添加benchmark_前缀,可使用对应的benchmark数据\n# 2. 可用操作符和函数见 `表达式引擎 <https://bigquant.com/docs/big_expr.html>`_\n\n# 计算收益:5日收盘价(作为卖出价格)除以明日开盘价(作为买入价格)\nshift(close, -2) / shift(open, -1)-1\n\n# 极值处理:用1%和99%分位的值做clip\nclip(label, all_quantile(label, 0.01), all_quantile(label, 0.99))\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":"False","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":"# 资产周转率\nfs_operating_revenue_ttm_0/(fs_non_current_assets_0+fs_current_assets_0) \n# 总盈利/总资产\nfs_total_profit_0/(fs_non_current_assets_0+ fs_current_assets_0) \n# 自营现金流/总资产\nfs_free_cash_flow_0/(fs_non_current_assets_0+ fs_current_assets_0)\n# 总收入/价格 \nfs_operating_revenue_ttm_0/close_0\n# 现金流/股数/股价\nfs_free_cash_flow_0/(fs_common_equity_0/close_0)/close_0\n# 营业收入 Sales to EV\nfs_operating_revenue_ttm_0/fs_common_equity_0\n# EBITDA to EV \nfs_net_income_0/fs_common_equity_0\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":"2020-01-01","type":"Literal","bound_global_parameter":"交易日期"},{"name":"end_date","value":"2021-11-19","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":"-106","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":"-106"},{"name":"features","node_id":"-106"}],"output_ports":[{"name":"data","node_id":"-106"}],"cacheable":true,"seq_num":15,"comment":"","comment_collapsed":true},{"node_id":"-113","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":"True","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":"-113"},{"name":"features","node_id":"-113"}],"output_ports":[{"name":"data","node_id":"-113"}],"cacheable":true,"seq_num":16,"comment":"","comment_collapsed":true},{"node_id":"-122","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":"-122"},{"name":"features","node_id":"-122"}],"output_ports":[{"name":"data","node_id":"-122"}],"cacheable":true,"seq_num":17,"comment":"","comment_collapsed":true},{"node_id":"-129","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":"True","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":"-129"},{"name":"features","node_id":"-129"}],"output_ports":[{"name":"data","node_id":"-129"}],"cacheable":true,"seq_num":18,"comment":"","comment_collapsed":true},{"node_id":"-160","module_id":"BigQuantSpace.dl_layer_input.dl_layer_input-v1","parameters":[{"name":"shape","value":"12,5","type":"Literal","bound_global_parameter":null},{"name":"batch_shape","value":"","type":"Literal","bound_global_parameter":null},{"name":"dtype","value":"float32","type":"Literal","bound_global_parameter":null},{"name":"sparse","value":"False","type":"Literal","bound_global_parameter":null},{"name":"name","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"inputs","node_id":"-160"}],"output_ports":[{"name":"data","node_id":"-160"}],"cacheable":false,"seq_num":6,"comment":"","comment_collapsed":true},{"node_id":"-1098","module_id":"BigQuantSpace.dl_model_train.dl_model_train-v1","parameters":[{"name":"optimizer","value":"RMSprop","type":"Literal","bound_global_parameter":null},{"name":"user_optimizer","value":"","type":"Literal","bound_global_parameter":null},{"name":"loss","value":"mean_squared_error","type":"Literal","bound_global_parameter":null},{"name":"user_loss","value":"","type":"Literal","bound_global_parameter":null},{"name":"metrics","value":"mae","type":"Literal","bound_global_parameter":null},{"name":"batch_size","value":"256","type":"Literal","bound_global_parameter":null},{"name":"epochs","value":"20","type":"Literal","bound_global_parameter":null},{"name":"earlystop","value":"","type":"Literal","bound_global_parameter":null},{"name":"custom_objects","value":"# 用户的自定义层需要写到字典中,比如\n# {\n# \"MyLayer\": MyLayer\n# }\nbigquant_run = {\n \n}\n","type":"Literal","bound_global_parameter":null},{"name":"n_gpus","value":0,"type":"Literal","bound_global_parameter":null},{"name":"verbose","value":"2:每个epoch输出一行记录","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_model","node_id":"-1098"},{"name":"training_data","node_id":"-1098"},{"name":"validation_data","node_id":"-1098"}],"output_ports":[{"name":"data","node_id":"-1098"}],"cacheable":true,"seq_num":5,"comment":"","comment_collapsed":true},{"node_id":"-1540","module_id":"BigQuantSpace.dl_model_predict.dl_model_predict-v1","parameters":[{"name":"batch_size","value":"1024","type":"Literal","bound_global_parameter":null},{"name":"n_gpus","value":0,"type":"Literal","bound_global_parameter":null},{"name":"verbose","value":"2:每个epoch输出一行记录","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"trained_model","node_id":"-1540"},{"name":"input_data","node_id":"-1540"}],"output_ports":[{"name":"data","node_id":"-1540"}],"cacheable":true,"seq_num":11,"comment":"","comment_collapsed":true},{"node_id":"-2431","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 pred_label = input_1.read_pickle()\n df = input_2.read_df()\n df = pd.DataFrame({'pred_label':pred_label[:,0], 'instrument':df.instrument, 'date':df.date})\n df.sort_values(['date','pred_label'],inplace=True, ascending=[True,False])\n return Outputs(data_1=DataSource.write_df(df), 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":"-2431"},{"name":"input_2","node_id":"-2431"},{"name":"input_3","node_id":"-2431"}],"output_ports":[{"name":"data_1","node_id":"-2431"},{"name":"data_2","node_id":"-2431"},{"name":"data_3","node_id":"-2431"}],"cacheable":true,"seq_num":24,"comment":"","comment_collapsed":true},{"node_id":"-768","module_id":"BigQuantSpace.standardlize.standardlize-v8","parameters":[{"name":"columns_input","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_1","node_id":"-768"},{"name":"input_2","node_id":"-768"}],"output_ports":[{"name":"data","node_id":"-768"}],"cacheable":true,"seq_num":14,"comment":"","comment_collapsed":true},{"node_id":"-773","module_id":"BigQuantSpace.standardlize.standardlize-v8","parameters":[{"name":"columns_input","value":"label","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_1","node_id":"-773"},{"name":"input_2","node_id":"-773"}],"output_ports":[{"name":"data","node_id":"-773"}],"cacheable":true,"seq_num":13,"comment":"","comment_collapsed":true},{"node_id":"-778","module_id":"BigQuantSpace.standardlize.standardlize-v8","parameters":[{"name":"columns_input","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_1","node_id":"-778"},{"name":"input_2","node_id":"-778"}],"output_ports":[{"name":"data","node_id":"-778"}],"cacheable":true,"seq_num":25,"comment":"","comment_collapsed":true},{"node_id":"-243","module_id":"BigQuantSpace.dl_convert_to_bin.dl_convert_to_bin-v2","parameters":[{"name":"window_size","value":"5","type":"Literal","bound_global_parameter":null},{"name":"feature_clip","value":5,"type":"Literal","bound_global_parameter":null},{"name":"flatten","value":"True","type":"Literal","bound_global_parameter":null},{"name":"window_along_col","value":"instrument","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_data","node_id":"-243"},{"name":"features","node_id":"-243"}],"output_ports":[{"name":"data","node_id":"-243"}],"cacheable":true,"seq_num":26,"comment":"","comment_collapsed":true},{"node_id":"-251","module_id":"BigQuantSpace.dl_convert_to_bin.dl_convert_to_bin-v2","parameters":[{"name":"window_size","value":"5","type":"Literal","bound_global_parameter":null},{"name":"feature_clip","value":5,"type":"Literal","bound_global_parameter":null},{"name":"flatten","value":"True","type":"Literal","bound_global_parameter":null},{"name":"window_along_col","value":"instrument","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_data","node_id":"-251"},{"name":"features","node_id":"-251"}],"output_ports":[{"name":"data","node_id":"-251"}],"cacheable":true,"seq_num":27,"comment":"","comment_collapsed":true},{"node_id":"-2680","module_id":"BigQuantSpace.dl_layer_conv1d.dl_layer_conv1d-v1","parameters":[{"name":"filters","value":"20","type":"Literal","bound_global_parameter":null},{"name":"kernel_size","value":"3","type":"Literal","bound_global_parameter":null},{"name":"strides","value":"1","type":"Literal","bound_global_parameter":null},{"name":"padding","value":"valid","type":"Literal","bound_global_parameter":null},{"name":"dilation_rate","value":1,"type":"Literal","bound_global_parameter":null},{"name":"activation","value":"relu","type":"Literal","bound_global_parameter":null},{"name":"user_activation","value":"","type":"Literal","bound_global_parameter":null},{"name":"use_bias","value":"True","type":"Literal","bound_global_parameter":null},{"name":"kernel_initializer","value":"glorot_uniform","type":"Literal","bound_global_parameter":null},{"name":"user_kernel_initializer","value":"","type":"Literal","bound_global_parameter":null},{"name":"bias_initializer","value":"Zeros","type":"Literal","bound_global_parameter":null},{"name":"user_bias_initializer","value":"","type":"Literal","bound_global_parameter":null},{"name":"kernel_regularizer","value":"None","type":"Literal","bound_global_parameter":null},{"name":"kernel_regularizer_l1","value":0,"type":"Literal","bound_global_parameter":null},{"name":"kernel_regularizer_l2","value":0,"type":"Literal","bound_global_parameter":null},{"name":"user_kernel_regularizer","value":"","type":"Literal","bound_global_parameter":null},{"name":"bias_regularizer","value":"None","type":"Literal","bound_global_parameter":null},{"name":"bias_regularizer_l1","value":0,"type":"Literal","bound_global_parameter":null},{"name":"bias_regularizer_l2","value":0,"type":"Literal","bound_global_parameter":null},{"name":"user_bias_regularizer","value":"","type":"Literal","bound_global_parameter":null},{"name":"activity_regularizer","value":"None","type":"Literal","bound_global_parameter":null},{"name":"activity_regularizer_l1","value":0,"type":"Literal","bound_global_parameter":null},{"name":"activity_regularizer_l2","value":0,"type":"Literal","bound_global_parameter":null},{"name":"user_activity_regularizer","value":"","type":"Literal","bound_global_parameter":null},{"name":"kernel_constraint","value":"None","type":"Literal","bound_global_parameter":null},{"name":"user_kernel_constraint","value":"","type":"Literal","bound_global_parameter":null},{"name":"bias_constraint","value":"None","type":"Literal","bound_global_parameter":null},{"name":"user_bias_constraint","value":"","type":"Literal","bound_global_parameter":null},{"name":"name","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"inputs","node_id":"-2680"}],"output_ports":[{"name":"data","node_id":"-2680"}],"cacheable":false,"seq_num":10,"comment":"","comment_collapsed":true},{"node_id":"-2712","module_id":"BigQuantSpace.dl_layer_maxpooling1d.dl_layer_maxpooling1d-v1","parameters":[{"name":"pool_size","value":"1","type":"Literal","bound_global_parameter":null},{"name":"strides","value":"","type":"Literal","bound_global_parameter":null},{"name":"padding","value":"valid","type":"Literal","bound_global_parameter":null},{"name":"name","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"inputs","node_id":"-2712"}],"output_ports":[{"name":"data","node_id":"-2712"}],"cacheable":false,"seq_num":12,"comment":"","comment_collapsed":true},{"node_id":"-3773","module_id":"BigQuantSpace.dl_layer_globalmaxpooling1d.dl_layer_globalmaxpooling1d-v1","parameters":[{"name":"name","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"inputs","node_id":"-3773"}],"output_ports":[{"name":"data","node_id":"-3773"}],"cacheable":false,"seq_num":28,"comment":"","comment_collapsed":true},{"node_id":"-3784","module_id":"BigQuantSpace.dl_layer_dense.dl_layer_dense-v1","parameters":[{"name":"units","value":"1","type":"Literal","bound_global_parameter":null},{"name":"activation","value":"linear","type":"Literal","bound_global_parameter":null},{"name":"user_activation","value":"","type":"Literal","bound_global_parameter":null},{"name":"use_bias","value":"True","type":"Literal","bound_global_parameter":null},{"name":"kernel_initializer","value":"glorot_uniform","type":"Literal","bound_global_parameter":null},{"name":"user_kernel_initializer","value":"","type":"Literal","bound_global_parameter":null},{"name":"bias_initializer","value":"Zeros","type":"Literal","bound_global_parameter":null},{"name":"user_bias_initializer","value":"","type":"Literal","bound_global_parameter":null},{"name":"kernel_regularizer","value":"None","type":"Literal","bound_global_parameter":null},{"name":"kernel_regularizer_l1","value":0,"type":"Literal","bound_global_parameter":null},{"name":"kernel_regularizer_l2","value":0,"type":"Literal","bound_global_parameter":null},{"name":"user_kernel_regularizer","value":"","type":"Literal","bound_global_parameter":null},{"name":"bias_regularizer","value":"None","type":"Literal","bound_global_parameter":null},{"name":"bias_regularizer_l1","value":0,"type":"Literal","bound_global_parameter":null},{"name":"bias_regularizer_l2","value":0,"type":"Literal","bound_global_parameter":null},{"name":"user_bias_regularizer","value":"","type":"Literal","bound_global_parameter":null},{"name":"activity_regularizer","value":"None","type":"Literal","bound_global_parameter":null},{"name":"activity_regularizer_l1","value":0,"type":"Literal","bound_global_parameter":null},{"name":"activity_regularizer_l2","value":0,"type":"Literal","bound_global_parameter":null},{"name":"user_activity_regularizer","value":"","type":"Literal","bound_global_parameter":null},{"name":"kernel_constraint","value":"None","type":"Literal","bound_global_parameter":null},{"name":"user_kernel_constraint","value":"","type":"Literal","bound_global_parameter":null},{"name":"bias_constraint","value":"None","type":"Literal","bound_global_parameter":null},{"name":"user_bias_constraint","value":"","type":"Literal","bound_global_parameter":null},{"name":"name","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"inputs","node_id":"-3784"}],"output_ports":[{"name":"data","node_id":"-3784"}],"cacheable":false,"seq_num":30,"comment":"","comment_collapsed":true},{"node_id":"-3840","module_id":"BigQuantSpace.dl_layer_conv1d.dl_layer_conv1d-v1","parameters":[{"name":"filters","value":"20","type":"Literal","bound_global_parameter":null},{"name":"kernel_size","value":"3","type":"Literal","bound_global_parameter":null},{"name":"strides","value":"1","type":"Literal","bound_global_parameter":null},{"name":"padding","value":"valid","type":"Literal","bound_global_parameter":null},{"name":"dilation_rate","value":1,"type":"Literal","bound_global_parameter":null},{"name":"activation","value":"relu","type":"Literal","bound_global_parameter":null},{"name":"user_activation","value":"","type":"Literal","bound_global_parameter":null},{"name":"use_bias","value":"True","type":"Literal","bound_global_parameter":null},{"name":"kernel_initializer","value":"glorot_uniform","type":"Literal","bound_global_parameter":null},{"name":"user_kernel_initializer","value":"","type":"Literal","bound_global_parameter":null},{"name":"bias_initializer","value":"Zeros","type":"Literal","bound_global_parameter":null},{"name":"user_bias_initializer","value":"","type":"Literal","bound_global_parameter":null},{"name":"kernel_regularizer","value":"None","type":"Literal","bound_global_parameter":null},{"name":"kernel_regularizer_l1","value":0,"type":"Literal","bound_global_parameter":null},{"name":"kernel_regularizer_l2","value":0,"type":"Literal","bound_global_parameter":null},{"name":"user_kernel_regularizer","value":"","type":"Literal","bound_global_parameter":null},{"name":"bias_regularizer","value":"None","type":"Literal","bound_global_parameter":null},{"name":"bias_regularizer_l1","value":0,"type":"Literal","bound_global_parameter":null},{"name":"bias_regularizer_l2","value":0,"type":"Literal","bound_global_parameter":null},{"name":"user_bias_regularizer","value":"","type":"Literal","bound_global_parameter":null},{"name":"activity_regularizer","value":"None","type":"Literal","bound_global_parameter":null},{"name":"activity_regularizer_l1","value":0,"type":"Literal","bound_global_parameter":null},{"name":"activity_regularizer_l2","value":0,"type":"Literal","bound_global_parameter":null},{"name":"user_activity_regularizer","value":"","type":"Literal","bound_global_parameter":null},{"name":"kernel_constraint","value":"None","type":"Literal","bound_global_parameter":null},{"name":"user_kernel_constraint","value":"","type":"Literal","bound_global_parameter":null},{"name":"bias_constraint","value":"None","type":"Literal","bound_global_parameter":null},{"name":"user_bias_constraint","value":"","type":"Literal","bound_global_parameter":null},{"name":"name","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"inputs","node_id":"-3840"}],"output_ports":[{"name":"data","node_id":"-3840"}],"cacheable":false,"seq_num":32,"comment":"","comment_collapsed":true},{"node_id":"-3872","module_id":"BigQuantSpace.dl_layer_maxpooling1d.dl_layer_maxpooling1d-v1","parameters":[{"name":"pool_size","value":"1","type":"Literal","bound_global_parameter":null},{"name":"strides","value":"","type":"Literal","bound_global_parameter":null},{"name":"padding","value":"valid","type":"Literal","bound_global_parameter":null},{"name":"name","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"inputs","node_id":"-3872"}],"output_ports":[{"name":"data","node_id":"-3872"}],"cacheable":false,"seq_num":33,"comment":"","comment_collapsed":true},{"node_id":"-3880","module_id":"BigQuantSpace.dl_model_init.dl_model_init-v1","parameters":[],"input_ports":[{"name":"inputs","node_id":"-3880"},{"name":"outputs","node_id":"-3880"}],"output_ports":[{"name":"data","node_id":"-3880"}],"cacheable":false,"seq_num":34,"comment":"","comment_collapsed":true},{"node_id":"-3895","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 df = input_1.read_pickle()\n feature_len = len(input_2.read_pickle())\n \n \n df['x'] = df['x'].reshape(df['x'].shape[0], int(feature_len), int(df['x'].shape[1]/feature_len))\n \n data_1 = DataSource.write_pickle(df)\n return Outputs(data_1=data_1)\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":"-3895"},{"name":"input_2","node_id":"-3895"},{"name":"input_3","node_id":"-3895"}],"output_ports":[{"name":"data_1","node_id":"-3895"},{"name":"data_2","node_id":"-3895"},{"name":"data_3","node_id":"-3895"}],"cacheable":true,"seq_num":4,"comment":"","comment_collapsed":true},{"node_id":"-3907","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_pickle()\n feature_len = len(input_2.read_pickle())\n \n \n df['x'] = df['x'].reshape(df['x'].shape[0], int(feature_len), int(df['x'].shape[1]/feature_len))\n \n data_1 = DataSource.write_pickle(df)\n return Outputs(data_1=data_1)\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":"-3907"},{"name":"input_2","node_id":"-3907"},{"name":"input_3","node_id":"-3907"}],"output_ports":[{"name":"data_1","node_id":"-3907"},{"name":"data_2","node_id":"-3907"},{"name":"data_3","node_id":"-3907"}],"cacheable":true,"seq_num":8,"comment":"","comment_collapsed":true},{"node_id":"-137","module_id":"BigQuantSpace.filter.filter-v3","parameters":[{"name":"expr","value":"st_status_0==0 and low_0>high_1 and close_0>open_0","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":"-137"}],"output_ports":[{"name":"data","node_id":"-137"},{"name":"left_data","node_id":"-137"}],"cacheable":true,"seq_num":19,"comment":"","comment_collapsed":true},{"node_id":"-2346","module_id":"BigQuantSpace.filter.filter-v3","parameters":[{"name":"expr","value":"st_status_0==0 and low_0>high_1+0.02 and close_0>open_0","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":"-2346"}],"output_ports":[{"name":"data","node_id":"-2346"},{"name":"left_data","node_id":"-2346"}],"cacheable":true,"seq_num":21,"comment":"","comment_collapsed":true},{"node_id":"-132","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"# #号开始的表示注释\n# 多个特征,每行一个,可以包含基础特征和衍生特征\nclose_0\nhigh_1\nopen_0\nlow_0\nst_status_0","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-132"}],"output_ports":[{"name":"data","node_id":"-132"}],"cacheable":true,"seq_num":22,"comment":"","comment_collapsed":true},{"node_id":"-170","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"# #号开始的表示注释\n# 多个特征,每行一个,可以包含基础特征和衍生特征\nret_1=close/shift(close,1)\nret_3=close/shift(close,3)\nvolumepct_1=volume/shift(volume,1)\nbm_ret0=ret_1\nbm_ret1=shift(bm_ret0,1)\nbm_ret2=shift(bm_ret0,2)\nbm_ret3=ret_3\nbm_risk_v0=volumepct_1\nbm_risk_v1=shift(bm_risk_v0,1)\nbm_risk_v2=shift(bm_risk_v0,2)","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-170"}],"output_ports":[{"name":"data","node_id":"-170"}],"cacheable":true,"seq_num":20,"comment":"","comment_collapsed":true},{"node_id":"-172","module_id":"BigQuantSpace.index_feature_extract.index_feature_extract-v3","parameters":[{"name":"before_days","value":100,"type":"Literal","bound_global_parameter":null},{"name":"index","value":"000001.HIX","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_1","node_id":"-172"},{"name":"input_2","node_id":"-172"}],"output_ports":[{"name":"data_1","node_id":"-172"},{"name":"data_2","node_id":"-172"}],"cacheable":true,"seq_num":23,"comment":"","comment_collapsed":true},{"node_id":"-209","module_id":"BigQuantSpace.join.join-v3","parameters":[{"name":"on","value":"date","type":"Literal","bound_global_parameter":null},{"name":"how","value":"left","type":"Literal","bound_global_parameter":null},{"name":"sort","value":"False","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"data1","node_id":"-209"},{"name":"data2","node_id":"-209"}],"output_ports":[{"name":"data","node_id":"-209"}],"cacheable":true,"seq_num":29,"comment":"","comment_collapsed":true},{"node_id":"-18601","module_id":"BigQuantSpace.trade.trade-v4","parameters":[{"name":"start_date","value":"","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"","type":"Literal","bound_global_parameter":null},{"name":"initialize","value":"# 回测引擎:初始化函数,只执行一次\ndef bigquant_run(context):\n # 加载预测数据\n context.ranker_prediction = context.options['data'].read_df()\n\n # 系统已经设置了默认的交易手续费和滑点,要修改手续费可使用如下函数\n context.set_commission(PerOrder(buy_cost=0.0003, sell_cost=0.0013, min_cost=5))\n # 预测数据,通过options传入进来,使用 read_df 函数,加载到内存 (DataFrame)\n # 设置买入的股票数量,这里买入预测股票列表排名靠前的5只\n stock_count = 5\n # 每只的股票的权重,如下的权重分配会使得靠前的股票分配多一点的资金,[0.339160, 0.213986, 0.169580, ..]\n context.stock_weights = T.norm([1 / math.log(i + 2) for i in range(0, stock_count)])\n # 设置每只股票占用的最大资金比例\n context.max_cash_per_instrument = 0.2\n context.hold_days = 5","type":"Literal","bound_global_parameter":null},{"name":"handle_data","value":"# 回测引擎:每日数据处理函数,每天执行一次\ndef bigquant_run(context, data):\n # 按日期过滤得到今日的预测数据\n ranker_prediction = context.ranker_prediction[\n context.ranker_prediction.date == data.current_dt.strftime('%Y-%m-%d')]\n\n # 1. 资金分配\n # 平均持仓时间是hold_days,每日都将买入股票,每日预期使用 1/hold_days 的资金\n # 实际操作中,会存在一定的买入误差,所以在前hold_days天,等量使用资金;之后,尽量使用剩余资金(这里设置最多用等量的1.5倍)\n is_staging = context.trading_day_index < context.hold_days # 是否在建仓期间(前 hold_days 天)\n cash_avg = context.portfolio.portfolio_value / context.hold_days\n cash_for_buy = min(context.portfolio.cash, (1 if is_staging else 1.5) * cash_avg)\n cash_for_sell = cash_avg - (context.portfolio.cash - cash_for_buy)\n # 通过positions对象,使用列表生成式的方法获取目前持仓的股票列表\n stock_hold_now = {e.symbol: p.amount * p.last_sale_price\n for e, p in context.portfolio.positions.items()}\n # 所拥有的仓位情况\n positions = {e.symbol: p for e, p in context.portfolio.positions.items() if p.amount>0}\n \n \n #大盘风控模块,读取风控数据 \n #----------------大盘风控模块,读取风控数据------------------\n # risk表示是否遇到了下跌的情况,等于0否,等于1是\n risk = 0\n today = data.current_dt.strftime('%Y-%m-%d')\n # 利用上证指数的涨跌来看大盘的涨跌\n bm_ret0=ranker_prediction.bm_ret0.values[0]\n bm_ret1=ranker_prediction.bm_ret1.values[0]\n bm_ret2=ranker_prediction.bm_ret2.values[0]\n bm_ret3=ranker_prediction.bm_ret3.values[0]\n bm_risk_v0=ranker_prediction.bm_risk_v0.values[0]\n bm_risk_v1=ranker_prediction.bm_risk_v1.values[0]\n bm_risk_v2=ranker_prediction.bm_risk_v2.values[0]\n if bm_ret0 < 0.001:\n if bm_risk_v0 > 0:\n print(today,'大盘放量下跌,全仓卖出')\n risk = 1\n elif bm_ret1 < 0.001 and bm_ret2 < 0.002:\n print(today,'大盘连续下跌,全仓卖出')\n risk = 1\n if bm_ret3 < -0.02:\n print(today,'大盘三日下跌超过2%,全仓卖出')\n risk = 1\n if bm_ret0 > 0.01:\n if (bm_risk_v0 + bm_risk_v1) < 0:\n print(today,'大盘缩量上涨,全仓卖出')\n risk = 1\n\n # 此时需要卖出手上所有的股票\n if risk == 1:\n # 手上还有仓位\n if len(positions)>0:\n # 全部卖出后返回\n for instrument in positions:\n last_sale_date = positions[instrument].last_sale_date #上次交易日期\n delta_days = data.current_dt - last_sale_date \n hold_days = delta_days.days #持仓天数\n if data.can_trade(context.symbol(instrument)) and hold_days > 0:\n context.order_target_percent(context.symbol(instrument), 0)\n return \n # 风控卖出后直接使用return结束当日交易,后续轮仓逻辑不再执行\n #---------------------大盘风控结束--------------------------------------\n\n\n # 2. 生成卖出订单:hold_days天之后才开始卖出;对持仓的股票,按StockRanker预测的排序末位淘汰\n if not is_staging and cash_for_sell > 0:\n if len(positions) > 0:\n for instrument in positions.keys():\n last_sale_date = positions[instrument].last_sale_date #上次交易日期\n delta_days = data.current_dt - last_sale_date \n hold_days = delta_days.days #持仓天数\n # 股票实行t+1制度,必须使持仓天数大于0\n if hold_days > 0:\n equities = {e.symbol: e for e, p in context.portfolio.positions.items()}\n instruments = list(reversed(list(ranker_prediction.instrument[ranker_prediction.instrument.apply(\n lambda x: x in equities and not context.has_unfinished_sell_order(equities[x]))])))\n # print('rank order for sell %s' % instruments)\n for instrument1 in instruments:\n context.order_target(context.symbol(instrument1), 0)\n cash_for_sell -= stock_hold_now[instrument1]\n if cash_for_sell <= 0:\n break \n\n # 3. 生成买入订单:按StockRanker预测的排序,买入前面的stock_count只股票\n buy_cash_weights = context.stock_weights\n buy_instruments = list(ranker_prediction.instrument[:len(buy_cash_weights)])\n max_cash_per_instrument = context.portfolio.portfolio_value * context.max_cash_per_instrument\n \n for i, instrument in enumerate(buy_instruments):\n cash = cash_for_buy * buy_cash_weights[i]\n if cash > max_cash_per_instrument - stock_hold_now.get(instrument, 0):\n # 确保股票持仓量不会超过每次股票最大的占用资金量\n cash = max_cash_per_instrument - stock_hold_now.get(instrument, 0)\n if cash > 0:\n # 获取今天和过去两天的成交量\n volume_since_buy = data.history(context.symbol(instrument), 'volume', 3, '1d')\n close_price = data.current(context.symbol(instrument), 'close') #当收盘价\n high_price = data.current(context.symbol(instrument), 'high') #当天最高价\n # 冲高回落的股票不能买\n if ((volume_since_buy[2]/volume_since_buy[1] < 2.5) or (high_price/close_price<1.05)) and volume_since_buy[2]/volume_since_buy[0] > 1:\n current_price = data.current(context.symbol(instrument), 'price')\n amount = math.floor(cash / current_price - cash / current_price % 100)\n context.order(context.symbol(instrument), amount)\n return","type":"Literal","bound_global_parameter":null},{"name":"prepare","value":"# 回测引擎:准备数据,只执行一次\ndef bigquant_run(context):\n pass\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":1000000,"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},{"name":"benchmark","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-18601"},{"name":"options_data","node_id":"-18601"},{"name":"history_ds","node_id":"-18601"},{"name":"benchmark_ds","node_id":"-18601"},{"name":"trading_calendar","node_id":"-18601"}],"output_ports":[{"name":"raw_perf","node_id":"-18601"}],"cacheable":false,"seq_num":31,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-8' Position='393,18,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-15' Position='219,164,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-24' Position='726,-97.01791763305664,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-53' Position='358,397,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-62' Position='1057,74,200,200'/><node_position Node='-106' Position='545,122,200,200'/><node_position Node='-113' Position='545,212,200,200'/><node_position Node='-122' Position='1062,180,200,200'/><node_position Node='-129' Position='1059,260,200,200'/><node_position Node='-160' Position='-90.01791381835938,-127,200,200'/><node_position Node='-1098' Position='121,705,200,200'/><node_position Node='-1540' Position='214,774,200,200'/><node_position Node='-2431' Position='416,873,200,200'/><node_position Node='-768' Position='552,285,200,200'/><node_position Node='-773' Position='222,278,200,200'/><node_position Node='-778' Position='1063,352,200,200'/><node_position Node='-243' Position='347,538,200,200'/><node_position Node='-251' Position='1067,517,200,200'/><node_position Node='-2680' Position='-84,-53,200,200'/><node_position Node='-2712' Position='-88,35,200,200'/><node_position Node='-3773' Position='-85,330,200,200'/><node_position Node='-3784' Position='-88,437,200,200'/><node_position Node='-3840' Position='-87,122,200,200'/><node_position Node='-3872' Position='-88,214,200,200'/><node_position Node='-3880' Position='-85,535,200,200'/><node_position Node='-3895' Position='344,615,200,200'/><node_position Node='-3907' Position='1066,585,200,200'/><node_position Node='-137' Position='349,467,200,200'/><node_position Node='-2346' Position='1060,433,200,200'/><node_position Node='-132' Position='689,13,200,200'/><node_position Node='-170' Position='699,501,200,200'/><node_position Node='-172' Position='715,589,200,200'/><node_position Node='-209' Position='520,957,200,200'/><node_position Node='-18601' Position='466,1046,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
[2021-11-25 13:51:35.252705] INFO: moduleinvoker: instruments.v2 开始运行..
[2021-11-25 13:51:35.264717] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:35.266987] INFO: moduleinvoker: instruments.v2 运行完成[0.014294s].
[2021-11-25 13:51:35.276581] INFO: moduleinvoker: advanced_auto_labeler.v2 开始运行..
[2021-11-25 13:51:35.285048] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:35.287402] INFO: moduleinvoker: advanced_auto_labeler.v2 运行完成[0.01081s].
[2021-11-25 13:51:35.294261] INFO: moduleinvoker: standardlize.v8 开始运行..
[2021-11-25 13:51:35.308573] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:35.311108] INFO: moduleinvoker: standardlize.v8 运行完成[0.016843s].
[2021-11-25 13:51:35.318853] INFO: moduleinvoker: input_features.v1 开始运行..
[2021-11-25 13:51:35.335574] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:35.340757] INFO: moduleinvoker: input_features.v1 运行完成[0.021945s].
[2021-11-25 13:51:35.346310] INFO: moduleinvoker: input_features.v1 开始运行..
[2021-11-25 13:51:35.356631] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:35.358609] INFO: moduleinvoker: input_features.v1 运行完成[0.01232s].
[2021-11-25 13:51:35.372501] INFO: moduleinvoker: general_feature_extractor.v7 开始运行..
[2021-11-25 13:51:35.379762] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:35.382017] INFO: moduleinvoker: general_feature_extractor.v7 运行完成[0.00956s].
[2021-11-25 13:51:35.389659] INFO: moduleinvoker: derived_feature_extractor.v3 开始运行..
[2021-11-25 13:51:35.398366] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:35.400067] INFO: moduleinvoker: derived_feature_extractor.v3 运行完成[0.010406s].
[2021-11-25 13:51:35.405035] INFO: moduleinvoker: standardlize.v8 开始运行..
[2021-11-25 13:51:35.413372] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:35.415073] INFO: moduleinvoker: standardlize.v8 运行完成[0.010036s].
[2021-11-25 13:51:35.429932] INFO: moduleinvoker: join.v3 开始运行..
[2021-11-25 13:51:35.440794] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:35.442687] INFO: moduleinvoker: join.v3 运行完成[0.012792s].
[2021-11-25 13:51:35.452746] INFO: moduleinvoker: filter.v3 开始运行..
[2021-11-25 13:51:35.460851] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:35.462416] INFO: moduleinvoker: filter.v3 运行完成[0.009681s].
[2021-11-25 13:51:35.474331] INFO: moduleinvoker: dl_convert_to_bin.v2 开始运行..
[2021-11-25 13:51:35.487074] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:35.488717] INFO: moduleinvoker: dl_convert_to_bin.v2 运行完成[0.014395s].
[2021-11-25 13:51:35.502296] INFO: moduleinvoker: cached.v3 开始运行..
[2021-11-25 13:51:35.508612] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:35.510141] INFO: moduleinvoker: cached.v3 运行完成[0.007863s].
[2021-11-25 13:51:35.515907] INFO: moduleinvoker: instruments.v2 开始运行..
[2021-11-25 13:51:35.525155] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:35.529727] INFO: moduleinvoker: instruments.v2 运行完成[0.013802s].
[2021-11-25 13:51:35.547866] INFO: moduleinvoker: general_feature_extractor.v7 开始运行..
[2021-11-25 13:51:35.562033] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:35.564423] INFO: moduleinvoker: general_feature_extractor.v7 运行完成[0.01657s].
[2021-11-25 13:51:35.572280] INFO: moduleinvoker: derived_feature_extractor.v3 开始运行..
[2021-11-25 13:51:35.579153] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:35.581199] INFO: moduleinvoker: derived_feature_extractor.v3 运行完成[0.008914s].
[2021-11-25 13:51:35.586706] INFO: moduleinvoker: standardlize.v8 开始运行..
[2021-11-25 13:51:35.596904] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:35.599238] INFO: moduleinvoker: standardlize.v8 运行完成[0.012524s].
[2021-11-25 13:51:35.608649] INFO: moduleinvoker: filter.v3 开始运行..
[2021-11-25 13:51:35.615619] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:35.617828] INFO: moduleinvoker: filter.v3 运行完成[0.009176s].
[2021-11-25 13:51:35.640755] INFO: moduleinvoker: dl_convert_to_bin.v2 开始运行..
[2021-11-25 13:51:35.648930] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:35.650607] INFO: moduleinvoker: dl_convert_to_bin.v2 运行完成[0.00988s].
[2021-11-25 13:51:35.666063] INFO: moduleinvoker: cached.v3 开始运行..
[2021-11-25 13:51:35.675669] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:35.677413] INFO: moduleinvoker: cached.v3 运行完成[0.011387s].
[2021-11-25 13:51:35.684927] INFO: moduleinvoker: dl_layer_input.v1 运行完成[0.00186s].
[2021-11-25 13:51:35.707677] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.017035s].
[2021-11-25 13:51:35.725635] INFO: moduleinvoker: dl_layer_maxpooling1d.v1 运行完成[0.012211s].
[2021-11-25 13:51:35.773802] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.024549s].
[2021-11-25 13:51:35.792272] INFO: moduleinvoker: dl_layer_maxpooling1d.v1 运行完成[0.011066s].
[2021-11-25 13:51:35.806318] INFO: moduleinvoker: dl_layer_globalmaxpooling1d.v1 运行完成[0.006597s].
[2021-11-25 13:51:35.833123] INFO: moduleinvoker: dl_layer_dense.v1 运行完成[0.020113s].
[2021-11-25 13:51:35.871186] INFO: moduleinvoker: cached.v3 开始运行..
[2021-11-25 13:51:35.918034] INFO: moduleinvoker: cached.v3 运行完成[0.046822s].
[2021-11-25 13:51:35.924165] INFO: moduleinvoker: dl_model_init.v1 运行完成[0.082039s].
[2021-11-25 13:51:35.929896] INFO: moduleinvoker: dl_model_train.v1 开始运行..
[2021-11-25 13:51:36.113885] INFO: dl_model_train: 准备训练,训练样本个数:45005,迭代次数:20
[2021-11-25 13:51:56.072308] INFO: dl_model_train: 训练结束,耗时:19.96s
[2021-11-25 13:51:56.112453] INFO: moduleinvoker: dl_model_train.v1 运行完成[20.182548s].
[2021-11-25 13:51:56.121513] INFO: moduleinvoker: dl_model_predict.v1 开始运行..
[2021-11-25 13:51:56.610137] INFO: moduleinvoker: dl_model_predict.v1 运行完成[0.488679s].
[2021-11-25 13:51:56.634047] INFO: moduleinvoker: cached.v3 开始运行..
[2021-11-25 13:51:56.838372] INFO: moduleinvoker: cached.v3 运行完成[0.204433s].
[2021-11-25 13:51:56.845532] INFO: moduleinvoker: input_features.v1 开始运行..
[2021-11-25 13:51:56.857977] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:56.859971] INFO: moduleinvoker: input_features.v1 运行完成[0.014463s].
[2021-11-25 13:51:56.874141] INFO: moduleinvoker: index_feature_extract.v3 开始运行..
[2021-11-25 13:51:56.887175] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:56.888845] INFO: moduleinvoker: index_feature_extract.v3 运行完成[0.014721s].
[2021-11-25 13:51:56.899198] INFO: moduleinvoker: join.v3 开始运行..
[2021-11-25 13:51:57.086558] INFO: join: /data, 行数=12931/12931, 耗时=0.083451s
[2021-11-25 13:51:57.113187] INFO: join: 最终行数: 12931
[2021-11-25 13:51:57.120916] INFO: moduleinvoker: join.v3 运行完成[0.221675s].
[2021-11-25 13:51:57.192739] INFO: moduleinvoker: backtest.v8 开始运行..
[2021-11-25 13:51:57.204170] INFO: backtest: biglearning backtest:V8.6.0
[2021-11-25 13:51:57.205986] INFO: backtest: product_type:stock by specified
[2021-11-25 13:51:57.312188] INFO: moduleinvoker: cached.v2 开始运行..
[2021-11-25 13:51:57.322746] INFO: moduleinvoker: 命中缓存
[2021-11-25 13:51:57.329813] INFO: moduleinvoker: cached.v2 运行完成[0.017636s].
[2021-11-25 13:52:00.577407] INFO: algo: TradingAlgorithm V1.8.5
[2021-11-25 13:52:01.590626] INFO: algo: trading transform...
[2021-11-25 13:52:06.373674] ERROR: moduleinvoker: module name: backtest, module version: v8, trackeback: IndexError: index 0 is out of bounds for axis 0 with size 0
[2021-11-25 13:52:06.380198] ERROR: moduleinvoker: module name: trade, module version: v4, trackeback: IndexError: index 0 is out of bounds for axis 0 with size 0
Epoch 1/20
176/176 - 2s - loss: 1.7236 - mae: 0.9365
Epoch 2/20
176/176 - 1s - loss: 1.6863 - mae: 0.9245
Epoch 3/20
176/176 - 1s - loss: 1.6820 - mae: 0.9231
Epoch 4/20
176/176 - 1s - loss: 1.6774 - mae: 0.9220
Epoch 5/20
176/176 - 1s - loss: 1.6754 - mae: 0.9210
Epoch 6/20
176/176 - 1s - loss: 1.6751 - mae: 0.9205
Epoch 7/20
176/176 - 1s - loss: 1.6737 - mae: 0.9199
Epoch 8/20
176/176 - 1s - loss: 1.6722 - mae: 0.9195
Epoch 9/20
176/176 - 1s - loss: 1.6719 - mae: 0.9196
Epoch 10/20
176/176 - 1s - loss: 1.6718 - mae: 0.9196
Epoch 11/20
176/176 - 1s - loss: 1.6678 - mae: 0.9183
Epoch 12/20
176/176 - 1s - loss: 1.6692 - mae: 0.9184
Epoch 13/20
176/176 - 1s - loss: 1.6688 - mae: 0.9187
Epoch 14/20
176/176 - 1s - loss: 1.6675 - mae: 0.9182
Epoch 15/20
176/176 - 1s - loss: 1.6661 - mae: 0.9179
Epoch 16/20
176/176 - 1s - loss: 1.6659 - mae: 0.9175
Epoch 17/20
176/176 - 1s - loss: 1.6666 - mae: 0.9177
Epoch 18/20
176/176 - 1s - loss: 1.6657 - mae: 0.9179
Epoch 19/20
176/176 - 1s - loss: 1.6651 - mae: 0.9175
Epoch 20/20
176/176 - 1s - loss: 1.6653 - mae: 0.9177
13/13 - 0s
DataSource(c6e074ad2b79430a80fb2af8a44f2788T)
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-2-5d70a1b40603> in <module>
527 )
528
--> 529 m31 = M.trade.v4(
530 instruments=m9.data,
531 options_data=m29.data,
<ipython-input-2-5d70a1b40603> in m31_handle_data_bigquant_run(context, data)
96 today = data.current_dt.strftime('%Y-%m-%d')
97 # 利用上证指数的涨跌来看大盘的涨跌
---> 98 bm_ret0=ranker_prediction.bm_ret0.values[0]
99 bm_ret1=ranker_prediction.bm_ret1.values[0]
100 bm_ret2=ranker_prediction.bm_ret2.values[0]
IndexError: index 0 is out of bounds for axis 0 with size 0