复制链接
克隆策略

    {"description":"实验创建于2022/3/7","graph":{"edges":[{"to_node_id":"-330:instruments","from_node_id":"-142:data"},{"to_node_id":"-593:instruments","from_node_id":"-142:data"},{"to_node_id":"-162:input_data","from_node_id":"-155:data"},{"to_node_id":"-1558:input_1","from_node_id":"-162:data"},{"to_node_id":"-2032:input_data","from_node_id":"-330:data"},{"to_node_id":"-330:features","from_node_id":"-513:data"},{"to_node_id":"-2032:features","from_node_id":"-513:data"},{"to_node_id":"-3114:input_data","from_node_id":"-2032:data"},{"to_node_id":"-155:data1","from_node_id":"-593:data"},{"to_node_id":"-155:data2","from_node_id":"-3114:data"},{"to_node_id":"-69:input_1","from_node_id":"-1558:data_1"},{"to_node_id":"-4742:input_1","from_node_id":"-1558:data_2"}],"nodes":[{"node_id":"-142","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2021-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2022-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":"-142"}],"output_ports":[{"name":"data","node_id":"-142"}],"cacheable":true,"seq_num":1,"comment":"","comment_collapsed":true},{"node_id":"-155","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":"-155"},{"name":"data2","node_id":"-155"}],"output_ports":[{"name":"data","node_id":"-155"}],"cacheable":true,"seq_num":3,"comment":"","comment_collapsed":true},{"node_id":"-162","module_id":"BigQuantSpace.filter.filter-v3","parameters":[{"name":"expr","value":"cond1 ","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":"-162"}],"output_ports":[{"name":"data","node_id":"-162"},{"name":"left_data","node_id":"-162"}],"cacheable":true,"seq_num":4,"comment":"","comment_collapsed":true},{"node_id":"-330","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":90,"type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-330"},{"name":"features","node_id":"-330"}],"output_ports":[{"name":"data","node_id":"-330"}],"cacheable":true,"seq_num":5,"comment":"","comment_collapsed":true},{"node_id":"-513","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nhigh_1\nclose_0\ncond1 = ((price_limit_status_1 ==3) & (price_limit_status_2 < 3) & (price_limit_status_3 < 3) & (price_limit_status_4 < 3))\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-513"}],"output_ports":[{"name":"data","node_id":"-513"}],"cacheable":true,"seq_num":7,"comment":"","comment_collapsed":true},{"node_id":"-2032","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":"-2032"},{"name":"features","node_id":"-2032"}],"output_ports":[{"name":"data","node_id":"-2032"}],"cacheable":true,"seq_num":6,"comment":"","comment_collapsed":true},{"node_id":"-593","module_id":"BigQuantSpace.use_datasource.use_datasource-v1","parameters":[{"name":"datasource_id","value":"bar1d_CN_STOCK_A","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}],"input_ports":[{"name":"instruments","node_id":"-593"},{"name":"features","node_id":"-593"}],"output_ports":[{"name":"data","node_id":"-593"}],"cacheable":true,"seq_num":8,"comment":"","comment_collapsed":true},{"node_id":"-3114","module_id":"BigQuantSpace.chinaa_stock_filter.chinaa_stock_filter-v1","parameters":[{"name":"index_constituent_cond","value":"%7B%22enumItems%22%3A%5B%7B%22value%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22displayValue%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E4%B8%8A%E8%AF%8150%22%2C%22displayValue%22%3A%22%E4%B8%8A%E8%AF%8150%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%B2%AA%E6%B7%B1300%22%2C%22displayValue%22%3A%22%E6%B2%AA%E6%B7%B1300%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%B8%AD%E8%AF%81500%22%2C%22displayValue%22%3A%22%E4%B8%AD%E8%AF%81500%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%B8%AD%E8%AF%81800%22%2C%22displayValue%22%3A%22%E4%B8%AD%E8%AF%81800%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%B8%8A%E8%AF%81180%22%2C%22displayValue%22%3A%22%E4%B8%8A%E8%AF%81180%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%B8%AD%E8%AF%81100%22%2C%22displayValue%22%3A%22%E4%B8%AD%E8%AF%81100%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%B7%B1%E8%AF%81100%22%2C%22displayValue%22%3A%22%E6%B7%B1%E8%AF%81100%22%2C%22selected%22%3Afalse%7D%5D%7D","type":"Literal","bound_global_parameter":null},{"name":"board_cond","value":"%7B%22enumItems%22%3A%5B%7B%22value%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22displayValue%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%B8%8A%E8%AF%81%E4%B8%BB%E6%9D%BF%22%2C%22displayValue%22%3A%22%E4%B8%8A%E8%AF%81%E4%B8%BB%E6%9D%BF%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E6%B7%B1%E8%AF%81%E4%B8%BB%E6%9D%BF%22%2C%22displayValue%22%3A%22%E6%B7%B1%E8%AF%81%E4%B8%BB%E6%9D%BF%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E5%88%9B%E4%B8%9A%E6%9D%BF%22%2C%22displayValue%22%3A%22%E5%88%9B%E4%B8%9A%E6%9D%BF%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E7%A7%91%E5%88%9B%E6%9D%BF%22%2C%22displayValue%22%3A%22%E7%A7%91%E5%88%9B%E6%9D%BF%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%8C%97%E4%BA%A4%E6%89%80%22%2C%22displayValue%22%3A%22%E5%8C%97%E4%BA%A4%E6%89%80%22%2C%22selected%22%3Afalse%7D%5D%7D","type":"Literal","bound_global_parameter":null},{"name":"industry_cond","value":"%7B%22enumItems%22%3A%5B%7B%22value%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22displayValue%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22%E4%BA%A4%E9%80%9A%E8%BF%90%E8%BE%93%22%2C%22displayValue%22%3A%22%E4%BA%A4%E9%80%9A%E8%BF%90%E8%BE%93%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%BC%91%E9%97%B2%E6%9C%8D%E5%8A%A1%22%2C%22displayValue%22%3A%22%E4%BC%91%E9%97%B2%E6%9C%8D%E5%8A%A1%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E4%BC%A0%E5%AA%92%2F%E4%BF%A1%E6%81%AF%E6%9C%8D%E5%8A%A1%22%2C%22displayValue%22%3A%22%E4%BC%A0%E5%AA%92%2F%E4%BF%A1%E6%81%AF%E6%9C%8D%E5%8A%A1%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%85%AC%E7%94%A8%E4%BA%8B%E4%B8%9A%22%2C%22displayValue%22%3A%22%E5%85%AC%E7%94%A8%E4%BA%8B%E4%B8%9A%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%86%9C%E6%9E%97%E7%89%A7%E6%B8%94%22%2C%22displayValue%22%3A%22%E5%86%9C%E6%9E%97%E7%89%A7%E6%B8%94%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%8C%96%E5%B7%A5%22%2C%22displayValue%22%3A%22%E5%8C%96%E5%B7%A5%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%8C%BB%E8%8D%AF%E7%94%9F%E7%89%A9%22%2C%22displayValue%22%3A%22%E5%8C%BB%E8%8D%AF%E7%94%9F%E7%89%A9%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%95%86%E4%B8%9A%E8%B4%B8%E6%98%93%22%2C%22displayValue%22%3A%22%E5%95%86%E4%B8%9A%E8%B4%B8%E6%98%93%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%9B%BD%E9%98%B2%E5%86%9B%E5%B7%A5%22%2C%22displayValue%22%3A%22%E5%9B%BD%E9%98%B2%E5%86%9B%E5%B7%A5%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%AE%B6%E7%94%A8%E7%94%B5%E5%99%A8%22%2C%22displayValue%22%3A%22%E5%AE%B6%E7%94%A8%E7%94%B5%E5%99%A8%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%BB%BA%E7%AD%91%E6%9D%90%E6%96%99%2F%E5%BB%BA%E7%AD%91%E5%BB%BA%E6%9D%90%22%2C%22displayValue%22%3A%22%E5%BB%BA%E7%AD%91%E6%9D%90%E6%96%99%2F%E5%BB%BA%E7%AD%91%E5%BB%BA%E6%9D%90%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E5%BB%BA%E7%AD%91%E8%A3%85%E9%A5%B0%22%2C%22displayValue%22%3A%22%E5%BB%BA%E7%AD%91%E8%A3%85%E9%A5%B0%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%88%BF%E5%9C%B0%E4%BA%A7%22%2C%22displayValue%22%3A%22%E6%88%BF%E5%9C%B0%E4%BA%A7%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%9C%89%E8%89%B2%E9%87%91%E5%B1%9E%22%2C%22displayValue%22%3A%22%E6%9C%89%E8%89%B2%E9%87%91%E5%B1%9E%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%9C%BA%E6%A2%B0%E8%AE%BE%E5%A4%87%22%2C%22displayValue%22%3A%22%E6%9C%BA%E6%A2%B0%E8%AE%BE%E5%A4%87%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%B1%BD%E8%BD%A6%2F%E4%BA%A4%E8%BF%90%E8%AE%BE%E5%A4%87%22%2C%22displayValue%22%3A%22%E6%B1%BD%E8%BD%A6%2F%E4%BA%A4%E8%BF%90%E8%AE%BE%E5%A4%87%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E7%94%B5%E5%AD%90%22%2C%22displayValue%22%3A%22%E7%94%B5%E5%AD%90%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E7%94%B5%E6%B0%94%E8%AE%BE%E5%A4%87%22%2C%22displayValue%22%3A%22%E7%94%B5%E6%B0%94%E8%AE%BE%E5%A4%87%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E7%BA%BA%E7%BB%87%E6%9C%8D%E8%A3%85%22%2C%22displayValue%22%3A%22%E7%BA%BA%E7%BB%87%E6%9C%8D%E8%A3%85%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E7%BB%BC%E5%90%88%22%2C%22displayValue%22%3A%22%E7%BB%BC%E5%90%88%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E8%AE%A1%E7%AE%97%E6%9C%BA%22%2C%22displayValue%22%3A%22%E8%AE%A1%E7%AE%97%E6%9C%BA%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E8%BD%BB%E5%B7%A5%E5%88%B6%E9%80%A0%22%2C%22displayValue%22%3A%22%E8%BD%BB%E5%B7%A5%E5%88%B6%E9%80%A0%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%80%9A%E4%BF%A1%22%2C%22displayValue%22%3A%22%E9%80%9A%E4%BF%A1%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%87%87%E6%8E%98%22%2C%22displayValue%22%3A%22%E9%87%87%E6%8E%98%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%92%A2%E9%93%81%22%2C%22displayValue%22%3A%22%E9%92%A2%E9%93%81%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%93%B6%E8%A1%8C%22%2C%22displayValue%22%3A%22%E9%93%B6%E8%A1%8C%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%9D%9E%E9%93%B6%E9%87%91%E8%9E%8D%22%2C%22displayValue%22%3A%22%E9%9D%9E%E9%93%B6%E9%87%91%E8%9E%8D%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%A3%9F%E5%93%81%E9%A5%AE%E6%96%99%22%2C%22displayValue%22%3A%22%E9%A3%9F%E5%93%81%E9%A5%AE%E6%96%99%22%2C%22selected%22%3Afalse%7D%5D%7D","type":"Literal","bound_global_parameter":null},{"name":"st_cond","value":"%7B%22enumItems%22%3A%5B%7B%22value%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22displayValue%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%AD%A3%E5%B8%B8%22%2C%22displayValue%22%3A%22%E6%AD%A3%E5%B8%B8%22%2C%22selected%22%3Atrue%7D%2C%7B%22value%22%3A%22ST%22%2C%22displayValue%22%3A%22ST%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22*ST%22%2C%22displayValue%22%3A%22*ST%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E6%9A%82%E5%81%9C%E4%B8%8A%E5%B8%82%22%2C%22displayValue%22%3A%22%E6%9A%82%E5%81%9C%E4%B8%8A%E5%B8%82%22%2C%22selected%22%3Afalse%7D%5D%7D","type":"Literal","bound_global_parameter":null},{"name":"delist_cond","value":"%7B%22enumItems%22%3A%5B%7B%22value%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22displayValue%22%3A%22%E5%85%A8%E9%83%A8%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%80%80%E5%B8%82%22%2C%22displayValue%22%3A%22%E9%80%80%E5%B8%82%22%2C%22selected%22%3Afalse%7D%2C%7B%22value%22%3A%22%E9%9D%9E%E9%80%80%E5%B8%82%22%2C%22displayValue%22%3A%22%E9%9D%9E%E9%80%80%E5%B8%82%22%2C%22selected%22%3Atrue%7D%5D%7D","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":"-3114"}],"output_ports":[{"name":"data","node_id":"-3114"},{"name":"left_data","node_id":"-3114"}],"cacheable":true,"seq_num":10,"comment":"","comment_collapsed":true},{"node_id":"-4742","module_id":"BigQuantSpace.df_save_to_csv.df_save_to_csv-v1","parameters":[{"name":"name","value":"股票名称.csv","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_1","node_id":"-4742"}],"output_ports":[],"cacheable":false,"seq_num":2,"comment":"","comment_collapsed":true},{"node_id":"-1558","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 \n df = df[[\"instrument\",\"high_1\",\"close_0\"]]\n df[\"shouyi\"] = df[\"close_0\"]-df[\"high_1\"]\n \n df[\"a\"] = df[\"shouyi\"] > 0 \n df[\"b\"] = df[\"shouyi\"] <= 0\n df[\"a+b\"] = df[\"a\"] + df[\"b\"]\n df['shouyilv'] = df['shouyi']/df['high_1']\n \n df1 = df.groupby('instrument')['a+b',\"shouyi\",\"high_1\",'a','shouyilv'].sum()\n #df2 = df.groupby('instrument')[\"shouyi\",\"high_1\"].sum()\n #df3 = df.groupby('instrument')['a'].sum()\n \n #df4 = pd.merge(df1,df2,on=\"instrument\",how=\"left\")\n #df5 = pd.merge(df3,df4,on=\"instrument\",how=\"left\")\n \n df1[\"zhong\"] = (df1[\"a+b\"] < 3) *1\n df1[\"hao\"] = ((df1[\"a+b\"] >= 3) & ((df1[\"shouyilv\"]/df1[\"a+b\"]) > 0.02) & (df1[\"a\"]/df1[\"a+b\"] >= 0.70)) *1\n df1[\"cha\"] = ((df1[\"a+b\"] >= 3) & ((df1[\"shouyilv\"]/df1[\"a+b\"]) < -0.02))*1 \n \n df6 = pd.DataFrame(df[\"instrument\"].unique())\n \n #df5[\"gupiao\"] = df6\n #col_name = df5.columns.tolist()\n #df6 = df3['instrument'] #把instrument列单独提出来\n# #col_name.insert(col_name.index('a'),'instrument') # 在 a列前面插入instrument\n# #df5.reindex(columns=col_name)\n# df5['instrument'] = df6\n \n data_1 = DataSource.write_df(df1)\n data_2 = DataSource.write_df(df6)\n data_3 = DataSource.write_df(df)\n return Outputs(data_1=data_1,data_2=data_2,data_3=data_3)\n #return Outputs(data_1=data_1,data_2=data_2)","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":"-1558"},{"name":"input_2","node_id":"-1558"},{"name":"input_3","node_id":"-1558"}],"output_ports":[{"name":"data_1","node_id":"-1558"},{"name":"data_2","node_id":"-1558"},{"name":"data_3","node_id":"-1558"}],"cacheable":true,"seq_num":11,"comment":"","comment_collapsed":true},{"node_id":"-69","module_id":"BigQuantSpace.df_save_to_csv.df_save_to_csv-v1","parameters":[{"name":"name","value":"评价股票最终数据.csv","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_1","node_id":"-69"}],"output_ports":[],"cacheable":false,"seq_num":12,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-142' Position='169,19,200,200'/><node_position Node='-155' Position='213,324,200,200'/><node_position Node='-162' Position='211,402,200,200'/><node_position Node='-330' Position='409,108,200,200'/><node_position Node='-513' Position='504,-1,200,200'/><node_position Node='-2032' Position='410,183,200,200'/><node_position Node='-593' Position='106,157,200,200'/><node_position Node='-3114' Position='375,253,200,200'/><node_position Node='-4742' Position='363,579,200,200'/><node_position Node='-1558' Position='194,489,200,200'/><node_position Node='-69' Position='65.9692611694336,580,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
    In [1]:
    # 本代码由可视化策略环境自动生成 2022年3月24日 17:04
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    # Python 代码入口函数,input_1/2/3 对应三个输入端,data_1/2/3 对应三个输出端
    def m11_run_bigquant_run(input_1, input_2, input_3):
    
        df =  input_1.read_df()
        
        df = df[["instrument","high_1","close_0"]]
        df["shouyi"] = df["close_0"]-df["high_1"]
        
        df["a"] = df["shouyi"] > 0 
        df["b"] = df["shouyi"] <= 0
        df["a+b"] = df["a"] + df["b"]
        df['shouyilv'] = df['shouyi']/df['high_1']
        
        df1 = df.groupby('instrument')['a+b',"shouyi","high_1",'a','shouyilv'].sum()
        #df2 = df.groupby('instrument')["shouyi","high_1"].sum()
        #df3 = df.groupby('instrument')['a'].sum()
        
        #df4 = pd.merge(df1,df2,on="instrument",how="left")
        #df5 = pd.merge(df3,df4,on="instrument",how="left")
        
        df1["zhong"] = (df1["a+b"] < 3) *1
        df1["hao"] = ((df1["a+b"] >= 3) & ((df1["shouyilv"]/df1["a+b"]) > 0.02) & (df1["a"]/df1["a+b"] >= 0.70)) *1
        df1["cha"] = ((df1["a+b"] >= 3) & ((df1["shouyilv"]/df1["a+b"]) < -0.02))*1 
        
        df6 = pd.DataFrame(df["instrument"].unique())
        
        #df5["gupiao"] = df6
        #col_name = df5.columns.tolist()
        #df6 = df3['instrument']   #把instrument列单独提出来
    #     #col_name.insert(col_name.index('a'),'instrument')  # 在 a列前面插入instrument
    #     #df5.reindex(columns=col_name)
    #     df5['instrument'] = df6
        
        data_1 = DataSource.write_df(df1)
        data_2 = DataSource.write_df(df6)
        data_3 = DataSource.write_df(df)
        return Outputs(data_1=data_1,data_2=data_2,data_3=data_3)
        #return Outputs(data_1=data_1,data_2=data_2)
    # 后处理函数,可选。输入是主函数的输出,可以在这里对数据做处理,或者返回更友好的outputs数据格式。此函数输出不会被缓存。
    def m11_post_run_bigquant_run(outputs):
        return outputs
    
    
    m1 = M.instruments.v2(
        start_date='2021-01-01',
        end_date='2022-01-01',
        market='CN_STOCK_A',
        instrument_list='',
        max_count=0
    )
    
    m8 = M.use_datasource.v1(
        instruments=m1.data,
        datasource_id='bar1d_CN_STOCK_A',
        start_date='',
        end_date=''
    )
    
    m7 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    high_1
    close_0
    cond1 = ((price_limit_status_1 ==3) & (price_limit_status_2 < 3) & (price_limit_status_3 < 3) & (price_limit_status_4 < 3))
    """
    )
    
    m5 = M.general_feature_extractor.v7(
        instruments=m1.data,
        features=m7.data,
        start_date='',
        end_date='',
        before_start_days=90
    )
    
    m6 = M.derived_feature_extractor.v3(
        input_data=m5.data,
        features=m7.data,
        date_col='date',
        instrument_col='instrument',
        drop_na=False,
        remove_extra_columns=False,
        user_functions={}
    )
    
    m10 = M.chinaa_stock_filter.v1(
        input_data=m6.data,
        index_constituent_cond=['全部'],
        board_cond=['上证主板', '深证主板'],
        industry_cond=['全部'],
        st_cond=['正常'],
        delist_cond=['非退市'],
        output_left_data=False
    )
    
    m3 = M.join.v3(
        data1=m8.data,
        data2=m10.data,
        on='date,instrument',
        how='inner',
        sort=False
    )
    
    m4 = M.filter.v3(
        input_data=m3.data,
        expr='cond1 ',
        output_left_data=False
    )
    
    m11 = M.cached.v3(
        input_1=m4.data,
        run=m11_run_bigquant_run,
        post_run=m11_post_run_bigquant_run,
        input_ports='',
        params='{}',
        output_ports=''
    )
    
    m12 = M.df_save_to_csv.v1(
        input_1=m11.data_1,
        name='评价股票最终数据.csv'
    )
    
    m2 = M.df_save_to_csv.v1(
        input_1=m11.data_2,
        name='股票名称.csv'
    )