{"description":"实验创建于2017/8/26","graph":{"edges":[{"to_node_id":"-322:features","from_node_id":"-331:data"},{"to_node_id":"-322:instruments","from_node_id":"-312:data"},{"to_node_id":"-1136:input_data","from_node_id":"-322:data"},{"to_node_id":"-932:input_functions","from_node_id":"-1111:functions"},{"to_node_id":"-1136:features","from_node_id":"-2149:data"},{"to_node_id":"-1111:input_functions","from_node_id":"-2016:functions"},{"to_node_id":"-322:user_functions","from_node_id":"-932:functions"},{"to_node_id":"-2016:input_functions","from_node_id":"-584:functions"}],"nodes":[{"node_id":"-331","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"_c = close\n_o = open\n_v = volume\n_amt = amount\n_num = num_trades\n_ret = ret_sim(_c, _o)\n\n# 高频偏度\n_RVar = RVar(_ret)\nRSkew = RSkew(_ret, _RVar)\n\n# 下行波动占比\n_down_vol = np.sqrt(np.power(_ret*where(_ret<0, 1, 0), 2).sum())\ndown_vol_ratio = where(_RVar==0, 1, _down_vol / (_RVar))\n\n# 改进反转因子\ninverse_plus = _c.iloc[-1] / _c.loc[100000] - 1\n\n# 尾盘成交量占比\nend_volume_ratio = _v.loc[143000:150000].sum() / _v.sum()\n\n# 量价相关性\n_Volume = _v / (_v.sum())\n_Price = _c\n_corr = _Volume.corr(_Price, method='pearson')\ncorr_PV = where(np.isnan(_corr), 0, _corr)\n\n# 单笔流出金额占比\n_n1 = (_num*where(_ret<0, 1, 0)).sum()\n_FlowOutRatio_1 = where(_n1==0, 1, (_amt*where(_ret<0, 1, 0)).sum() / _n1)\n_FOR_1 = where(np.isnan(_FlowOutRatio_1), 0, _FlowOutRatio_1)\n_FlowOutRatio_2 = _amt.sum() / _num.sum()\nFlowOutRatio_indiv = _FOR_1 / _FlowOutRatio_2\n\n# 大单推动涨幅\nbig_order_ret = np.prod(1 + _ret*where(_amt >= _amt.sort_values(ascending=False).iloc[np.int(240*0.3-1)], 1, 0))\n\n# 成交委托相关性\n# ask_diff_bid_volume = (bid_volume1.diff().fillna(0)).sub(ask_volume1.diff().fillna(0))\n\n# 收盘前成交委托相关性\n# ret_late = ret.loc[142600:145700]\n# ask_diff_bid_volume_late = (bid_volume1.loc[142600:145700].diff().fillna(0)).sub(ask_volume1.loc[142600:145700].diff().fillna(0))\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-331"}],"output_ports":[{"name":"data","node_id":"-331"}],"cacheable":true,"seq_num":1,"comment":"","comment_collapsed":true},{"node_id":"-312","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2014-03-03","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2021-12-31","type":"Literal","bound_global_parameter":null},{"name":"market","value":"CN_STOCK_A","type":"Literal","bound_global_parameter":null},{"name":"instrument_list","value":"000001.SZA\n000002.SZA\n000005.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":"-312"}],"output_ports":[{"name":"data","node_id":"-312"}],"cacheable":true,"seq_num":2,"comment":"","comment_collapsed":true},{"node_id":"-322","module_id":"BigQuantSpace.feature_extractor_1m.feature_extractor_1m-v1","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":"20","type":"Literal","bound_global_parameter":null},{"name":"workers","value":2,"type":"Literal","bound_global_parameter":null},{"name":"parallel_mode","value":"测试","type":"Literal","bound_global_parameter":null},{"name":"table_1m","value":"level2_bar1m_CN_STOCK_A","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-322"},{"name":"features","node_id":"-322"},{"name":"user_functions","node_id":"-322"}],"output_ports":[{"name":"data","node_id":"-322"}],"cacheable":true,"seq_num":3,"comment":"","comment_collapsed":true},{"node_id":"-1111","module_id":"BigQuantSpace.feature_extractor_user_function.feature_extractor_user_function-v1","parameters":[{"name":"name","value":"RSkew","type":"Literal","bound_global_parameter":null},{"name":"func","value":"def bigquant_run(df, ret, RVar):\n if RVar == 0:\n result = 0\n else:\n result = (np.power(ret, 3).sum()) * np.sqrt(240) / np.power(RVar, 1.5)\n return result\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_functions","node_id":"-1111"}],"output_ports":[{"name":"functions","node_id":"-1111"}],"cacheable":false,"seq_num":6,"comment":"","comment_collapsed":true},{"node_id":"-1136","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":"def nanmean(df, x_name, N):\n return df.groupby('instrument')[x_name.name].apply(lambda x: x.rolling(N,1).mean())\n\ndef nansum(df, x_name, N):\n return df.groupby('instrument')[x_name.name].apply(lambda x: x.rolling(N,1).sum())\n\ndef nanprod(df, x_name, N):\n return df.groupby('instrument')[x_name.name].apply(lambda x: x.rolling(N,1).apply(np.prod, raw=True))\n\nbigquant_run = {\n 'nanmean': nanmean,\n 'nansum': nansum,\n 'nanprod': nanprod\n}","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_data","node_id":"-1136"},{"name":"features","node_id":"-1136"}],"output_ports":[{"name":"data","node_id":"-1136"}],"cacheable":true,"seq_num":7,"comment":"","comment_collapsed":true},{"node_id":"-2149","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"RSkew = nanmean(RSkew, 20)\ndown_vol_ratio = nanmean(down_vol_ratio, 20)\ninverse_plus = nanmean(inverse_plus, 20)\nend_volume_ratio = nanmean(end_volume_ratio, 20)\ncorr_PV = nanmean(corr_PV, 20)\nFlowOutRatio_indiv = nanmean(FlowOutRatio_indiv, 20)\nbig_order_ret = nanprod(big_order_ret, 20) - 1","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-2149"}],"output_ports":[{"name":"data","node_id":"-2149"}],"cacheable":true,"seq_num":8,"comment":"","comment_collapsed":true},{"node_id":"-2016","module_id":"BigQuantSpace.feature_extractor_user_function.feature_extractor_user_function-v1","parameters":[{"name":"name","value":"RKurt","type":"Literal","bound_global_parameter":null},{"name":"func","value":"def bigquant_run(df, ret, RVar):\n if RVar == 0:\n result = 1\n else:\n result = (np.power(ret, 4).sum()) * (240) / np.power(RVar, 2)\n \n return result\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_functions","node_id":"-2016"}],"output_ports":[{"name":"functions","node_id":"-2016"}],"cacheable":false,"seq_num":4,"comment":"","comment_collapsed":true},{"node_id":"-932","module_id":"BigQuantSpace.feature_extractor_user_function.feature_extractor_user_function-v1","parameters":[{"name":"name","value":"RVar","type":"Literal","bound_global_parameter":null},{"name":"func","value":"def bigquant_run(df, ret):\n return np.power(ret, 2).sum()\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_functions","node_id":"-932"}],"output_ports":[{"name":"functions","node_id":"-932"}],"cacheable":false,"seq_num":5,"comment":"","comment_collapsed":true},{"node_id":"-584","module_id":"BigQuantSpace.feature_extractor_user_function.feature_extractor_user_function-v1","parameters":[{"name":"name","value":"ret_sim","type":"Literal","bound_global_parameter":null},{"name":"func","value":"def bigquant_run(df, close, op):\n res = close.pct_change()\n res.iloc[0] = close.iloc[0] / op.iloc[0] - 1\n return res\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_functions","node_id":"-584"}],"output_ports":[{"name":"functions","node_id":"-584"}],"cacheable":false,"seq_num":9,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-331' Position='-112,-236,200,200'/><node_position Node='-312' Position='-439.43504333496094,-239,200,200'/><node_position Node='-322' Position='-119,-19,200,200'/><node_position Node='-1111' Position='198,-296,200,200'/><node_position Node='-1136' Position='20,110,200,200'/><node_position Node='-2149' Position='245,-20,200,200'/><node_position Node='-2016' Position='197,-356,200,200'/><node_position Node='-932' Position='199,-235,200,200'/><node_position Node='-584' Position='201,-449,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
[2021-07-09 10:25:52.391561] INFO: moduleinvoker: input_features.v1 开始运行..
[2021-07-09 10:25:52.422010] INFO: moduleinvoker: input_features.v1 运行完成[0.030458s].
[2021-07-09 10:25:52.424552] INFO: moduleinvoker: instruments.v2 开始运行..
[2021-07-09 10:25:52.447168] INFO: moduleinvoker: instruments.v2 运行完成[0.022612s].
[2021-07-09 10:25:52.448613] INFO: moduleinvoker: input_features.v1 开始运行..
[2021-07-09 10:25:52.481427] INFO: moduleinvoker: input_features.v1 运行完成[0.032817s].
[2021-07-09 10:25:52.484123] INFO: moduleinvoker: feature_extractor_user_function.v1 运行完成[5.8e-05s].
[2021-07-09 10:25:52.486122] INFO: moduleinvoker: feature_extractor_user_function.v1 运行完成[7.3e-05s].
[2021-07-09 10:25:52.488269] INFO: moduleinvoker: feature_extractor_user_function.v1 运行完成[7.5e-05s].
[2021-07-09 10:25:52.490358] INFO: moduleinvoker: feature_extractor_user_function.v1 运行完成[7.3e-05s].
[2021-07-09 10:25:52.500319] INFO: moduleinvoker: feature_extractor_1m.v1 开始运行..
[2021-07-09 10:25:52.523199] INFO: 高频特征抽取-分钟到日频: 测试模式运行, ['000002.SZA', '000005.SZA', '000001.SZA']
[2021-07-09 10:25:52.523900] INFO: 高频特征抽取-分钟到日频: parallel_calculate features 3 instruments, 22 features 2 processes_count..
[2021-07-09 10:25:52.524791] INFO: 高频特征抽取-分钟到日频: 开始计算 ... processes_count=2
[2021-07-09 10:25:52.540818] INFO: 高频特征抽取-分钟到日频: 计算中: 0%| | 0/3 [00:00, ?it/s]
[2021-07-09 10:25:55.945369] INFO: 高频特征抽取-分钟到日频: 计算中: 33%|########## | 1/3 [00:03<00:06, 3.40s/it]
[2021-07-09 10:25:56.752709] INFO: 高频特征抽取-分钟到日频: 计算中: 67%|#################### | 2/3 [00:04<00:02, 2.62s/it]
[2021-07-09 10:25:58.110505] INFO: 高频特征抽取-分钟到日频: 计算中: 100%|##############################| 3/3 [00:05<00:00, 2.24s/it]
[2021-07-09 10:25:58.219156] INFO: 高频特征抽取-分钟到日频: extracted chunk 3/3 instruments, (729, 9).
[2021-07-09 10:25:58.220216] INFO: 高频特征抽取-分钟到日频: merge result .......
[2021-07-09 10:25:58.295126] INFO: 高频特征抽取-分钟到日频: extracted 3/3 instruments, (729, 9)
[2021-07-09 10:25:58.298826] INFO: moduleinvoker: feature_extractor_1m.v1 运行完成[5.798501s].
[2021-07-09 10:25:58.302826] INFO: moduleinvoker: derived_feature_extractor.v3 开始运行..
[2021-07-09 10:25:58.332372] INFO: derived_feature_extractor: 提取完成 RSkew = nanmean(RSkew, 20), 0.003s
[2021-07-09 10:25:58.336141] INFO: derived_feature_extractor: 提取完成 down_vol_ratio = nanmean(down_vol_ratio, 20), 0.003s
[2021-07-09 10:25:58.339670] INFO: derived_feature_extractor: 提取完成 inverse_plus = nanmean(inverse_plus, 20), 0.003s
[2021-07-09 10:25:58.343073] INFO: derived_feature_extractor: 提取完成 end_volume_ratio = nanmean(end_volume_ratio, 20), 0.003s
[2021-07-09 10:25:58.346538] INFO: derived_feature_extractor: 提取完成 corr_PV = nanmean(corr_PV, 20), 0.003s
[2021-07-09 10:25:58.349897] INFO: derived_feature_extractor: 提取完成 FlowOutRatio_indiv = nanmean(FlowOutRatio_indiv, 20), 0.003s
[2021-07-09 10:25:58.356823] INFO: derived_feature_extractor: 提取完成 big_order_ret = nanprod(big_order_ret, 20) - 1, 0.006s
[2021-07-09 10:25:58.383125] INFO: derived_feature_extractor: /data, 729
[2021-07-09 10:25:58.438789] INFO: moduleinvoker: derived_feature_extractor.v3 运行完成[0.135954s].