{"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":"-215:instruments","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-8:data"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-53:data1","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-15:data"},{"to_node_id":"-222:features","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-231:features","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-238:features","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-834:features","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-215:features","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-848:input_data","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-53:data"},{"to_node_id":"-156:benchmark_ds","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-60:m_lazy_run"},{"to_node_id":"-231:instruments","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-62:data"},{"to_node_id":"-156:instruments","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-62:data"},{"to_node_id":"-222:input_data","from_node_id":"-215:data"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-53:data2","from_node_id":"-222:data"},{"to_node_id":"-238:input_data","from_node_id":"-231:data"},{"to_node_id":"-122:input_data","from_node_id":"-238:data"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-60:model","from_node_id":"-834:model"},{"to_node_id":"-834:training_ds","from_node_id":"-848:data"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-60:data","from_node_id":"-852:data"},{"to_node_id":"-852:input_data","from_node_id":"-122:data"}],"nodes":[{"node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-8","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2020-06-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2020-12-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":"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/develop/datasource/deprecated/history_data.html\n# 添加benchmark_前缀,可使用对应的benchmark数据\n# 2. 可用操作符和函数见 `表达式引擎 <https://bigquant.com/docs/develop/bigexpr/usage.html>`_\n\n# 计算收益:5日收盘价(作为卖出价格)除以明日开盘价(作为买入价格)\nshift(close, -5) / shift(open, -1)\n\n# 极值处理:用1%和99%分位的值做clip\nclip(label, all_quantile(label, 0.01), all_quantile(label, 0.99))\n\n# 将分数映射到分类,这里使用20个分类\nall_wbins(label, 20)\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":"True","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":"# #号开始的表示注释\n# 多个特征,每行一个,可以包含基础特征和衍生特征\navg_turn_15/turn_0\nmf_net_amount_xl_0\nalpha4=close_0avg_turn_0+close_1avg_turn_1+close_2*avg_turn_2\n#macd的红柱量能线要大于绿色量能线收盘价最低回踩25日内均线不破,可以防止趋势走坏要求macd的黄线慢线要大于0.2\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-60","module_id":"BigQuantSpace.stock_ranker_predict.stock_ranker_predict-v5","parameters":[{"name":"m_lazy_run","value":"False","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"model","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-60"},{"name":"data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-60"}],"output_ports":[{"name":"predictions","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-60"},{"name":"m_lazy_run","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-60"}],"cacheable":true,"seq_num":8,"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":"2020-08-01","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":"-215","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":"60","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-215"},{"name":"features","node_id":"-215"}],"output_ports":[{"name":"data","node_id":"-215"}],"cacheable":true,"seq_num":15,"comment":"","comment_collapsed":true},{"node_id":"-222","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":"-222"},{"name":"features","node_id":"-222"}],"output_ports":[{"name":"data","node_id":"-222"}],"cacheable":true,"seq_num":16,"comment":"","comment_collapsed":true},{"node_id":"-231","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":"60","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-231"},{"name":"features","node_id":"-231"}],"output_ports":[{"name":"data","node_id":"-231"}],"cacheable":true,"seq_num":17,"comment":"","comment_collapsed":true},{"node_id":"-238","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":"-238"},{"name":"features","node_id":"-238"}],"output_ports":[{"name":"data","node_id":"-238"}],"cacheable":true,"seq_num":18,"comment":"","comment_collapsed":true},{"node_id":"-834","module_id":"BigQuantSpace.stock_ranker_train.stock_ranker_train-v6","parameters":[{"name":"learning_algorithm","value":"排序","type":"Literal","bound_global_parameter":null},{"name":"number_of_leaves","value":30,"type":"Literal","bound_global_parameter":null},{"name":"minimum_docs_per_leaf","value":1000,"type":"Literal","bound_global_parameter":null},{"name":"number_of_trees","value":20,"type":"Literal","bound_global_parameter":null},{"name":"learning_rate","value":0.1,"type":"Literal","bound_global_parameter":null},{"name":"max_bins","value":1023,"type":"Literal","bound_global_parameter":null},{"name":"feature_fraction","value":1,"type":"Literal","bound_global_parameter":null},{"name":"data_row_fraction","value":1,"type":"Literal","bound_global_parameter":null},{"name":"plot_charts","value":"True","type":"Literal","bound_global_parameter":null},{"name":"ndcg_discount_base","value":1,"type":"Literal","bound_global_parameter":null},{"name":"m_lazy_run","value":"False","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"training_ds","node_id":"-834"},{"name":"features","node_id":"-834"},{"name":"test_ds","node_id":"-834"},{"name":"base_model","node_id":"-834"}],"output_ports":[{"name":"model","node_id":"-834"},{"name":"feature_gains","node_id":"-834"},{"name":"m_lazy_run","node_id":"-834"}],"cacheable":true,"seq_num":4,"comment":"","comment_collapsed":true},{"node_id":"-848","module_id":"BigQuantSpace.dropnan.dropnan-v2","parameters":[],"input_ports":[{"name":"input_data","node_id":"-848"},{"name":"features","node_id":"-848"}],"output_ports":[{"name":"data","node_id":"-848"}],"cacheable":true,"seq_num":5,"comment":"","comment_collapsed":true},{"node_id":"-852","module_id":"BigQuantSpace.dropnan.dropnan-v2","parameters":[],"input_ports":[{"name":"input_data","node_id":"-852"},{"name":"features","node_id":"-852"}],"output_ports":[{"name":"data","node_id":"-852"}],"cacheable":true,"seq_num":10,"comment":"","comment_collapsed":true},{"node_id":"-122","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%3Atrue%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%3Afalse%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%3Afalse%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%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":"-122"}],"output_ports":[{"name":"data","node_id":"-122"},{"name":"left_data","node_id":"-122"}],"cacheable":true,"seq_num":6,"comment":"","comment_collapsed":true},{"node_id":"-156","module_id":"BigQuantSpace.hftrade.hftrade-v2","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 df = DataSource(\"bar1d_index_CN_STOCK_A\").read(instruments=\"000300.HIX\",start_date=\"2020-01-01\",end_date=\"2020-08-01\")\n df[\"ma\"] = df.close.rolling(5).mean()\n df[\"signal\"] = df.apply(lambda x:1 if x.close>x.ma else 0,axis=1)\n df[\"signal\"] = df[\"signal\"].shift(1) #取昨日的收盘信号\n df=df[[\"date\",\"signal\"]]\n #信号数据\n context.signal_df = df\n #每支股票占比\n context.order_pct = 0.05\n #获取预测股票集\n context.to_buy = context.options['data'].read()\n #注册\n context.subscribe(context.instruments)\n","type":"Literal","bound_global_parameter":null},{"name":"before_trading_start","value":"# 交易引擎:每个单位时间开盘前调用一次。\ndef bigquant_run(context, data):\n now = data.current_dt.strftime('%Y-%m-%d')\n context.today = data.current_dt.strftime('%Y-%m-%d')\n context.signal = context.signal_df[context.signal_df.date==now][\"signal\"].iloc[0]\n context.handle_flag = 0 #由于是分钟回测,每天只需要处理一次买卖\n context.sold_stock_list = []\n context.position_check = context.get_positions()\n print('日期{} 持仓 {} -----------'.format(now, context.position_check))\n","type":"Literal","bound_global_parameter":null},{"name":"handle_tick","value":"# 交易引擎:tick数据处理函数,每个tick执行一次\ndef bigquant_run(context, data):\n pass\n","type":"Literal","bound_global_parameter":null},{"name":"handle_data","value":"#卖出函数\ndef sell_stock(context,data,msg):\n #获取当前所有持仓\n stock_hold_now = context.get_account_positions()\n for instr in stock_hold_now:\n if instr not in context.sold_stock_list:\n #卖出可用仓位(可能有今仓)\n position = context.get_position(instr).avail_qty\n if(position>0):\n #最新价格\n price = data.current(instr, 'close')\n context.order(instr, -position, price, order_type=OrderType.MARKET)\n context.sold_stock_list.append(instr)\n print(\"{}卖出{} {}\".format(msg,instr,position))\n\n# 交易引擎:bar数据处理函数,每个单位执行一次\ndef bigquant_run(context, data):\n \n #signal为0开盘卖\n if context.signal == 0:\n msg = context.today+\" 开盘\"\n sell_stock(context,data,msg)\n \n current_stopwin_stock = []\n current_stoploss_stock = []\n if len(context.position_check) > 0:\n #------------------------START:止赢止损模块(含建仓期)---------------\n positions_cost={e:p.cost_price for e,p in context.get_positions().items()}\n avail_positions = {e: p.avail_qty for e, p in context.get_positions().items()}\n for instrument in positions_cost.keys():\n s = context.get_position(instrument).cost_price\n stock_cost=positions_cost[instrument]\n stock_market_price=data.current(context.symbol(instrument),'price')\n if stock_market_price/stock_cost-1>=0.2 and avail_positions[instrument] != 0:\n context.order_target(instrument, 0, order_type=OrderType.MARKET)\n print('止盈成功, 止盈标的{}'.format(instrument))\n current_stopwin_stock.append(instrument)\n elif stock_market_price/stock_cost-1 <= -0.05 and avail_positions[instrument] != 0:\n context.order_target(instrument, 0, order_type=OrderType.MARKET)\n print('止损成功, 止损标的{}'.format(instrument))\n current_stoploss_stock.append(instrument)\n if len(current_stopwin_stock)>0:\n# print(context.today,'止盈股票列表',current_stopwin_stock)\n context.sold_stock_list += current_stopwin_stock\n if len(current_stoploss_stock)>0:\n# print(context.today,'止损股票列表',current_stoploss_stock)\n context.sold_stock_list += current_stoploss_stock\n #--------------------------END: 止赢止损模块--------------------------\n \n\n #signal为1尾盘卖\n if context.signal == 1:\n cur_date = data.current_dt\n cur_hm = cur_date.strftime('%H:%M')\n if(cur_hm==\"14:55\"):\n msg = str(cur_date)+\" 尾盘\"\n sell_stock(context,data,msg)\n \n #每天只处理一次\n if context.handle_flag==1:\n return\n \n #买入预测集的前5只股票\n now_data = context.to_buy[context.to_buy['date']==context.today]\n today_to_buy = []\n if not now_data.empty:\n today_to_buy = now_data.instrument[:5].to_list()\n print(context.today,\"=======早盘计划买入股票 {}\".format(today_to_buy))\n \n # 获取账户资金\n total_portfolio = context.portfolio.portfolio_value\n\n for instr in today_to_buy:\n if instr not in context.sold_stock_list:\n #最新价格\n price = data.current(instr, 'close')\n\n #计算买入此股票的数量,不要超过总资金的某个比例\n context.order_value(instr, total_portfolio*context.order_pct, price, order_type=OrderType.MARKET)\n print(\"买入{}\".format(instr))\n \n context.handle_flag = 1\n\n","type":"Literal","bound_global_parameter":null},{"name":"handle_trade","value":"# 交易引擎:成交回报处理函数,每个成交发生时执行一次\ndef bigquant_run(context, data):\n pass\n","type":"Literal","bound_global_parameter":null},{"name":"handle_order","value":"# 交易引擎:委托回报处理函数,每个委托变化时执行一次\ndef bigquant_run(context, data):\n pass\n","type":"Literal","bound_global_parameter":null},{"name":"after_trading","value":"# 交易引擎:盘后处理函数,每日盘后执行一次\ndef bigquant_run(context, data):\n pass\n","type":"Literal","bound_global_parameter":null},{"name":"capital_base","value":"1000000","type":"Literal","bound_global_parameter":null},{"name":"frequency","value":"minute","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":"before_start_days","value":"0","type":"Literal","bound_global_parameter":null},{"name":"benchmark","value":"000300.HIX","type":"Literal","bound_global_parameter":null},{"name":"plot_charts","value":"True","type":"Literal","bound_global_parameter":null},{"name":"disable_cache","value":"False","type":"Literal","bound_global_parameter":null},{"name":"show_debug_info","value":"False","type":"Literal","bound_global_parameter":null},{"name":"backtest_only","value":"False","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-156"},{"name":"options_data","node_id":"-156"},{"name":"history_ds","node_id":"-156"},{"name":"benchmark_ds","node_id":"-156"}],"output_ports":[{"name":"raw_perf","node_id":"-156"}],"cacheable":false,"seq_num":13,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-8' Position='236.6680908203125,28.487091064453125,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-15' Position='74,183,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-24' Position='764.7112426757812,21,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-53' Position='192,399,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-60' Position='998.887939453125,712.1809692382812,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-62' Position='1088,23,200,200'/><node_position Node='-215' Position='403.646484375,194.95687866210938,200,200'/><node_position Node='-222' Position='369.71124267578125,314.8232421875,200,200'/><node_position Node='-231' Position='1119.3319091796875,236,200,200'/><node_position Node='-238' Position='1083,367,200,200'/><node_position Node='-834' Position='342.57757568359375,645.6465454101562,200,200'/><node_position Node='-848' Position='238.1077880859375,521.4008178710938,200,200'/><node_position Node='-852' Position='1092,515,200,200'/><node_position Node='-122' Position='1105,441,200,200'/><node_position Node='-156' Position='691.7897720336914,836.81787109375,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
[2021-12-03 13:25:00.911074] INFO: moduleinvoker: instruments.v2 开始运行..
[2021-12-03 13:25:00.934910] INFO: moduleinvoker: 命中缓存
[2021-12-03 13:25:00.937052] INFO: moduleinvoker: instruments.v2 运行完成[0.025991s].
[2021-12-03 13:25:00.945444] INFO: moduleinvoker: advanced_auto_labeler.v2 开始运行..
[2021-12-03 13:25:00.955155] INFO: moduleinvoker: 命中缓存
[2021-12-03 13:25:00.956585] INFO: moduleinvoker: advanced_auto_labeler.v2 运行完成[0.011145s].
[2021-12-03 13:25:00.960984] INFO: moduleinvoker: input_features.v1 开始运行..
[2021-12-03 13:25:00.971544] INFO: moduleinvoker: 命中缓存
[2021-12-03 13:25:00.973016] INFO: moduleinvoker: input_features.v1 运行完成[0.012034s].
[2021-12-03 13:25:00.992777] INFO: moduleinvoker: general_feature_extractor.v7 开始运行..
[2021-12-03 13:25:01.004269] INFO: moduleinvoker: 命中缓存
[2021-12-03 13:25:01.005971] INFO: moduleinvoker: general_feature_extractor.v7 运行完成[0.013214s].
[2021-12-03 13:25:01.018912] INFO: moduleinvoker: derived_feature_extractor.v3 开始运行..
[2021-12-03 13:25:01.028219] INFO: moduleinvoker: 命中缓存
[2021-12-03 13:25:01.029761] INFO: moduleinvoker: derived_feature_extractor.v3 运行完成[0.010853s].
[2021-12-03 13:25:01.039808] INFO: moduleinvoker: join.v3 开始运行..
[2021-12-03 13:25:01.051718] INFO: moduleinvoker: 命中缓存
[2021-12-03 13:25:01.053132] INFO: moduleinvoker: join.v3 运行完成[0.013325s].
[2021-12-03 13:25:01.097031] INFO: moduleinvoker: dropnan.v2 开始运行..
[2021-12-03 13:25:01.105964] INFO: moduleinvoker: 命中缓存
[2021-12-03 13:25:01.108033] INFO: moduleinvoker: dropnan.v2 运行完成[0.011006s].
[2021-12-03 13:25:01.115648] INFO: moduleinvoker: stock_ranker_train.v6 开始运行..
[2021-12-03 13:25:01.128138] INFO: moduleinvoker: 命中缓存
[2021-12-03 13:25:01.294254] INFO: moduleinvoker: stock_ranker_train.v6 运行完成[0.178594s].
[2021-12-03 13:25:01.299591] INFO: moduleinvoker: instruments.v2 开始运行..
[2021-12-03 13:25:01.310443] INFO: moduleinvoker: 命中缓存
[2021-12-03 13:25:01.312295] INFO: moduleinvoker: instruments.v2 运行完成[0.012707s].
[2021-12-03 13:25:01.324576] INFO: moduleinvoker: general_feature_extractor.v7 开始运行..
[2021-12-03 13:25:01.332655] INFO: moduleinvoker: 命中缓存
[2021-12-03 13:25:01.334202] INFO: moduleinvoker: general_feature_extractor.v7 运行完成[0.009641s].
[2021-12-03 13:25:01.340702] INFO: moduleinvoker: derived_feature_extractor.v3 开始运行..
[2021-12-03 13:25:01.347399] INFO: moduleinvoker: 命中缓存
[2021-12-03 13:25:01.348705] INFO: moduleinvoker: derived_feature_extractor.v3 运行完成[0.008008s].
[2021-12-03 13:25:01.396143] INFO: moduleinvoker: chinaa_stock_filter.v1 开始运行..
[2021-12-03 13:25:01.404945] INFO: moduleinvoker: 命中缓存
[2021-12-03 13:25:01.406497] INFO: moduleinvoker: chinaa_stock_filter.v1 运行完成[0.01037s].
[2021-12-03 13:25:01.419675] INFO: moduleinvoker: dropnan.v2 开始运行..
[2021-12-03 13:25:01.431504] INFO: moduleinvoker: 命中缓存
[2021-12-03 13:25:01.433041] INFO: moduleinvoker: dropnan.v2 运行完成[0.013378s].
[2021-12-03 13:25:01.440972] INFO: moduleinvoker: stock_ranker_predict.v5 开始运行..
[2021-12-03 13:25:01.491039] INFO: moduleinvoker: 命中缓存
[2021-12-03 13:25:01.492604] INFO: moduleinvoker: stock_ranker_predict.v5 运行完成[0.051628s].
bigcharts-data-start/{"__type":"tabs","__id":"bigchart-e8e36a78be624934b94fcc66cfb4ee97"}/bigcharts-data-end
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-11-0a81c4d99042> in <module>
267 m13 = M.hftrade.v2(
268 instruments=m9.data,
--> 269 benchmark_ds=m8.m_lazy_run,
270 start_date='',
271 end_date='',
AttributeError: 'Outputs' object has no attribute 'm_lazy_run'