{"Description":"实验创建于2020/7/30","Summary":"","Graph":{"EdgesInternal":[{"DestinationInputPortId":"-24:features","SourceOutputPortId":"-11:data"},{"DestinationInputPortId":"-5:instruments","SourceOutputPortId":"-15:data"},{"DestinationInputPortId":"-24:input_data","SourceOutputPortId":"-36:data_1"},{"DestinationInputPortId":"-36:input_1","SourceOutputPortId":"-5:data"}],"ModuleNodes":[{"Id":"-11","ModuleId":"BigQuantSpace.input_features.input_features-v1","ModuleParameters":[{"Name":"features","Value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nta_bbands_l(close, 2)","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features_ds","NodeId":"-11"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-11","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":2,"Comment":"","CommentCollapsed":true},{"Id":"-15","ModuleId":"BigQuantSpace.instruments.instruments-v2","ModuleParameters":[{"Name":"start_date","Value":"2018-01-01","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"end_date","Value":"2019-01-01","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"market","Value":"CN_STOCK_A","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"instrument_list","Value":"000001.SZA","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"max_count","Value":0,"ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"rolling_conf","NodeId":"-15"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-15","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":3,"Comment":"","CommentCollapsed":true},{"Id":"-24","ModuleId":"BigQuantSpace.derived_feature_extractor.derived_feature_extractor-v3","ModuleParameters":[{"Name":"date_col","Value":"date","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"instrument_col","Value":"instrument","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"drop_na","Value":"True","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"remove_extra_columns","Value":"True","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"user_functions","Value":"{}","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_data","NodeId":"-24"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features","NodeId":"-24"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-24","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":4,"Comment":"","CommentCollapsed":true},{"Id":"-36","ModuleId":"BigQuantSpace.cached.cached-v3","ModuleParameters":[{"Name":"run","Value":"# Python 代码入口函数,input_1/2/3 对应三个输入端,data_1/2/3 对应三个输出端\ndef bigquant_run(input_1, input_2, input_3):\n \n # 先获取股票的日线数据\n daily_data = input_1.read()[[\"close\", \"open\", \"high\", \"low\", \"date\", \"instrument\"]]\n# daily_data = DataSource(\"bar1d_CN_STOCK_A\").read(\"000001.SZA\", start_date=\"2018-01-01\", end_date=\"2019-01-01\", fields=[\"close\", \"open\", \"high\", \"low\", \"date\", \"instrument\"])\n\n # 获取交易日周索引\n index_ = daily_data.resample(\"W\", how=\"first\", on=\"date\").set_index(\"date\").index\n\n # 进行resample,注意高开低收的各个resample规则不同,需要分开处理\n daily_data.set_index(\"date\", inplace=True)\n daily_data_close = daily_data.resample(\"W\", label=\"left\", how=\"last\")[\"close\"]\n daily_data_open = daily_data.resample(\"W\", label=\"left\", how=\"first\")[\"open\"]\n daily_data_high = daily_data.resample(\"W\", label=\"left\", how=\"max\")[\"high\"]\n daily_data_low = daily_data.resample(\"W\", label=\"left\", how=\"min\")['low']\n daily_data_instrument = daily_data.resample(\"W\", label=\"left\", how=\"first\")['instrument']\n\n week_data = pd.DataFrame({\"instrument\": daily_data_instrument.values, \"close\": daily_data_close.values, \"open\": daily_data_open.values, \"high\": daily_data_high.values, \"low\":daily_data_low.values, \"date\": index_}, index=index_)\n\n # 删除nan\n week_data.dropna(how=\"any\", inplace=True, axis=0)\n\n data_1 = DataSource.write_df(week_data)\n return Outputs(data_1=data_1)\n ","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"post_run","Value":"# 后处理函数,可选。输入是主函数的输出,可以在这里对数据做处理,或者返回更友好的outputs数据格式。此函数输出不会被缓存。\ndef bigquant_run(outputs):\n return outputs\n","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"input_ports","Value":"","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"params","Value":"{}","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"output_ports","Value":"","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_1","NodeId":"-36"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_2","NodeId":"-36"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_3","NodeId":"-36"}],"OutputPortsInternal":[{"Name":"data_1","NodeId":"-36","OutputType":null},{"Name":"data_2","NodeId":"-36","OutputType":null},{"Name":"data_3","NodeId":"-36","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":5,"Comment":"","CommentCollapsed":true},{"Id":"-5","ModuleId":"BigQuantSpace.use_datasource.use_datasource-v1","ModuleParameters":[{"Name":"datasource_id","Value":"bar1d_CN_STOCK_A","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"start_date","Value":"2018-01-01","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"end_date","Value":"2019-01-01","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"instruments","NodeId":"-5"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features","NodeId":"-5"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-5","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":1,"Comment":"","CommentCollapsed":true}],"SerializedClientData":"<?xml version='1.0' encoding='utf-16'?><DataV1 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><Meta /><NodePositions><NodePosition Node='-11' Position='989.6666259765625,290,200,200'/><NodePosition Node='-15' Position='571.6666259765625,297,200,200'/><NodePosition Node='-24' Position='781.6666259765625,679,200,200'/><NodePosition Node='-36' Position='774.6666259765625,548,200,200'/><NodePosition Node='-5' Position='784.6666259765625,425,200,200'/></NodePositions><NodeGroups /></DataV1>"},"IsDraft":true,"ParentExperimentId":null,"WebService":{"IsWebServiceExperiment":false,"Inputs":[],"Outputs":[],"Parameters":[{"Name":"交易日期","Value":"","ParameterDefinition":{"Name":"交易日期","FriendlyName":"交易日期","DefaultValue":"","ParameterType":"String","HasDefaultValue":true,"IsOptional":true,"ParameterRules":[],"HasRules":false,"MarkupType":0,"CredentialDescriptor":null}}],"WebServiceGroupId":null,"SerializedClientData":"<?xml version='1.0' encoding='utf-16'?><DataV1 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><Meta /><NodePositions></NodePositions><NodeGroups /></DataV1>"},"DisableNodesUpdate":false,"Category":"user","Tags":[],"IsPartialRun":true}
[2020-07-30 10:55:00.816048] INFO: moduleinvoker: input_features.v1 开始运行..
[2020-07-30 10:55:00.822040] INFO: moduleinvoker: 命中缓存
[2020-07-30 10:55:00.823127] INFO: moduleinvoker: input_features.v1 运行完成[0.007082s].
[2020-07-30 10:55:00.824914] INFO: moduleinvoker: instruments.v2 开始运行..
[2020-07-30 10:55:00.829348] INFO: moduleinvoker: 命中缓存
[2020-07-30 10:55:00.830286] INFO: moduleinvoker: instruments.v2 运行完成[0.005368s].
[2020-07-30 10:55:00.831735] INFO: moduleinvoker: use_datasource.v1 开始运行..
[2020-07-30 10:55:00.835946] INFO: moduleinvoker: 命中缓存
[2020-07-30 10:55:00.836759] INFO: moduleinvoker: use_datasource.v1 运行完成[0.005022s].
[2020-07-30 10:55:00.840071] INFO: moduleinvoker: cached.v3 开始运行..
[2020-07-30 10:55:00.844044] INFO: moduleinvoker: 命中缓存
[2020-07-30 10:55:00.844959] INFO: moduleinvoker: cached.v3 运行完成[0.00488s].
[2020-07-30 10:55:00.846725] INFO: moduleinvoker: derived_feature_extractor.v3 开始运行..
[2020-07-30 10:55:00.876790] INFO: derived_feature_extractor: 提取完成 ta_bbands_l(close, 2), 0.005s
[2020-07-30 10:55:00.900867] INFO: derived_feature_extractor: /data, 51
[2020-07-30 10:55:01.061712] INFO: moduleinvoker: derived_feature_extractor.v3 运行完成[0.214953s].