{"Description":"实验创建于2017/8/26","Summary":"","Graph":{"EdgesInternal":[{"DestinationInputPortId":"-346:instruments","SourceOutputPortId":"-338:data"}],"ModuleNodes":[{"Id":"-338","ModuleId":"BigQuantSpace.instruments.instruments-v2","ModuleParameters":[{"Name":"start_date","Value":"2010-01-01","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"end_date","Value":"2010-12-31","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"market","Value":"CN_STOCK_A","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"instrument_list","Value":"","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"max_count","Value":"0","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"rolling_conf","NodeId":"-338"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-338","OutputType":null}],"UsePreviousResults":false,"moduleIdForCode":5,"IsPartOfPartialRun":null,"Comment":"","CommentCollapsed":true},{"Id":"-346","ModuleId":"BigQuantSpace.advanced_auto_labeler.advanced_auto_labeler-v2","ModuleParameters":[{"Name":"label_expr","Value":"# #号开始的表示注释\n# 0. 每行一个,顺序执行,从第二个开始,可以使用label字段\n# 1. 可用数据字段见 https://bigquant.com/docs/develop/datasource/deprecated/history_data.html\n# 添加benchmark_前缀,可使用对应的benchmark数据\n# 2. 可用操作符和函数见 `表达式引擎 <https://bigquant.com/docs/develop/bigexpr/usage.html>`_\n\n# 未来5日最大相对收益率\n# shift(cal_max_ret(close, open,benchmark_close,benchmark_open, 5), -1)\n# 未来5日最大相对收益率所在天数\nshift(cal_max_ret_date(close, open,benchmark_close,benchmark_open, 5), -1) + 1","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"start_date","Value":"","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"end_date","Value":"","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"benchmark","Value":"000300.SHA","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"drop_na_label","Value":"False","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"cast_label_int","Value":"False","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"user_functions","Value":"def cal_max_ret(df, close, open,benchmark_close,benchmark_open, N):\n ret = df.groupby('instrument', as_index=False, sort=False, group_keys=False).apply(lambda x: (pd.concat([x['close'].shift(-i) / x['open'] - x['benchmark_close'].shift(-i) / x['benchmark_open'] for i in range(N)], axis=1)).max(axis=1))\n \n return ret\n\ndef cal_max_ret_date(df, close, open,benchmark_close,benchmark_open, N):\n ret = df.groupby('instrument', as_index=False, sort=False, group_keys=False).apply(lambda x: pd.concat([x['close'].shift(-i) / x['open'] - x['benchmark_close'].shift(-i) / x['benchmark_open'] for i in range(N)], axis=1))\n return np.nanargmax(np.array(ret), axis=1)\nbigquant_run={'cal_max_ret':cal_max_ret, 'cal_max_ret_date': cal_max_ret_date}","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"instruments","NodeId":"-346"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-346","OutputType":null}],"UsePreviousResults":false,"moduleIdForCode":6,"IsPartOfPartialRun":null,"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='-338' Position='469,193,200,200'/><NodePosition Node='-346' Position='495.491455078125,329,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 09:51:08.050278] INFO: moduleinvoker: instruments.v2 开始运行..
[2020-07-30 09:51:08.131774] INFO: moduleinvoker: instruments.v2 运行完成[0.081484s].
[2020-07-30 09:51:08.135769] INFO: moduleinvoker: advanced_auto_labeler.v2 开始运行..
[2020-07-30 09:51:09.028079] INFO: 自动标注(股票): 加载历史数据: 431567 行
[2020-07-30 09:51:09.029431] INFO: 自动标注(股票): 开始标注 ..
[2020-07-30 09:51:17.314728] INFO: moduleinvoker: advanced_auto_labeler.v2 运行完成[9.178947s].